-
Notifications
You must be signed in to change notification settings - Fork 14
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
adds a --metadata-only option to pack #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I highlighted the relevant changes
README.md
Outdated
`--server` creates the transfer.xml file but does not copy data | ||
or generate an archive. The last cli argument is the path where the `transfer.xml` | ||
file will be written | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new documentation in README
README.md
Outdated
|
||
Examples: | ||
``` | ||
omero transfer pack Image:123 transfer_pack.tar | ||
omero transfer pack --zip Image:123 transfer_pack.zip | ||
omero transfer pack Dataset:1111 /home/user/new_folder/new_pack.tar | ||
omero transfer pack 999 tarfile.tar # equivalent to Project:999 | ||
omero transfer pack --server Dataset:1111 /home/user/new_folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new example
src/omero_cli_transfer.py
Outdated
pack.add_argument( | ||
"--server", | ||
help="Only generate the xml file, don't create the archive", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argument added
src/omero_cli_transfer.py
Outdated
if args.server and args.simple: | ||
raise ValueError("The --server and --simple options are incompatible") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--server and --simple are mutually exclusive (I think?)
src/omero_cli_transfer.py
Outdated
if not args.server: | ||
tar_path = Path(args.filepath) | ||
folder = str(tar_path) + "_folder" | ||
else: | ||
tar_path = Path(args.filepath) | ||
if tar_path.suffix: | ||
folder = os.path.splitext(tar_path)[0] | ||
print("Output will be written to {folder}") | ||
else: | ||
folder = tar_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filepath argument change
src/omero_cli_transfer.py
Outdated
if not args.server: | ||
print("Starting file copy...") | ||
self._copy_files(path_id_dict, folder, self.gateway) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't copy
src/omero_cli_transfer.py
Outdated
elif not args.server: | ||
self._package_files(os.path.splitext(tar_path)[0], args.zip, folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't pacakge
That was fast! I have a busy day today but will have a closer look tomorrow. Thanks a lot! |
README.md
Outdated
`--metadata` allows you to specify which transfer metadata will be saved in `transfer.xml` as possible MapAnnotation values to the images. Defaults to image ID, timestamp, software version, source hostname, md5, source username, source group. | ||
`--metadata` allows you to specify which transfer metadata will be saved in `transfer.xml` as possible MapAnnotation values to the images. Defaults to image ID, timestamp, software version, source hostname, md5, source username, source group. | ||
|
||
`--metadata_only` creates the transfer.xml file but does not copy data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this parallelism, I wonder if this is actually a --binary
flag similar to the --metadata
flag which takes options: files (default), none,
and then in the future we could ask it to convert to OME-TIFF/OME-Zarr, for example. That doesn't help with the final argument handling or the exclusivity with simple/rocrate/etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here "binary" means all data that is not metadata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, "big things that might be downloaded". File attachments might end up being a special case with my other examples (OME-TIFF/Zarr). This is certainly where --server
was more straight-forward because it meant, "I have access to all of the binaries and can do what I want with them"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at some point if we decide to be granular about which kinds of annotations are saved with the images as well. maybe 3 similar options covering what can be stored (--metadata
, --annotations
, --binaries
) is the way to go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that, with there just being some confusing overlap between metadata
and annotation
(and in the case of FileAnnotations
, all three)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the confusion is lessened if this is ordered metadata < annotation < full
metadata
would then be a single file (xml
, tsv
, jsonld
) and annotation
everything but the binaries.
I don't see why you would want only annotations or binaries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK where ROIs sit though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will probably need some rework in the near future anyway (current --metadata
would probably be better as --provenance
or something like that) and there are good questions (ROIs? FileAnnotations? Where do they fit?). But in general I like --binaries
as a solution for now ("none"
would fall into the case for this PR, "all"
would be default).
A minor heads up that my test of:
was slightly confusing in that it didn't tar but created the "transfer" directory. |
Yes, this is not ideal! Maybe in that case (if the last positional argument ends with |
that makes sense to me. (in fact, this should probably be true for everything: if it ends in |
Hi @erickmartins I can't find how to re-run the tests, it does not look like something I can fix on my side. Is there anything I should do now to advance the PR? I can implement what @joshmoore was saying about argument parsing |
Assuming #75 is merged in or this is rebased on top, then I'd assume:
should run the tests. (@jburel can let us know if a special branch of omero-test-infra is needed) |
#75 is now merged. Note that you do need to set an environment variable with |
@glyg you need to rebase, the files have now been removed. This repository uses the upstream omero-test-infra |
Yes sorry, rebasing now |
strange that f073695 is necessary I will have assumed that this should be included with the rebase |
might be my bad, I solved a lot of merge conflict, maybe I wrongly rm'ed .omero at some point |
Here is a PR related to #69
Sorry for the messy diff, I forgot to disable automated black formatting in my editor. I'll try to revert that and just show the additions tomorrow.
Mainly I just changed from the line 494 to the end of the function
I added a very naïve test, but I did not yet manage to have the test suite running.