Skip to content

Add save and load functions for exporting the FitResult, UQResult to file.#508

Draft
HKaras wants to merge 39 commits intomainfrom
jsonify
Draft

Add save and load functions for exporting the FitResult, UQResult to file.#508
HKaras wants to merge 39 commits intomainfrom
jsonify

Conversation

@HKaras
Copy link
Copy Markdown
Member

@HKaras HKaras commented Apr 13, 2026

To allow for better archiving and sharing of FitResults save and load functions have been implemented.
Pickling which was the only option before is both insecure and not-stable.

This pull request closes #414

HKaras and others added 30 commits December 5, 2022 15:36
* Increase version number and update changelog (#455)

* Bugfixes 4th sep (#460)

* Fix normalisation in rice model

Closes #459

* Remove three spin anaysis

Closes #427

* Improved installation instructions

* Caution about difference in definition of cost function

Closes #450

* Bump Version

* Bug for non linearly constrained problems

When a problem is not linearly constrained and not non-negative, the linear solver outputs a result class not the solution.

* Keeping changelog up-to date

* Fixing Sophgrid bug (#464)

* Fixing Sophgrid bug

* Add unit test for sophgrid

* Update changelog.rst for new release (#466)
* Fixing Sophgrid bug

* Add unit test for sophgrid

* Minor doc update

* Bump version Number

* Remove unnecessary doc files

* Update changelog
* Seperate Kinterpolator into its own function

Interpolation in Scipy is very slow, currently the same interpolation is being rerun for every calculation of the dipolarkernal. This is now cached to speed it up.

* Only run orientation selection on grid and integral based kernals

This hunk of code is not needed when fresnel integrals are used so does not need to be evaluated

* Update changelog
* Update for 3.12

* Updated workflows and changelog

* Upload to 3.12
* Update for 3.12

* Updated workflows and changelog

* Upload to 3.12

* Numpy 2.0 compatibility updates

* Update Changelog
* Update for 3.12

* Updated workflows and changelog

* Upload to 3.12

* Fix bug in regparam grid search

Regparam would never build the grid correctly. Now using grid or Brent is automatically determined from number of elements in the regparamrange.

* Add extra error messages

* Update changelog

* Updated Example

* Updated test

The test has been updated. The previous convergence criteria was unreliable and only worked based on a coincidence.

* Prepare For Release

* Remove duplicate python version
* Remove 3.8 Require Numpy 2.0

Co-authored-by: Stefan Stoll <stestoll@users.noreply.github.com>
* Added modelUncert for bootstrapped

* Remove unused input

* Always create modelUncert quantification

* Allow bootstrap resampling to be variable in propagation

* Update examples

* Add test for modelUncert output

* Minor docstring update

* Bootrstap Uncertainty sampling reduction

Reduces uncertainty calculation for bootstrapped uncertainties. Previously it was always 1000 samples. This saves around 4s, when using <100 samples.

* Add model copying

* General improvemements

* Fixes issues with functions being deep copyied

* Test update

-`test_fit_model_confidence_intervals` increased the number of bootstraps so it passes
-`test_fit_modelUncert` expanded to test the bootstrapped

* Correct number of bootstrap samples

* Fix gaussian normalisation issues

* Bug fix in test

* multi-guass_background fix removal

* Fix example for latest matplotlib
- Fixes nOctants =0 and -1
- Adds some tests
* Increase version number and update changelog (#455)

* Bugfixes 4th sep (#460)

* Fix normalisation in rice model

Closes #459

* Remove three spin anaysis

Closes #427

* Improved installation instructions

* Caution about difference in definition of cost function

Closes #450

* Bump Version

* Bug for non linearly constrained problems

When a problem is not linearly constrained and not non-negative, the linear solver outputs a result class not the solution.

* Keeping changelog up-to date

* Fixing Sophgrid bug (#464)

* Fixing Sophgrid bug

* Add unit test for sophgrid

* Update changelog.rst for new release (#466)
* Fixing Sophgrid bug

* Add unit test for sophgrid

* Minor doc update

* Bump version Number

* Remove unnecessary doc files

* Update changelog
* Seperate Kinterpolator into its own function

Interpolation in Scipy is very slow, currently the same interpolation is being rerun for every calculation of the dipolarkernal. This is now cached to speed it up.

* Only run orientation selection on grid and integral based kernals

This hunk of code is not needed when fresnel integrals are used so does not need to be evaluated

* Update changelog
* Update for 3.12

* Updated workflows and changelog

* Upload to 3.12
* Update for 3.12

* Updated workflows and changelog

* Upload to 3.12

* Numpy 2.0 compatibility updates

* Update Changelog
* Update for 3.12

* Updated workflows and changelog

* Upload to 3.12

* Fix bug in regparam grid search

Regparam would never build the grid correctly. Now using grid or Brent is automatically determined from number of elements in the regparamrange.

* Add extra error messages

* Update changelog

* Updated Example

* Updated test

The test has been updated. The previous convergence criteria was unreliable and only worked based on a coincidence.

* Prepare For Release

* Remove duplicate python version
- Changed `UQresult`, when used for profile analysis, so that threshold can be supplied with parameters not with a function.

- Changed the creation of `UQresult` in `profile_analysis.py` so that it supplies arguments not functions.
HKaras added 3 commits March 26, 2026 12:38
Including:
- Function for dumping and reading from JSON strings. `dump_jsons` and `load_jsons`
- Support for saving to HDF5, JSON, TOML
- Example for saving and loading files
@HKaras HKaras added this to the v1.2 milestone Apr 13, 2026
@HKaras HKaras self-assigned this Apr 13, 2026
@HKaras HKaras added docs Improvements or additions to documentation enhancement New feature or request labels Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend the export options for FitResult

1 participant