Merge pull request #137 from fjosw/feat/gamma_method_alias

Alias gm for gamma_method
This commit is contained in:
Fabian Joswig 2023-01-05 12:03:41 +01:00 committed by GitHub
commit 64034747c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 2 deletions

View file

@ -2,6 +2,17 @@
All notable changes to this project will be documented in this file.
## [2.5.0] - 2023-xx-xx
### Added
- Hotelling t-squared p-value added for correlated fits.
- String conversion of numpy arrays containing `Obs` improved.
- Alias `gm` for `Obs.gamma_method` added.
- Input routine for xSF measurement program added.
### Fixed
- Complex valued `Corr` objects fixed.
- Small bug in `qtop_projection` fixed.
## [2.4.0] - 2022-12-01
### Added
- Log-derivatives and symmetric log-effective mass added.
@ -13,8 +24,6 @@ All notable changes to this project will be documented in this file.
- Bug in `input.json` export in connection with `numpy.int64` fixed.
- Small bug fixes in `input.openQCD`.
## [2.3.1] - 2022-10-19
### Fixed
- Integrated autocorrelation times are now correctly estimated for gapped irregular Monte Carlo chains.

View file

@ -349,6 +349,8 @@ class Obs:
self.ddvalue = np.sqrt(self.ddvalue) / self._dvalue
return
gm = gamma_method
def _calc_gamma(self, deltas, idx, shape, w_max, fft):
"""Calculate Gamma_{AA} from the deltas, which are defined on idx.
idx is assumed to be a contiguous range (possibly with a stepsize != 1)

View file

@ -1015,3 +1015,15 @@ def test_hash():
assert hash(i_obs) != hash((1 + 1e-7) * i_obs)
assert hash(obs) != hash(o1)
assert hash(o1) != hash(o2)
def test_gm_alias():
samples = np.random.rand(500)
tt1 = pe.Obs([samples], ["ens"])
tt1.gamma_method()
tt2 = pe.Obs([samples], ["ens"])
tt2.gm()
assert np.isclose(tt1.dvalue, tt2.dvalue)