Skip to content

Move to EasyList#360

Open
rozyczko wants to merge 2 commits into
developfrom
move_to_easylist
Open

Move to EasyList#360
rozyczko wants to merge 2 commits into
developfrom
move_to_easylist

Conversation

@rozyczko
Copy link
Copy Markdown
Member

This pull request migrates the sample and model classes away from the deprecated easyscience.ObjBase and easyscience.CollectionBase pipeline, updating them to use the new ModelBase and EasyList foundations. This change modernizes the core architecture, improves consistency in parameter handling, and introduces a breaking change to the serialized project file format. Backward compatibility with older project files is intentionally dropped, and the code now enforces schema versioning. The pull request also updates property access patterns throughout the codebase and clarifies several internal APIs.

Migration to new base classes and API improvements:

  • All major sample and model classes (Model, Material, Layer, Sample, ModelCollection, etc.) are rewritten to inherit from ModelBase and EasyList instead of the deprecated bases. This includes a refactor of Model to use BaseCore and ModelCollection to use the new collection pattern.
  • Properties that return a Parameter (such as Material.sld, MaterialMixture.fraction, and LayerAreaPerMolecule.area_per_molecule) now consistently expose the Parameter object. The tutorials and code are updated to access the value via .value.
  • The legacy BaseCollection.remove(index) method is renamed to remove_at(index) to avoid confusion with the standard remove(value).

Serialization and backward compatibility:

  • Project files now include a file_format version (bumped to 2). Attempting to load older project files raises a clear error, as the new model structure is not backward compatible.
  • The serialization logic for models and collections is updated to handle new fields and ensure correct round-tripping of all parameters, including color indices and interface/resolution function metadata.

Internal API and property refactoring:

  • The Model class now uses explicit property getters and setters for sample, scale, and background to ensure serialization round-trips and encapsulation.
  • The ModelCollection class manages color indices more robustly and exposes next_color_index as a property for serialization.
  • The method get_parameters() is now considered legacy; new code should use get_all_parameters().

Documentation and tutorial updates:

  • The bilayer simulation tutorial is updated to reflect the new .value access pattern for parameter properties.

Cleanup and minor changes:

  • Removes unused imports and legacy code fragments.
  • Updates Python version metadata in the tutorial notebook.

@rozyczko rozyczko added chore Chore changes to the code [scope] significant Breaking or major changes (MAJOR.minor.patch) [priority] high Should be prioritized soon labels May 24, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

❌ Patch coverage is 0% with 539 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (c95d2e0) to head (a1eb36a).

Files with missing lines Patch % Lines
...eflectometry/sample/collections/base_collection.py 0.00% 133 Missing ⚠️
src/easyreflectometry/sample/base_core.py 0.00% 93 Missing ⚠️
.../sample/elements/layers/layer_area_per_molecule.py 0.00% 45 Missing ⚠️
...etry/sample/elements/materials/material_mixture.py 0.00% 45 Missing ⚠️
src/easyreflectometry/model/model.py 0.00% 38 Missing ⚠️
...etry/sample/elements/materials/material_density.py 0.00% 36 Missing ⚠️
.../easyreflectometry/sample/elements/layers/layer.py 0.00% 25 Missing ⚠️
...yreflectometry/sample/assemblies/gradient_layer.py 0.00% 21 Missing ⚠️
...try/sample/elements/materials/material_solvated.py 0.00% 19 Missing ⚠️
...eflectometry/sample/elements/materials/material.py 0.00% 17 Missing ⚠️
... and 11 more
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #360    +/-   ##
========================================
  Coverage     0.00%   0.00%            
========================================
  Files           40      40            
  Lines         2758    3051   +293     
========================================
- Misses        2758    3051   +293     
Flag Coverage Δ
integration 0.00% <0.00%> (ø)
unittests 0.00% <0.00%> (ø)

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

Files with missing lines Coverage Δ
.../easyreflectometry/sample/assemblies/multilayer.py 0.00% <0.00%> (ø)
...flectometry/sample/collections/layer_collection.py 0.00% <0.00%> (ø)
...ctometry/sample/collections/material_collection.py 0.00% <0.00%> (ø)
src/easyreflectometry/summary/summary.py 0.00% <0.00%> (ø)
src/easyreflectometry/sample/assemblies/bilayer.py 0.00% <0.00%> (ø)
src/easyreflectometry/sample/collections/sample.py 0.00% <0.00%> (ø)
src/easyreflectometry/project.py 0.00% <0.00%> (ø)
...eflectometry/sample/assemblies/surfactant_layer.py 0.00% <0.00%> (ø)
...ctometry/sample/assemblies/repeating_multilayer.py 0.00% <0.00%> (ø)
...syreflectometry/sample/assemblies/base_assembly.py 0.00% <0.00%> (ø)
... and 11 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore changes to the code [priority] high Should be prioritized soon [scope] significant Breaking or major changes (MAJOR.minor.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant