Skip to content

Refactor SLD and molecular weight dependency in app structure - #343

Open
rozyczko wants to merge 9 commits into
developfrom
sld_coupled
Open

Refactor SLD and molecular weight dependency in app structure#343
rozyczko wants to merge 9 commits into
developfrom
sld_coupled

Conversation

@rozyczko

@rozyczko rozyczko commented Sep 3, 2026

Copy link
Copy Markdown
Member

This pull request introduces support for "density materials" (materials where SLD/ISLD are derived from density and formula, but can be decoupled to fit SLD/ISLD directly).

Backend logic for density materials:

  • Added helper functions _is_density_material and _sld_is_writable to distinguish density materials and control SLD/ISLD writability.
  • Extended the Material class with methods to set sld_coupled, formula, and density for density materials, with appropriate guards and error handling.

Parameter and serialization handling:

  • Updated parameter list construction to mark density-material knobs as "inactive" (greyed out, not fitted) when decoupled, and added notes for their state.
  • Enhanced the material serialization to include kind, formula, density, and coupling state for each material.

API and QML interface updates:

  • Added new slots and QML wrapper functions to set sld_coupled, formula, and density for materials from the UI, and to emit appropriate signals for UI updates and constraint invalidation.

UI improvements:

  • Improved error formatting in the analysis sidebar to display 'n/a' for missing error bars, distinguishing this from numeric zero.

@rozyczko rozyczko added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] high Should be prioritized soon labels Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] high Should be prioritized soon [scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant