Commit graph

94 commits

Author SHA1 Message Date
Fabian Joswig
8c7cd5a74b
Merge branch 'develop' into feat/meas_class 2025-01-06 11:13:55 +01:00
Fabian Joswig
3eac9214b4
[Fix] Ruff rules and more precise Excpetion types (#248)
* [Fix] Fix test for membership should be 'not in' (E713)

* [Fix] Fix module imported but unused (F401)

* [Fix] More precise Exception types in dirac, obs and correlator
2024-12-24 15:35:59 +01:00
Fabian Joswig
30bfb55981
[Feat] Provide derivatives for pow (#246)
* [Feat] Provide manual derivatives for __pow__

* [Feat] Also applied changes to rpow

* [Test] Another pow test added.
2024-11-26 17:52:27 +01:00
Fabian Joswig
779dedf5b3 [Tests] Added test to compare cov_Obs and Meas implementation. 2024-11-17 12:24:38 +01:00
Fabian Joswig
f2a98bb5bd [Feat] Meas class for gaussian error propagation. 2024-11-17 12:18:49 +01:00
s-kuberski
4b1bb0872a
fix: corrected bug that prevented combined fits with multiple x-obs in some cases (#241)
* fix: corrected bug that prevented combined fits with multiple x-obs in some cases

* made test more complex

* [Fix] Slightly increase tolerance for matrix function test.

* Adapt test_merge_idx to compare lists

---------

Co-authored-by: Simon Kuberski <simon.kuberski@cern.ch>
Co-authored-by: Fabian Joswig <fjosw@users.noreply.github.com>
2024-09-13 19:15:59 +02:00
Pia Leonie Jones Petrak
1d6f7f65c0
Feature/corr matrix and inverse cov matrix as input in least squares function for correlated fits (#223)
* feat: corr_matrix kwargs as input for least squares fit

* feat/tests: inverse covariance matrix and correlation matrix kwargs as input for least squares function

* feat/tests/example: reduced new kwargs to 'inv_chol_cov_matrix' and outsourced the inversion & cholesky decomposition of the covariance matrix (function 'invert_corr_cov_cholesky(corr, covdiag)')

* tests: added tests for inv_chol_cov_matrix kwarg for the case of combined fits

* fix: renamed covdiag to inverrdiag needed for the cholesky decomposition and corrected its documentation

* examples: added an example of a correlated combined fit to the least_squares documentation

* feat/tests/fix(of typos): added function 'sort_corr()' (and a test of it) to sort correlation matrix according to a list of alphabetically sorted keys

* docs: added more elaborate documentation/example of sort_corr(), fixed typos in documentation of invert_corr_cov_cholesky()
2024-09-13 08:35:10 +02:00
s-kuberski
db612597d2
[fix] Handle missing replia (#232)
* [fix] First version of a fix to cope with missing replica.

* [fix] added test for missing replica

* [fix] refactored fix for missing replica, modified tests

* [fix] refinement of tests
2024-04-25 20:45:53 +02:00
Fabian Joswig
43bd99b6c7
[fix] Numpy 2 breaking changes in tests (#234) 2024-04-17 14:53:34 +02:00
s-kuberski
d689959b1f
fix: Check if configs appears multiple times when creating an obs (#216) 2023-11-10 19:13:11 +01:00
Fabian Joswig
7f8c2ce33b
feat: added support for addition and multiplication of complex numbers (#209)
to Corr objects.
2023-07-21 14:15:41 +01:00
Fabian Joswig
af28f77ec5
__eq__ method for Corr class (#206)
* feat: implemented __eq__ method for Corr class.

* feat: __eq__ method now respects None entries in correlators.

* feat: Obs can now be compared to None, __ne__ method removed as it is
not required.

* feat: Corr.__eq__ rewritten to give a per element comparison.

* tests: additional test case for correlator comparison added.

* feat: comparison now also works for padding.
2023-07-19 15:06:19 +01:00
Fabian Joswig
1e438356fd
Vectorized gamma_method (#207)
* feat: vectorized gamma_method function added.

* feat: vectorized gamma method generalized to also work on other objects
like Corr or Fit_result.

* feat: alias gamma_method for vectorized gamma_method added.

* docs: example 5 updated to include vectorized gamma_method.

* docs: output of example 5 updated.
2023-07-19 12:13:20 +01:00
Fabian Joswig
8736d1cd3c
feat: CObs format added and complex Corr print improved. (#200) 2023-07-14 13:38:21 +01:00
Fabian Joswig
b62a18643e
Bootstrap export/import (#198)
* feat: export_bootstrap method added.

* feat: import_bootstrap function added.

* tests: first test for import/export bootstrap added.

* feat: bootstrap feature cleaned up.

* docs: boostrap docstrings improved.
2023-07-14 13:12:11 +01:00
Fabian Joswig
525c61ed20
Fix another edge case in _compute_drho (#194)
* tests: failing test for compute_drho edge case added.

* tests: example file for failing compute_drho added.

* tests: assertion that dvalue stays the same added to compute drho test.

* fix: another edge case in computation of drho fixed.
2023-06-02 15:04:15 +01:00
Fabian Joswig
bb43a8afb7
Fix Obs in f-strings without specifier (#190)
* fix: Conversion of an array with ndim > 0 to a scalar deprecation fixed.

* fix: adjusted maximal value for rho in test_gamma_method_irregular.

* fix: obs in f-strings now work again when no specifier is provided.
2023-05-31 18:07:38 +01:00
s-kuberski
34fe7f44fc
Bug fix for edge case in _compute_drho (#189) 2023-05-30 15:29:22 +01:00
Fabian Joswig
095f7c8a46
fix: adjusted maximal value for rho in test_gamma_method_irregular. (#188) 2023-05-30 14:03:01 +01:00
Fabian Joswig
dc73456759
tests: np.alltrue replaced by np.all. 2023-05-30 12:52:10 +01:00
s-kuberski
15d07de87f
fix: String conversion of Obs can now handle a dvalue that is NaN or inf (#173) 2023-05-03 16:30:59 +02:00
s-kuberski
65a9128a7d
Fix/merge idx (#172)
* Fix: Corrected merging of idls

* Fix: Computation of drho in cases where tau_int is large compared to the chain length

* Removed unnecessary imports

* Refactor list comparisons in obs.py
2023-04-28 18:14:51 +01:00
Fabian Joswig
be061fdc23
Feat/str format (#170)
* feat: _format_uncertainty now accepts a significance.

* feat: __format__ now accepts significance.

* feat: explicit + sign added to format.

* fix: - option removed from format specifier.

* feat: space format added.
2023-04-20 17:31:37 +01:00
s-kuberski
a214465413
Fix/gaps (#169)
* fix: Fixed range detection in gamma_method

* Corrected test in dobsio

* Changed expansion paradigm in gamma_method

* Extended tests

* Updated docstrings

* Removed unnecessary intermediate variable

* Removed unnecessary code

* Fixed previously introduced bug in output in obs.details()

* Fixed previously introduced bug in window determination

* New criterion for matching gapped replica, fixed determination of w_max and fixed tau_exp analysis with gaps

* tests: split up consistency test for gamma method.

---------

Co-authored-by: Fabian Joswig <fabian.joswig@ed.ac.uk>
2023-04-20 17:30:57 +01:00
Fabian Joswig
839d9214ed
Improved prior fit (#161)
* refactor: merged combined fit and prior fit without breaking the
routine. Fitting with priors does not work yet.

* refactor: correlated fits without priors work now.

* refactor: prior error propagation and dof fixed.

* refactor: old prior fit implementation moved to tests.

* refactor: moved _extract_val_and_dval out of least_squares.

* refactor: comment removed.

* tests: additional tests and exceptions added.

* tests: test for constrained prior fit added.

* docs: least_squares docstring extended.

* fix: linting errors fixed.

* feat: additional if cause for fits without priors added to achieve
original speed.

* tests: test_constrained_and_prior_fit fixed.

* fix: fix array cast of least_squares dict mode.

* tests: test for lists in dict fit added.

* fix: additional asarray added in resplot.

Co-authored-by: Simon Kuberski <simon.kuberski@uni-muenster.de>
2023-03-07 16:15:16 +00:00
Fabian Joswig
9ef7e504a0
chore: Exceptions in Obs.__init__ made more explicit. 2023-03-02 18:54:08 +00:00
Fabian Joswig
d81d6ea0b8
fix: loop range in standard windowing procedure adjusted by gapsize
- Test added

Co-authored-by: Simon Kuberski <simon.kuberski@uni-muenster.de>
2023-02-27 21:43:29 +00:00
Fabian Joswig
8bc204fc31
tests: nan obs test added. 2023-02-26 18:56:46 +00:00
Fabian Joswig
ae68e5baad
test: small bug in non overlapping test fixed. 2023-02-02 16:06:35 +00:00
Fabian Joswig
925f212e61
test: test for non overlapping configs fixed. 2023-02-02 15:22:35 +00:00
Fabian Joswig
37c59a198e
test: test for values added to non overlapping tests. 2023-02-02 15:08:22 +00:00
Fabian Joswig
e34d49d88d
test: additional test for non overlapping configurations added. 2023-02-02 14:19:16 +00:00
Fabian Joswig
79d185aa7d
test: non_overlapping tests refined. 2023-02-02 13:57:58 +00:00
Fabian Joswig
f6df9d02f5
test: added additional tests for non-overlapping configurations. 2023-02-02 13:49:40 +00:00
Fabian Joswig
b3d030abf3
fix: fixed test_correlation_intersection_of_idls 2023-02-02 13:42:15 +00:00
Fabian Joswig
2e490e56f4
fix: fixed test intersection reduce. 2023-02-02 13:35:08 +00:00
Fabian Joswig
5adc3e0c76
test: sin2 cos2 test for error propagation added. 2023-01-24 10:10:52 +00:00
Fabian Joswig
7682e29146
test: tests refactored. 2023-01-20 11:54:43 +00:00
Fabian Joswig
9ba09e6b8f
tests: gamma_method added to fuzzy test. 2023-01-20 11:49:44 +00:00
Fabian Joswig
7bb164120b
tests: fuzzy test for Obs added, test dependencies and documentation
updated.
2023-01-20 11:44:31 +00:00
Fabian Joswig
1297415710
test: test for alias gm added. 2023-01-05 11:56:48 +01:00
Fabian Joswig
a8a9bfbd43
tests: test added that checks that Obs.details does not throw an error
when the error of tau is zero.
2022-10-21 12:12:27 +01:00
Simon Kuberski
d5a766ee16 feat: Speed up covariance for irregular MC chains 2022-10-21 11:05:54 +02:00
Fabian Joswig
e3f7baa667
tests: test for gapped irregular dtauint added. 2022-10-19 12:04:49 +01:00
Simon Kuberski
89b0c37e76 fix: corrected bias correction of tau_int for irregular chains 2022-10-17 17:40:27 +02:00
Simon Kuberski
fd4c866fdd fix: bug in automatic window for irregular chains fixed 2022-10-17 14:38:23 +02:00
Fabian Joswig
b2d5263ea3 feat: hash method for Obs objects added. 2022-07-01 16:53:08 +01:00
Fabian Joswig
d922b72f3b feat: Obs.reweight method added. 2022-06-23 13:50:24 +01:00
Fabian Joswig
612e6c742b tests: matplotlib figures explicitly closed in tests 2022-06-14 14:46:45 +01:00
Fabian Joswig
5e550f4321 tests: test for smooth_eigenvalues functionality added. 2022-06-10 09:29:04 +01:00