mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-06-29 08:19:27 +02:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
b67b5495e2
2 changed files with 21 additions and 19 deletions
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [2.8.2] - 2023-06-02
|
||||||
|
### Fixed
|
||||||
|
- Another bug appearing in an edge case of `_compute_drho` fixed.
|
||||||
|
|
||||||
## [2.8.1] - 2023-06-01
|
## [2.8.1] - 2023-06-01
|
||||||
### Fixed
|
### Fixed
|
||||||
- `input.pandas` can now deal with columns that only have `None` entries.
|
- `input.pandas` can now deal with columns that only have `None` entries.
|
||||||
|
|
|
@ -286,28 +286,26 @@ def _make_pattern(version, name, noffset, wf, wf2, b2b, quarks):
|
||||||
def _find_correlator(file_name, version, pattern, b2b, silent=False):
|
def _find_correlator(file_name, version, pattern, b2b, silent=False):
|
||||||
T = 0
|
T = 0
|
||||||
|
|
||||||
file = open(file_name, "r")
|
with open(file_name, "r") as my_file:
|
||||||
|
|
||||||
|
content = my_file.read()
|
||||||
|
match = re.search(pattern, content)
|
||||||
|
if match:
|
||||||
|
if version == "0.0":
|
||||||
|
start_read = content.count('\n', 0, match.start()) + 1
|
||||||
|
T = content.count('\n', start_read)
|
||||||
|
else:
|
||||||
|
start_read = content.count('\n', 0, match.start()) + 5 + b2b
|
||||||
|
end_match = re.search(r'\n\s*\n', content[match.start():])
|
||||||
|
T = content[match.start():].count('\n', 0, end_match.start()) - 4 - b2b
|
||||||
|
if not T > 0:
|
||||||
|
raise ValueError("Correlator with pattern\n" + pattern + "\nis empty!")
|
||||||
|
if not silent:
|
||||||
|
print(T, 'entries, starting to read in line', start_read)
|
||||||
|
|
||||||
content = file.read()
|
|
||||||
match = re.search(pattern, content)
|
|
||||||
if match:
|
|
||||||
if version == "0.0":
|
|
||||||
start_read = content.count('\n', 0, match.start()) + 1
|
|
||||||
T = content.count('\n', start_read)
|
|
||||||
else:
|
else:
|
||||||
start_read = content.count('\n', 0, match.start()) + 5 + b2b
|
raise ValueError('Correlator with pattern\n' + pattern + '\nnot found.')
|
||||||
end_match = re.search(r'\n\s*\n', content[match.start():])
|
|
||||||
T = content[match.start():].count('\n', 0, end_match.start()) - 4 - b2b
|
|
||||||
if not T > 0:
|
|
||||||
raise ValueError("Correlator with pattern\n" + pattern + "\nis empty!")
|
|
||||||
if not silent:
|
|
||||||
print(T, 'entries, starting to read in line', start_read)
|
|
||||||
|
|
||||||
else:
|
|
||||||
file.close()
|
|
||||||
raise ValueError('Correlator with pattern\n' + pattern + '\nnot found.')
|
|
||||||
|
|
||||||
file.close()
|
|
||||||
return start_read, T
|
return start_read, T
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue