Skip to content

Standardize dirty flag#211

Merged
henrikjacobsenfys merged 11 commits into
developfrom
standardize-dirty-flag
Jun 22, 2026
Merged

Standardize dirty flag#211
henrikjacobsenfys merged 11 commits into
developfrom
standardize-dirty-flag

Conversation

@henrikjacobsenfys

@henrikjacobsenfys henrikjacobsenfys commented Jun 18, 2026

Copy link
Copy Markdown
Member

Standardizes how to deal with changes to e.g. Q, adding components etc., to always prefer flagging as dirty and rebuilding lazily.
Also a bunch of minor cleanups.

@henrikjacobsenfys henrikjacobsenfys added [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH) [priority] medium Normal/default priority labels Jun 18, 2026
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.50249% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@886a0c6). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/easydynamics/analysis/analysis1d.py 98.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #211   +/-   ##
==========================================
  Coverage           ?   97.99%           
==========================================
  Files              ?       52           
  Lines              ?     3639           
  Branches           ?      650           
==========================================
  Hits               ?     3566           
  Misses             ?       41           
  Partials           ?       32           
Flag Coverage Δ
unittests 97.99% <99.50%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/easydynamics/analysis/analysis.py 95.45% <100.00%> (ø)
src/easydynamics/analysis/analysis_base.py 100.00% <100.00%> (ø)
src/easydynamics/analysis/parameter_analysis.py 98.37% <ø> (ø)
src/easydynamics/base_classes/easydynamics_list.py 100.00% <ø> (ø)
...easydynamics/convolution/analytical_convolution.py 100.00% <ø> (ø)
src/easydynamics/convolution/convolution.py 100.00% <ø> (ø)
src/easydynamics/convolution/convolution_base.py 100.00% <ø> (ø)
.../easydynamics/convolution/numerical_convolution.py 100.00% <100.00%> (ø)
...dynamics/convolution/numerical_convolution_base.py 97.36% <100.00%> (ø)
.../easydynamics/sample_model/component_collection.py 99.13% <100.00%> (ø)
... and 7 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rozyczko rozyczko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor issue raised.
Also, consider removing .claude directory from pushed content
Every user/dev interested will recreate it with their own setup by running claude init

Comment on lines +205 to +209
if (
self.sample_model._component_collections_is_dirty # noqa: SLF001
or self.instrument_model.resolution_model._component_collections_is_dirty # noqa: SLF001
):
self._convolver_is_dirty = True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is querying two other objects' private dirty flags. It works, but aren't we trying to actually remove this behaviouir?
Consider exposing a public is_dirty/needs_rebuild on ModelBase, or having those mutations notify subscribers. At minimum, a comment explaining why this particular query is needed would help.

henrikjacobsenfys and others added 3 commits June 19, 2026 13:26
…check

- Add ModelBase.component_collections_is_dirty public property so
  Analysis1d.fit() no longer accesses private attributes on external objects
- Replace _prospective_Q_len pre-check in Analysis.rebin() with a
  post-rebin np.allclose comparison (same logic as ModelBase.Q setter),
  catching Q value changes even when count stays the same; rolls back
  _binned_data if confirm=True is not given
- Remove .claude/ from git tracking and add to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@henrikjacobsenfys henrikjacobsenfys merged commit 0a0bf47 into develop Jun 22, 2026
33 checks passed
@henrikjacobsenfys henrikjacobsenfys linked an issue Jun 22, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] medium Normal/default priority [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH)

Projects

None yet

2 participants