-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore: compression level as only option #162
Conversation
@click.option( | ||
"--netcdf-compression-level", | ||
type=click.IntRange(0, 9), | ||
default=0, |
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 guess the behavior should be the following:
copernicusmarine subset -i whateve -v somev -> netcdf_compression_level = None or 0 or False
copernicusmarine subset -i whateve -v somev --netcdf-compression-level -> netcdf_compression_level = 1
copernicusmarine subset -i whateve -v somev --netcdf-compression-level n -> netcdf_compression_level = n
(from what said on this: https://cms-change.atlassian.net/browse/CMT-122)
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 created the change to allow for this, maybe some tests to check it would be nice: I will add them later (after the presentation hehe)
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.
What about the python interface? Should it also accept "True" as an option? Would be weird, no?
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.
No because in python flags don't exist :D so I think it's fine like this!
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.
It works well right? You made sure that if you just use the flag with no number it compresses to 1? If yes, looks good to me
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.
Yes, I made a test for that!
@click.option( | ||
"--netcdf-compression-level", | ||
type=click.IntRange(0, 9), | ||
default=0, |
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.
No because in python flags don't exist :D so I think it's fine like this!
@click.option( | ||
"--netcdf-compression-level", | ||
type=click.IntRange(0, 9), | ||
default=0, |
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.
It works well right? You made sure that if you just use the flag with no number it compresses to 1? If yes, looks good to me
No need to specify `--netcdf-compression-enabled` to be able to compress. Works also as a flag to compress to level 1.
No need to specify `--netcdf-compression-enabled` to be able to compress. Works also as a flag to compress to level 1.
Until now, there existed 2 options:
--netcdf-compression-enabled
and--netcdf-compression-level
.The enabled was a boolean to allow for compression, the level was an integer between 0 and 9 to allow to choose the level of compression.
We squashed the two options together, making users choose a level of compression (maybe would be better to recommend to use 1 first) and that is it. The default option would remain 0, as that is the no compression type.