Skip to content

fixes from code review - #334

Merged
rozyczko merged 1 commit into
developfrom
bayesian_fixes
Aug 3, 2026
Merged

fixes from code review#334
rozyczko merged 1 commit into
developfrom
bayesian_fixes

Conversation

@rozyczko

@rozyczko rozyczko commented Aug 3, 2026

Copy link
Copy Markdown
Member

The key changes ensure that Bayesian results are properly cleared when they become stale, the UI remains locked until background fitting threads actually exit, and late signals from superseded worker threads are safely ignored. Additional fixes address data handling for Bayesian sampling and parameter naming. Unused dependencies are also removed.

Bayesian Results Management

  • Bayesian results are now cleared whenever they become stale: on project create/load/reset, when a classical fit or a new sampling run starts, ensuring the UI never displays results from a superseded run or a different project.
  • Added a _clear_bayesian_results method and public clearBayesianResults slot, which is triggered by project state changes and fit/sampling starts. This method clears stored results, overlays, and emits appropriate signals.

Fit Lifecycle and Thread Safety

  • Cancelling a fit now keeps the UI locked until the worker thread actually exits, preventing concurrent fits and ensuring that state is only finalized when safe.
  • Introduced _is_stale_worker_signal to ignore late signals from superseded worker threads, preventing them from mutating state after a new fit has started.

Bayesian Sampling Robustness

  • Bayesian sampling now handles data files without uncertainty/resolution columns: missing ye falls back to zero variances with a clear message, and unused xe is no longer attached to the Q coordinate.

Parameter Naming and Tree Traversal

  • Fixed parameter group/display names for the first and last layers of each assembly by preferring the canonical layers container in the parameter-tree walker, avoiding mislabelling due to alias properties.

Dependency Cleanup

  • Removed the unused corner dependency from the project.

@rozyczko rozyczko added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] high Should be prioritized soon labels Aug 3, 2026
@rozyczko
rozyczko merged commit c1e1bc7 into develop Aug 3, 2026
16 checks passed
@rozyczko
rozyczko deleted the bayesian_fixes branch August 3, 2026 09:32
rozyczko added a commit that referenced this pull request Aug 3, 2026
* summary prettified (#308)

* summary prettified

* minor fixes after code review

* make links clickable (#310)

* Bayesian analysis (#309)

* initial version.

* updates to the parameter passing

* nice Bayesian sub-tabs display

* add parameter names, add cancellation of sampling, add number of steps
in status bar

* correct parenting

* added required dependencies and modified Fit Status dialog

* add save button to the plots

* added tests for bayesian logic

* attempt at getting posterior median and credibility intervals on the
main chart

* enable/disable legends on bayesian sampling

* reload bumps images on recalculation. Use different caption when running
sampling

* updates and changes, new unit tests and GUI elements. New colors

* fixed typo

* actually sample multiple experiments

* nicer plots

* trace plot - nice display

* updated plots

* changes for the new EasyList based reflectometry-lib

* changes after updates to core

* unit test fixed

* weird conflict

* Bayesian fixes (#332)

* removed MD file, fixed #312

* fixed #313

* Fixed issues #312 - #322
Temporarily commented out code signing

* Addressed issues #323, #324, #325, #326

* addressed #327, #328, #329

* update paths in the Summary textboxes

* minor updates based on the new ERL

* summary results now show correct GoF #375

* reparent to released lib

* fixes from code review (#334)

* updated versioning (#335)
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