Skip to content

Conversation

@NMiklave
Copy link
Collaborator

@NMiklave NMiklave commented Jun 13, 2025

Describe your changes
Calls to read_image by functions in the visualize and transform subpackages create circular imports, because read_image imports the hyperspectral subpackage. This PR resolves some circular imports by:

  • Creating the helper function _read_hyper in readimage, taking over functionality from hyperspectral.read_data.
  • Relocating helper functions in hyperspectral.read_data (that are only called by read_data) into the readimage module.
  • Redirects hyperspectral.read_data to wrap _read_hyper, to preserve existing workflows.
  • Relocating shared helper functions _find_closest and _make_pseudo_rgb from hyperspectral.read_data to the _helpers module.
  • Creating a helper for transform.rescale in _helpers.

Type of update
Code cleanup

For the reviewer
See this page for instructions on how to review the pull request.

  • PR functionality reviewed in a Jupyter Notebook
  • All tests pass
  • Test coverage remains 100%
  • Documentation tested
  • New documentation pages added to plantcv/mkdocs.yml
  • Changes to function input/output signatures added to updating.md
  • Code reviewed
  • PR approved

@NMiklave NMiklave added the cleanup Code quality updates label Jun 13, 2025
@deepsource-io
Copy link

deepsource-io bot commented Jun 13, 2025

Here's the code health analysis summary for commits 6e23e95..c5af390. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 11 occurences introduced
View Check ↗
DeepSource Test coverage LogoTest coverage✅ SuccessView Check ↗

Code Coverage Report

MetricAggregatePython
Branch Coverage100%100%
Composite Coverage100%100%
Line Coverage100%100%
New Branch Coverage100%100%
New Composite Coverage100%100%
New Line Coverage100%, ✅ Above Threshold100%, ✅ Above Threshold

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@NMiklave NMiklave added the work in progress Mark work in progress label Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code quality updates work in progress Mark work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants