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

Improve io module #112

Merged
merged 3 commits into from
Sep 9, 2024
Merged

Improve io module #112

merged 3 commits into from
Sep 9, 2024

Conversation

cgohlke
Copy link
Member

@cgohlke cgohlke commented Sep 6, 2024

Description

This PR proposes several improvements mainly to the io module:

  • Add option to specify dataset description in phasor_to_ometiff. Requires tifffile>=2024.8.30.

  • Add a note to phasor_to_ometiff that the format is experimental and not meant for long-term storage.

  • Add phasor_to_simfcs_referenced function to store phasor coordinates in SimFCS R64 format. The function writes chunked and/or padded files for dimensions not supported by the R64 format.

  • Add phasor_from_simfcs_referenced function to directly read phasor coordinates from SimFCS REF or R64 files.

  • Remove redundant read_ref and read_r64 functions, which are replaced by phasor_from_simfcs_referenced.

  • Delay import of xarray since not all functions are using xarray.

  • Add private _utils.chunk_iter function to iterate over chunk indices of ndarrays.

  • Move phasor._parse_harmonic function to _utils.parse_harmonic since it is used in more than one module.

  • Add tests for parse_harmonic function.

  • Update tutorials with new functionality.

  • Add private _utils module to API documentation to make sure docstrings are rendered correctly.

Things postponed from this PR to another PR:

  • Add read_imspector_tiff function to read FLUTE dataset files (Support ImSpector FLIM TIFF files #105).

  • Add option to return specific harmonics from phasor_from_ometiff.

  • Consider changing phasor_from_ometiff function to return numpy instead of xarray arrays. Attributes would be returned as a separate dict.

Release note

Summarize the changes in the code block below to be included in the
release notes:

Improve io module

Checklist

  • The pull request title, summary, and description are concise.
  • Related issues are linked in the description.
  • New dependencies are explained.
  • The source code and documentation can be distributed under the MIT license.
  • The source code adheres to code standards.
  • New classes, functions, and features are thoroughly tested.
  • New, user-facing classes, functions, and features are documented.
  • New features are covered in tutorials.
  • No files other than source code, documentation, and project settings are added to the repository.

@cgohlke cgohlke added the enhancement New feature or request label Sep 6, 2024
@cgohlke cgohlke self-assigned this Sep 6, 2024
Copy link
Contributor

@bruno-pannunzio bruno-pannunzio left a comment

Choose a reason for hiding this comment

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

Hi @cgohlke! I reviewed all the changes, and they look great—these are valuable modifications that will definitely enhance the project.

One thing I noticed is in the API documentation, the _phasorpy module, which contains Cython implementations, appears to be empty. I’m not sure if this is intentional to indicate the presence of a private Cython module, but the functions aren’t listed or described. Could you clarify whether this is by design or if something might be missing?

@cgohlke
Copy link
Member Author

cgohlke commented Sep 9, 2024

in the API documentation, the _phasorpy module, which contains Cython implementations, appears to be empty.

Yes, I got stuck on that. There are some format errors (trying to fix them now) and unfortunately the many ufuncs are not recognized because they are decorated cdefs.

@cgohlke cgohlke merged commit 80377ea into phasorpy:main Sep 9, 2024
16 checks passed
@cgohlke cgohlke deleted the io branch September 9, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants