pyerrors 2.15.0__tar.gz → 2.16.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {pyerrors-2.15.0 → pyerrors-2.16.0}/PKG-INFO +4 -4
  2. {pyerrors-2.15.0 → pyerrors-2.16.0}/README.md +1 -1
  3. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/correlators.py +8 -6
  4. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/fits.py +1 -1
  5. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/sfcf.py +23 -14
  6. pyerrors-2.16.0/pyerrors/version.py +1 -0
  7. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors.egg-info/PKG-INFO +4 -4
  8. {pyerrors-2.15.0 → pyerrors-2.16.0}/setup.py +2 -2
  9. pyerrors-2.15.0/pyerrors/version.py +0 -1
  10. {pyerrors-2.15.0 → pyerrors-2.16.0}/LICENSE +0 -0
  11. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/__init__.py +0 -0
  12. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/covobs.py +0 -0
  13. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/dirac.py +0 -0
  14. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/__init__.py +0 -0
  15. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/bdio.py +0 -0
  16. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/dobs.py +0 -0
  17. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/hadrons.py +0 -0
  18. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/json.py +0 -0
  19. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/misc.py +0 -0
  20. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/openQCD.py +0 -0
  21. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/pandas.py +0 -0
  22. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/input/utils.py +0 -0
  23. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/integrate.py +0 -0
  24. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/linalg.py +0 -0
  25. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/misc.py +0 -0
  26. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/mpm.py +0 -0
  27. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/obs.py +0 -0
  28. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/roots.py +0 -0
  29. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors/special.py +0 -0
  30. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors.egg-info/SOURCES.txt +0 -0
  31. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors.egg-info/dependency_links.txt +0 -0
  32. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors.egg-info/requires.txt +0 -0
  33. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyerrors.egg-info/top_level.txt +0 -0
  34. {pyerrors-2.15.0 → pyerrors-2.16.0}/pyproject.toml +0 -0
  35. {pyerrors-2.15.0 → pyerrors-2.16.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyerrors
3
- Version: 2.15.0
3
+ Version: 2.16.0
4
4
  Summary: Error propagation and statistical analysis for Monte Carlo simulations
5
5
  Home-page: https://github.com/fjosw/pyerrors
6
6
  Author: Fabian Joswig
@@ -12,13 +12,13 @@ Project-URL: Changelog, https://github.com/fjosw/pyerrors/blob/master/CHANGELOG.
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Science/Research
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.9
16
15
  Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
20
  Classifier: Topic :: Scientific/Engineering :: Physics
21
- Requires-Python: >=3.9.0
21
+ Requires-Python: >=3.10.0
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: numpy>=2.0
@@ -52,7 +52,7 @@ Dynamic: requires-dist
52
52
  Dynamic: requires-python
53
53
  Dynamic: summary
54
54
 
55
- [![](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![arXiv](https://img.shields.io/badge/arXiv-2209.14371-b31b1b.svg)](https://arxiv.org/abs/2209.14371) [![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2023.108750-blue)](https://doi.org/10.1016/j.cpc.2023.108750)
55
+ [![](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![arXiv](https://img.shields.io/badge/arXiv-2209.14371-b31b1b.svg)](https://arxiv.org/abs/2209.14371) [![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2023.108750-blue)](https://doi.org/10.1016/j.cpc.2023.108750)
56
56
  # pyerrors
57
57
  `pyerrors` is a python framework for error computation and propagation of Markov chain Monte Carlo data from lattice field theory and statistical mechanics simulations.
58
58
 
@@ -1,4 +1,4 @@
1
- [![](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![arXiv](https://img.shields.io/badge/arXiv-2209.14371-b31b1b.svg)](https://arxiv.org/abs/2209.14371) [![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2023.108750-blue)](https://doi.org/10.1016/j.cpc.2023.108750)
1
+ [![](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![arXiv](https://img.shields.io/badge/arXiv-2209.14371-b31b1b.svg)](https://arxiv.org/abs/2209.14371) [![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2023.108750-blue)](https://doi.org/10.1016/j.cpc.2023.108750)
2
2
  # pyerrors
3
3
  `pyerrors` is a python framework for error computation and propagation of Markov chain Monte Carlo data from lattice field theory and statistical mechanics simulations.
4
4
 
@@ -1405,13 +1405,15 @@ class Corr:
1405
1405
  tmpmat = np.empty((Ntrunc, Ntrunc), dtype=object)
1406
1406
  rmat = []
1407
1407
  for t in range(basematrix.T):
1408
- for i in range(Ntrunc):
1409
- for j in range(Ntrunc):
1410
- tmpmat[i][j] = evecs[i].T @ self[t] @ evecs[j]
1411
- rmat.append(np.copy(tmpmat))
1408
+ if self.content[t] is None:
1409
+ rmat.append(None)
1410
+ else:
1411
+ for i in range(Ntrunc):
1412
+ for j in range(Ntrunc):
1413
+ tmpmat[i][j] = evecs[i].T @ self[t] @ evecs[j]
1414
+ rmat.append(np.copy(tmpmat))
1412
1415
 
1413
- newcontent = [None if (self.content[t] is None) else rmat[t] for t in range(self.T)]
1414
- return Corr(newcontent)
1416
+ return Corr(rmat)
1415
1417
 
1416
1418
 
1417
1419
  def _sort_vectors(vec_set_in, ts):
@@ -472,7 +472,7 @@ def least_squares(x, y, func, priors=None, silent=False, **kwargs):
472
472
  hat_vector = prepare_hat_matrix()
473
473
  A = W @ hat_vector
474
474
  P_phi = A @ np.linalg.pinv(A.T @ A) @ A.T
475
- expected_chisquare = np.trace((np.identity(y_all.shape[-1]) - P_phi) @ W @ cov @ W)
475
+ expected_chisquare = np.trace((np.identity(y_all.shape[-1]) - P_phi) @ W @ cov @ W) + len(loc_priors)
476
476
  output.chisquare_by_expected_chisquare = output.chisquare / expected_chisquare
477
477
  if not silent:
478
478
  print('chisquare/expected_chisquare:', output.chisquare_by_expected_chisquare)
@@ -10,7 +10,7 @@ import itertools
10
10
  sep = "/"
11
11
 
12
12
 
13
- def read_sfcf(path, prefix, name, quarks='.*', corr_type="bi", noffset=0, wf=0, wf2=0, version="1.0c", cfg_separator="n", silent=False, **kwargs):
13
+ def read_sfcf(path, prefix, name, quarks='.*', corr_type="bi", noffset=0, wf=0, wf2=0, version="1.0c", cfg_separator="n", cfg_func=None, silent=False, **kwargs):
14
14
  """Read sfcf files from given folder structure.
15
15
 
16
16
  Parameters
@@ -71,11 +71,11 @@ def read_sfcf(path, prefix, name, quarks='.*', corr_type="bi", noffset=0, wf=0,
71
71
  """
72
72
  ret = read_sfcf_multi(path, prefix, [name], quarks_list=[quarks], corr_type_list=[corr_type],
73
73
  noffset_list=[noffset], wf_list=[wf], wf2_list=[wf2], version=version,
74
- cfg_separator=cfg_separator, silent=silent, **kwargs)
74
+ cfg_separator=cfg_separator, cfg_func=cfg_func, silent=silent, **kwargs)
75
75
  return ret[name][quarks][str(noffset)][str(wf)][str(wf2)]
76
76
 
77
77
 
78
- def read_sfcf_multi(path, prefix, name_list, quarks_list=['.*'], corr_type_list=['bi'], noffset_list=[0], wf_list=[0], wf2_list=[0], version="1.0c", cfg_separator="n", silent=False, keyed_out=False, **kwargs):
78
+ def read_sfcf_multi(path, prefix, name_list, quarks_list=['.*'], corr_type_list=['bi'], noffset_list=[0], wf_list=[0], wf2_list=[0], version="1.0c", cfg_separator="n", cfg_func=None, silent=False, keyed_out=False, **kwargs):
79
79
  """Read sfcf files from given folder structure.
80
80
 
81
81
  Parameters
@@ -245,6 +245,16 @@ def read_sfcf_multi(path, prefix, name_list, quarks_list=['.*'], corr_type_list=
245
245
  for key in needed_keys:
246
246
  internal_ret_dict[key] = []
247
247
 
248
+ def _default_idl_func(cfg_string, cfg_sep):
249
+ return int(cfg_string.split(cfg_sep)[-1])
250
+
251
+ if cfg_func is None:
252
+ print("Default idl function in use.")
253
+ cfg_func = _default_idl_func
254
+ cfg_func_args = [cfg_separator]
255
+ else:
256
+ cfg_func_args = kwargs.get("cfg_func_args", [])
257
+
248
258
  if not appended:
249
259
  for i, item in enumerate(ls):
250
260
  rep_path = path + '/' + item
@@ -268,7 +278,7 @@ def read_sfcf_multi(path, prefix, name_list, quarks_list=['.*'], corr_type_list=
268
278
  for cfg in sub_ls:
269
279
  try:
270
280
  if compact:
271
- rep_idl.append(int(cfg.split(cfg_separator)[-1]))
281
+ rep_idl.append(cfg_func(cfg, *cfg_func_args))
272
282
  else:
273
283
  rep_idl.append(int(cfg[3:]))
274
284
  except Exception:
@@ -351,7 +361,7 @@ def read_sfcf_multi(path, prefix, name_list, quarks_list=['.*'], corr_type_list=
351
361
  for rep, file in enumerate(name_ls):
352
362
  rep_idl = []
353
363
  filename = path + '/' + file
354
- T, rep_idl, rep_data = _read_append_rep(filename, pattern, intern[name]['b2b'], cfg_separator, im, intern[name]['single'])
364
+ T, rep_idl, rep_data = _read_append_rep(filename, pattern, intern[name]['b2b'], im, intern[name]['single'], cfg_func, cfg_func_args)
355
365
  if rep == 0:
356
366
  intern[name]['T'] = T
357
367
  for t in range(intern[name]['T']):
@@ -581,12 +591,7 @@ def _read_compact_rep(path, rep, sub_ls, intern, needed_keys, im):
581
591
  return return_vals
582
592
 
583
593
 
584
- def _read_chunk(chunk, gauge_line, cfg_sep, start_read, T, corr_line, b2b, pattern, im, single):
585
- try:
586
- idl = int(chunk[gauge_line].split(cfg_sep)[-1])
587
- except Exception:
588
- raise Exception("Couldn't parse idl from directory, problem with chunk around line ", gauge_line)
589
-
594
+ def _read_chunk_data(chunk, start_read, T, corr_line, b2b, pattern, im, single):
590
595
  found_pat = ""
591
596
  data = []
592
597
  for li in chunk[corr_line + 1:corr_line + 6 + b2b]:
@@ -595,10 +600,10 @@ def _read_chunk(chunk, gauge_line, cfg_sep, start_read, T, corr_line, b2b, patte
595
600
  for t, line in enumerate(chunk[start_read:start_read + T]):
596
601
  floats = list(map(float, line.split()))
597
602
  data.append(floats[im + 1 - single])
598
- return idl, data
603
+ return data
599
604
 
600
605
 
601
- def _read_append_rep(filename, pattern, b2b, cfg_separator, im, single):
606
+ def _read_append_rep(filename, pattern, b2b, im, single, idl_func, cfg_func_args):
602
607
  with open(filename, 'r') as fp:
603
608
  content = fp.readlines()
604
609
  data_starts = []
@@ -634,7 +639,11 @@ def _read_append_rep(filename, pattern, b2b, cfg_separator, im, single):
634
639
  start = data_starts[cnfg]
635
640
  stop = start + data_starts[1]
636
641
  chunk = content[start:stop]
637
- idl, data = _read_chunk(chunk, gauge_line, cfg_separator, start_read, T, corr_line, b2b, pattern, im, single)
642
+ try:
643
+ idl = idl_func(chunk[gauge_line], *cfg_func_args)
644
+ except Exception:
645
+ raise Exception("Couldn't parse idl from file", filename, ", problem with chunk of lines", start + 1, "to", stop + 1)
646
+ data = _read_chunk_data(chunk, start_read, T, corr_line, b2b, pattern, im, single)
638
647
  rep_idl.append(idl)
639
648
  rep_data.append(data)
640
649
 
@@ -0,0 +1 @@
1
+ __version__ = "2.16.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyerrors
3
- Version: 2.15.0
3
+ Version: 2.16.0
4
4
  Summary: Error propagation and statistical analysis for Monte Carlo simulations
5
5
  Home-page: https://github.com/fjosw/pyerrors
6
6
  Author: Fabian Joswig
@@ -12,13 +12,13 @@ Project-URL: Changelog, https://github.com/fjosw/pyerrors/blob/master/CHANGELOG.
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Science/Research
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.9
16
15
  Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
20
  Classifier: Topic :: Scientific/Engineering :: Physics
21
- Requires-Python: >=3.9.0
21
+ Requires-Python: >=3.10.0
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: numpy>=2.0
@@ -52,7 +52,7 @@ Dynamic: requires-dist
52
52
  Dynamic: requires-python
53
53
  Dynamic: summary
54
54
 
55
- [![](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![arXiv](https://img.shields.io/badge/arXiv-2209.14371-b31b1b.svg)](https://arxiv.org/abs/2209.14371) [![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2023.108750-blue)](https://doi.org/10.1016/j.cpc.2023.108750)
55
+ [![](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![arXiv](https://img.shields.io/badge/arXiv-2209.14371-b31b1b.svg)](https://arxiv.org/abs/2209.14371) [![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2023.108750-blue)](https://doi.org/10.1016/j.cpc.2023.108750)
56
56
  # pyerrors
57
57
  `pyerrors` is a python framework for error computation and propagation of Markov chain Monte Carlo data from lattice field theory and statistical mechanics simulations.
58
58
 
@@ -24,18 +24,18 @@ setup(name='pyerrors',
24
24
  author_email='fabian.joswig@ed.ac.uk',
25
25
  license="MIT",
26
26
  packages=find_packages(),
27
- python_requires='>=3.9.0',
27
+ python_requires='>=3.10.0',
28
28
  install_requires=['numpy>=2.0', 'autograd>=1.7.0', 'numdifftools>=0.9.41', 'matplotlib>=3.9', 'scipy>=1.13', 'iminuit>=2.28', 'h5py>=3.11', 'lxml>=5.0', 'python-rapidjson>=1.20', 'pandas>=2.2'],
29
29
  extras_require={'test': ['pytest', 'pytest-cov', 'pytest-benchmark', 'hypothesis', 'nbmake', 'flake8']},
30
30
  classifiers=[
31
31
  'Development Status :: 5 - Production/Stable',
32
32
  'Intended Audience :: Science/Research',
33
33
  'Programming Language :: Python :: 3',
34
- 'Programming Language :: Python :: 3.9',
35
34
  'Programming Language :: Python :: 3.10',
36
35
  'Programming Language :: Python :: 3.11',
37
36
  'Programming Language :: Python :: 3.12',
38
37
  'Programming Language :: Python :: 3.13',
38
+ 'Programming Language :: Python :: 3.14',
39
39
  'Topic :: Scientific/Engineering :: Physics'
40
40
  ],
41
41
  )
@@ -1 +0,0 @@
1
- __version__ = "2.15.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes