Skip to content

Residuals#300

Merged
rozyczko merged 19 commits intodevelopfrom
residuals
Mar 26, 2026
Merged

Residuals#300
rozyczko merged 19 commits intodevelopfrom
residuals

Conversation

@rozyczko
Copy link
Member

This pull request introduces significant improvements to the handling and visualization of residuals in the EasyReflectometryApp, along with several backend enhancements and bug fixes.

Residuals computation and plotting:

  • Added new properties and methods in plotting_1d.py to compute residual ranges (residualMinX, residualMaxX, residualMinY, residualMaxY) and provide normalized residual data points for plotting. These are now exposed to QML and updated when analysis data changes.
  • Updated the QML mock backend (Plotting.qml) to include stub properties and a function for residual ranges and data points, supporting frontend development and testing.
  • Exposed a new slot in the Python backend (py_backend.py) for retrieving residual data points from QML, enabling integration of the new residual chart.

Experiment loading and q-range synchronization:

  • Modified experiment loading methods in the backend (project.py, experiment.py) to return a boolean indicating if the q-range changed, and emit a new qRangeUpdated signal when necessary. This ensures the frontend stays in sync with backend data changes.
  • Implemented logic to update the model's q_max based on the largest q-value in loaded experiments, improving data consistency.

Fitting and parameter display improvements:

  • Refined the calculation of the number of fit parameters and reduced chi-squared in fitting logic, providing more accurate and meaningful statistics.
  • Improved parameter display logic to show assembly names for layer parameters, ensuring that renaming assemblies in the Model Editor is reflected in the analysis parameter table.

Other backend enhancements and fixes:

  • Changed calculator switching logic to use the public calculator property for better encapsulation.
  • Updated the models property in models.py to use a getter, improving maintainability.
  • Bumped copyright years in helpers.py.
  • Minor import fix in project.py.
  • Adjusted signal connections in py_backend.py to ensure parameters and experiments are refreshed correctly on model table changes, and to propagate q-range updates.

@rozyczko rozyczko added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] high Should be prioritized soon labels Mar 26, 2026
@rozyczko rozyczko merged commit 90945ca into develop Mar 26, 2026
16 checks passed
@rozyczko rozyczko deleted the residuals branch March 26, 2026 11:59
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