-
Notifications
You must be signed in to change notification settings - Fork 74
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
Let the user define the decompressed file name. #203
Conversation
💖 Thanks for opening your first pull request! 💖 Please make sure you read the following:
A few things to keep in mind:
|
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.
Hi @horta!
Thanks for the contribution.
I understand your discomfort with the default uncompressed file names.
Nevertheless I'm a little bit worried about possible unwanted scenarios that might appear by letting users to change the uncompressed filenames.
I think the main reason behind hard-coding the default uncompressed filename as fname + ".decomp"
was to have unique filenames for the uncompressed files.
So letting users to change that might generate situations where files are overwritten or redownloaded, just because the would share the same filename.
Nevertheless maybe I'm being overcautious and such situations would be rare and easy to fix. And taking into account that renaming files won't be the default behavior of Decompress
, maybe it would be fine to incorporate this feature.
I would like to hear @leouieda opinion on this, but it's very likely we would need to wait until mid September.
I leave some small changes on your code. Feel free to apply them.
Co-authored-by: Santiago Soler <santiago.r.soler@gmail.com>
Co-authored-by: Santiago Soler <santiago.r.soler@gmail.com>
Co-authored-by: Santiago Soler <santiago.r.soler@gmail.com>
Co-authored-by: Santiago Soler <santiago.r.soler@gmail.com>
Co-authored-by: Santiago Soler <santiago.r.soler@gmail.com>
Co-authored-by: Santiago Soler <santiago.r.soler@gmail.com>
Co-authored-by: Santiago Soler <santiago.r.soler@gmail.com>
Co-authored-by: Santiago Soler <santiago.r.soler@gmail.com>
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.
@horta thanks for implementing this! I confess that I have the same fears as @santisoler but I agree that we might be overly paranoid. There is also nothing to guarantee that the .decomp
file doesn’t conflict as well. I’m in favor of adding this to Decompress
.
We should also open an issue to add checks to the processors if the file already exists and the action is “download” (meaning that the file shouldn’t be there already). This is a good indicator of a conflicting file name and we should issue a warning or exception.
A few comments on this PR:
- The order of authors is alphabetical by last name, so you’d come right after Mathias :-)
- Why not just pass in the desired file name instead of a callback? It would be a lot simpler (to code and test) and likely cover all desired use cases. Remember “simple is better than complex”.
- We recently completely restructured the docs (Refactor the documentation into separate pages #202) so you have a conflict there. This could probably go in
doc/processors.rst
instead.
Hi @horta I'm just getting back from holidays and trying to catch up on OSS work. Any updates on this? Let me know if you need/want any help moving this forward. |
Lets move forward. Is that looking better? I agree with the simplicity of giving a string instead of a callback. |
Move the new documentation to the appropriate page.
Add the warning about overwriting files and clarify that the name shouldn't have the path.
@horta sorry for dropping this. This looks good! I merged in the latest changes from the master branch (basically moved the docs to |
🎉🎉🎉 Congrats on merging your first pull request and welcome to the team! 🎉🎉🎉 If you would like to be added as a author on the Zenodo archive of the next release, make sure that you have added your full name, affiliation, and ORCID (optional) to the We hope that this was a good experience for you. Let us know if there is any way that the contributing process could be improved. |
@horta thank you for adding this new feature! Hope to see you around the project in the future as wel 🙂 |
Well done! Thanks! |
I don't like the decompressed file name as it is. I would like to define my own custom naming.
In particular, I want files like "foo.csv.gz" to become "foo.csv" when decompressed.
The changes I'm proposing is backward compatible and are minimal, in my opinion.
Let me know what you think and thanks a lot for this amazing package!
Reminders:
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
and the base__init__.py
file for the package.AUTHORS.md
file (if you haven't already) in case you'd like to be listed as an author on the Zenodo archive of the next release.