Skip to content

Multifitter implementation - #164

Merged
wardsimon merged 17 commits into
io_serializationfrom
numpy_multifitter
Nov 18, 2022
Merged

wardsimon merged 17 commits into
io_serializationfrom
numpy_multifitter

Conversation

@wardsimon

Copy link
Copy Markdown
Contributor

This is a basic multi-fitter implementation based on the work of @arm61 and the 'xarray' dataset multi-fitting interface.

This pull request allows for the optimisation of ND datasets AND multiple ND datasets. The api remains unchanged (though it should be tested on downstream implementations). The only difference is that when using the MultiFitter class, an array of FitResults are returned.

dependabot Bot and others added 7 commits November 9, 2022 13:17
Updates the requirements on [readme-renderer](https://github.com/pypa/readme_renderer) to permit the latest version.
- [Release notes](https://github.com/pypa/readme_renderer/releases)
- [Changelog](https://github.com/pypa/readme_renderer/blob/main/CHANGES.rst)
- [Commits](pypa/readme_renderer@35.0...37.3)

---
updated-dependencies:
- dependency-name: readme-renderer
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [pytest-cov](https://github.com/pytest-dev/pytest-cov) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest-cov@v3.0.0...v4.0.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [sphinx-gallery](https://github.com/sphinx-gallery/sphinx-gallery) to permit the latest version.
- [Release notes](https://github.com/sphinx-gallery/sphinx-gallery/releases)
- [Changelog](https://github.com/sphinx-gallery/sphinx-gallery/blob/master/CHANGES.rst)
- [Commits](sphinx-gallery/sphinx-gallery@v0.10.0...v0.11.1)

---
updated-dependencies:
- dependency-name: sphinx-gallery
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pytz](https://github.com/stub42/pytz) from 2022.1 to 2022.6.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](stub42/pytz@release_2022.1...release_2022.6)

---
updated-dependencies:
- dependency-name: pytz
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pandas](https://github.com/pandas-dev/pandas) from 1.4.2 to 1.5.1.
- [Release notes](https://github.com/pandas-dev/pandas/releases)
- [Changelog](https://github.com/pandas-dev/pandas/blob/main/RELEASE.md)
- [Commits](pandas-dev/pandas@v1.4.2...v1.5.1)

---
updated-dependencies:
- dependency-name: pandas
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](sphinx-doc/sphinx@v4.0.2...v5.3.0)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@wardsimon
wardsimon requested a review from arm61 November 15, 2022 11:46
@wardsimon wardsimon self-assigned this Nov 15, 2022
@codecov

codecov Bot commented Nov 15, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #164 (07284ae) into io_serialization (a8f8fdf) will decrease coverage by 2.33%.
The diff coverage is 86.90%.

❗ Current head 07284ae differs from pull request most recent head a362da5. Consider uploading reports for the commit a362da5 to get more accurate results

Impacted file tree graph

@@                 Coverage Diff                  @@
##           io_serialization     #164      +/-   ##
====================================================
- Coverage             78.65%   76.31%   -2.34%     
====================================================
  Files                    55       46       -9     
  Lines                  5265     4907     -358     
====================================================
- Hits                   4141     3745     -396     
- Misses                 1124     1162      +38     
Impacted Files Coverage Δ
tests/unit_tests/Fitting/test_fitting.py 85.95% <82.94%> (-5.21%) ⬇️
easyCore/Fitting/Constraints.py 66.66% <84.61%> (ø)
easyCore/Fitting/fitting_template.py 92.85% <88.23%> (+4.56%) ⬆️
easyCore/Fitting/Fitting.py 89.90% <91.72%> (+10.59%) ⬆️
easyCore/Fitting/bumps.py 90.43% <100.00%> (ø)
easyCore/Fitting/lmfit.py 89.00% <100.00%> (ø)
easyCore/Utils/UndoRedo.py 82.26% <0.00%> (-3.09%) ⬇️
easyCore/__init__.py 100.00% <0.00%> (ø)
easyCore/Objects/Borg.py 100.00% <0.00%> (ø)
... and 27 more

@wardsimon

wardsimon commented Nov 15, 2022 •

Copy link
Copy Markdown
Contributor Author

Notes on what needs to change:

  • - goodness of fit is currently set to reduced-chi2 not chi2 (that is the job of the reduced_chi2 field) (b60be50)
  • - computation of Chi2 needs to be reimplemented for multi-fit (5127424)
  • - Weights need to have reshaping applied. (5127424)

@arm61 arm61 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (the parts that I understand). Only comment would be that there are some empty docstring args, but I imagine you are getting to that.

Do you want me to test on EasyReflectometry (would be a job for tomorrow)?

Comment thread easyCore/Utils/typing.py Resolved
@wardsimon

Copy link
Copy Markdown
Contributor Author

With b60be50 docstrings and GOF is now up to date

@wardsimon

Copy link
Copy Markdown
Contributor Author

I think this can now be moved out of draft. This should also be tested with ED and ER before deployment.

@wardsimon
wardsimon requested a review from arm61 November 15, 2022 13:26
@wardsimon
wardsimon marked this pull request as ready for review November 15, 2022 13:26
@arm61

arm61 commented Nov 15, 2022

Copy link
Copy Markdown
Collaborator

I will test on EasyReflectometry tomorrow morning!

@wardsimon
wardsimon force-pushed the numpy_multifitter branch 2 times, most recently from d1b0e73 to 0615dd2 Compare November 16, 2022 14:18
@wardsimon
wardsimon changed the base branch from develop to io_serialization November 17, 2022 15:43
@wardsimon
wardsimon merged commit 4863eab into io_serialization Nov 18, 2022
@rozyczko
rozyczko deleted the numpy_multifitter branch March 12, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants