Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use flat folder for JATS output #50

Merged
merged 1 commit into from
May 10, 2024
Merged

Use flat folder for JATS output #50

merged 1 commit into from
May 10, 2024

Conversation

tarleb
Copy link
Collaborator

@tarleb tarleb commented Apr 25, 2024

No description provided.

@tarleb tarleb requested review from arfon and xuanxu April 25, 2024 11:35
@tarleb
Copy link
Collaborator Author

tarleb commented Apr 25, 2024

@xuanxu I forgot, how are the artifacts copied to the target repository? Would it help if Inara took a target directory as another argument?

Copy link
Member

@xuanxu xuanxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tarleb all files in the media folder are copied to the target repository (also to a media folder).
It is useful to get all media files from Inara in the media folder to know what to copy.
If we don't want the files to be in a final folder, I think is better to update it in the action pushing to the repo than here.

@xuanxu
Copy link
Member

xuanxu commented Apr 29, 2024

If I understand it correctly, we need:

  • All the images in the same directory as the jats file
  • The correct relative references in the JATS file to the images
  • A directory to know what to upload to the final repository

Would it be easier to have jats file and images in a separate jats_files (for example) directory?

@arfon
Copy link
Member

arfon commented May 7, 2024

Would it be easier to have jats file and images in a separate jats_files (for example) directory?

Yeah, I agree I think this would be the ideal solution here (a self-contained folder with everything in related to JATS, but also without any nested folders).

@tarleb tarleb force-pushed the flat-output-structure branch 2 times, most recently from 0becb81 to 6c187e3 Compare May 8, 2024 09:51
The JATS output file is placed in a folder `paper.jats` together with
all media files. A truly flat structure is ensured, i.e., images are in
the same folder as the resulting `paper.jats` file, and never in
subfolders.
@tarleb
Copy link
Collaborator Author

tarleb commented May 8, 2024

I think this should do for now: Instead of a file paper.jats, we now create a folder paper.jats that has all the relevant data, including the images, all at the same level. Example:

paper.jats
├── mandrill.jpg
├── nyan-cat.png
├── paper.jats
└── sylt.jpg

@tarleb tarleb changed the title [WIP] Ensure that images are not placed in subfolders Use flat folder for JATS output May 8, 2024
@tarleb tarleb marked this pull request as ready for review May 8, 2024 10:00
@tarleb
Copy link
Collaborator Author

tarleb commented May 8, 2024

If that's easier, then we could also make that a paper.jats.zip archive.

@arfon
Copy link
Member

arfon commented May 9, 2024

we now create a folder paper.jats that has all the relevant data, including the images, all at the same level. Example:

Just for absolute clarity – the paper (e.g., paper.jats.xml) will also be in that same directory?

@xuanxu
Copy link
Member

xuanxu commented May 9, 2024

I've prepared a branch in the GH actions to use this changes and keep the paper.jats folder when uploading to the papers repo. I'll merge the changes once this new version of inara is up.

@xuanxu
Copy link
Member

xuanxu commented May 9, 2024

Just for absolute clarity – the paper (e.g., paper.jats.xml) will also be in that same directory?

Yes, the paper.jats folder includes the xml and any media files

@tarleb
Copy link
Collaborator Author

tarleb commented May 9, 2024

Sorry, I'm not entirely clear on these questions:

  1. Is there more work needed on Inara?
  2. Who will merge the PRs? (I assume @xuanxu?)

@xuanxu
Copy link
Member

xuanxu commented May 9, 2024

1. Is there more work needed on Inara?

I don't think so (every new commit is automatically re-publishing the Inara Docker image, right?). This is ready.

2. Who will merge the PRs? (I assume @xuanxu?)

I'll merge them all at the same time tomorrow morning so I can monitor the actions.

@xuanxu xuanxu merged commit 4b56e08 into main May 10, 2024
3 checks passed
@tarleb tarleb deleted the flat-output-structure branch May 10, 2024 08:26
@arfon
Copy link
Member

arfon commented May 10, 2024

Thanks @tarleb!

@xuanxu
Copy link
Member

xuanxu commented May 10, 2024

@arfon
Copy link
Member

arfon commented May 10, 2024

Hang on, isn't this URL incorrect?

https://github.com/openjournals/joss-papers/blob/eff5cbbffd13961e4399e80bde0033daed1221de/joss.05618/paper.jats/10.21105.joss.05618.jats#L159

(i.e., I think it should be ./matbench-genmetrics.png)

@xuanxu
Copy link
Member

xuanxu commented May 10, 2024

@arfon ouch, you are right, the files are in the right place but the URLs for images in the paper all point to /paper.jats/ folder https://github.com/openjournals/joss-papers/blob/master/joss.06017/paper.jats/10.21105.joss.06017.jats#L253
Is this easy to fix @tarleb?

@tarleb
Copy link
Collaborator Author

tarleb commented May 10, 2024

Argh, my bad. I'll open a new PR in a minute.

@tarleb
Copy link
Collaborator Author

tarleb commented May 11, 2024

See #53. Do we want to keep the /paper.jats/ path or shorten that to just /jats/?

@xuanxu
Copy link
Member

xuanxu commented May 13, 2024

Merged! I think paper.jats is fine

@xuanxu
Copy link
Member

xuanxu commented May 13, 2024

@arfon can you reaccept this one to regenerate the files? openjournals/joss-reviews#6017

@arfon
Copy link
Member

arfon commented May 13, 2024

Done

@xuanxu
Copy link
Member

xuanxu commented May 13, 2024

Hey @tarleb, merging #53 seems to have modified the DTD declaration in the generated JATS file, and that makes the validation fail, see the first lines here:
openjournals/joss-papers@554242d
Is that intentional (in which case I'll update the xml validator) or is a bug?

@xuanxu
Copy link
Member

xuanxu commented May 13, 2024

I've updated the XML validator gem so now we can validate both the Journal Publishing and the Journal Archiving and Interchange tag sets.

Still not sure which of them we should use in Inara to generate the paper.jats file.
@arfon I think PubMed recommends the Journal Publishing one?

@tarleb
Copy link
Collaborator Author

tarleb commented May 13, 2024

This was not intended, sorry. I'll push the fix without PR.

Note to self: better not to rush out patches at 2am after the ESC.

@xuanxu
Copy link
Member

xuanxu commented May 14, 2024

Do we want to keep the /paper.jats/ path or shorten that to just /jats/?

hey @tarleb, I noticed that sometimes there's already a paper.jats file in the repository created by the authors of the submission and that has caused conflicts on a couple reviews already, so on a second thought it's better to use another name for the folder, /jats/ or /paper_jats/ for instance.

@tarleb
Copy link
Collaborator Author

tarleb commented May 15, 2024

I've opened #54 for that.

@arfon
Copy link
Member

arfon commented Jun 29, 2024

Hey both. Can I just check where we landed here? In the joss-papers repo I see a PR that's flattening folders (good), but doesn't seem to be putting the papers into a jats folder.

Also, this most recently-merged PR looks to still be using the old paper.jats repo format?

@xuanxu
Copy link
Member

xuanxu commented Jun 30, 2024

Right now, in the joss-papers repo all the jats files (.jats and images) are placed in a paper.jats folder, so the structure is something like this:

joss-paper-1234.pdf
\paper.jats
    joss-paper-1234.jats
    image1.png
    image2.png

The paper.jats folder name was problematic when generated in the GitHub action step, where sometimes conflicted with other files present in the submitted sofwtare's repo, so now inara creates the jats output in a folder called jats, it is an internal change. When uploading the files to a branch in the joss-papers repo, there is no problems with the name of the folder so paper.jats is still used there.

@arfon
Copy link
Member

arfon commented Jul 1, 2024

Ah great. So there's nothing to do here?

@xuanxu
Copy link
Member

xuanxu commented Jul 1, 2024

Right, I think we're good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants