-
Notifications
You must be signed in to change notification settings - Fork 21
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
Move OpenIJTIFF python to module/conda-package #647
Conversation
in preparation of creating a python package out of it.
* Ran black for a more objective code style * Fixed some type annotations (mostly in order to understand the better understand the code * Added more docstrings mostly in order to better understand the code * Ensured google-style docstrings
Note: This changes the behavior a bit. Previous version was opening the tiff file and immediately unlinking the file, such that it was deleted once tifffile closed the handle. However, this was not supported on windows, where a blank try except was employed to hide it and also obscure what was really happening. Now the behavior on all osses is the same and users can employ the os-specific way to clean up their temp folder.
would prefer to remove the special handling of fetching extra metadata as it's also not used in the tutorial. Typing gets ugly with the different return types.
it's also not really good practice.
@k-dominik thanks a lot for working on this! Sorry, this may be a dump question, becuase I don't know enough about python: How would the students install the OpenIJTIFF python module? |
Hi @tischi, before being able to install the package has to be built first - there are several options.
|
OK, thanks, then I will just merge such that we can go ahead. |
I have built the package and uploaded it to our conda channel (euro-bioimaging). When I installed it to a fresh conda environment and briefly tested the |
If there is an |
This will enable installing
OpenIJTIFF
as a module. I didn't change the name of the module (although it's not canonical, and the name doesn't work for a conda package). So no code changes needed in the notebooks.Summary:
OSErrors
which happened when cleaning up the temporary directory while having the file open intifffile
. Disabled cleaning up on all osses now - linux and osx will likely clean up on reboot, and on windows (which wouldn't cleanup before anyways) users can trigger temp cleanup themselves.sys.path
modifications as those are not necessary anymore to use the functionalityI also felt an itch to remove the fetching of extra metadata (as it doesn't seem to be used in the tutorial and complicates typing. Also variable number of return values is not a good pattern. But left it for now.
CC: @bugraoezdemir @tischi