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

Add lazy-loader support and improve imagetool functionality #74

Merged
merged 28 commits into from
Dec 14, 2024

Conversation

kmnhan
Copy link
Owner

@kmnhan kmnhan commented Dec 10, 2024

Implement lazy-loading for top-level modules and the analysis module, allowing direct access to submodules.

Enhance imagetool with normalization options for 1D plots and fix issues related to nonuniform data input and cropping.

Properly implements [SPEC 1](https://scientific-python.org/specs/spec-0001/) lazy-loading to top-level modules and the analysis module. Users can now directly access submodules after importing the top-level module only:

```
import erlab

erlab.analysis.transform.rotate(...)
```
Adds an option to normalize 1D data with its mean to the right-click menu of 1D plots.
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 85.67839% with 57 lines in your changes missing coverage. Please review.

Project coverage is 82.82%. Comparing base (5a68584) to head (8048b36).
Report is 29 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/erlab/interactive/imagetool/manager.py 88.72% 15 Missing ⚠️
src/erlab/interactive/imagetool/dialogs.py 74.35% 10 Missing ⚠️
src/erlab/analysis/kspace.py 58.82% 7 Missing ⚠️
src/erlab/accessors/kspace.py 53.84% 6 Missing ⚠️
src/erlab/interactive/imagetool/core.py 80.64% 6 Missing ⚠️
src/erlab/io/dataloader.py 60.00% 4 Missing ⚠️
src/erlab/interactive/utils.py 75.00% 3 Missing ⚠️
src/erlab/accessors/general.py 80.00% 1 Missing ⚠️
src/erlab/interactive/colors.py 75.00% 1 Missing ⚠️
src/erlab/interactive/imagetool/__init__.py 75.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   82.78%   82.82%   +0.03%     
==========================================
  Files          66       67       +1     
  Lines       12581    12701     +120     
==========================================
+ Hits        10415    10519     +104     
- Misses       2166     2182      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…directly and deprecate `erlab.plotting.erplot`

The import convention `import erlab.plotting.erplot as eplt` is now deprecated. Users should replace them with `import erlab.plotting as eplt`.
Fixes completely wrong implementation of kz-dependent momentum conversion. I can't believe this went unnoticed!
When given multi-file data with multiple coordinates, the previous behavior was to include every coordinate as a dimension. This is logical for scans such as 4D position-dependent scans, but unnecessary for data like hv and angle dependent scans. Now, the loader will concatenate only along one axis if all motor coordinates are strictly monotonic.
@kmnhan kmnhan marked this pull request as ready for review December 14, 2024 06:29
@kmnhan kmnhan merged commit e7c8ea8 into main Dec 14, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant