Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/ruff-action@v3
- uses: astral-sh/ruff-action@v4.1.0
with:
src: "./pyerrors"
9 changes: 2 additions & 7 deletions pyerrors/correlators.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,7 @@ def m_eff(self, variant='log', guess=1.0):
if variant == 'log':
newcontent = []
for t in range(self.T - 1):
if ((self.content[t] is None) or (self.content[t + 1] is None)) or (self.content[t + 1][0].value == 0):
newcontent.append(None)
elif self.content[t][0].value / self.content[t + 1][0].value < 0:
if ((self.content[t] is None) or (self.content[t + 1] is None)) or (self.content[t + 1][0].value == 0) or self.content[t][0].value / self.content[t + 1][0].value < 0:
newcontent.append(None)
else:
newcontent.append(self.content[t] / self.content[t + 1])
Expand All @@ -741,9 +739,7 @@ def m_eff(self, variant='log', guess=1.0):
elif variant == 'logsym':
newcontent = []
for t in range(1, self.T - 1):
if ((self.content[t - 1] is None) or (self.content[t + 1] is None)) or (self.content[t + 1][0].value == 0):
newcontent.append(None)
elif self.content[t - 1][0].value / self.content[t + 1][0].value < 0:
if ((self.content[t - 1] is None) or (self.content[t + 1] is None)) or (self.content[t + 1][0].value == 0) or self.content[t - 1][0].value / self.content[t + 1][0].value < 0:
newcontent.append(None)
else:
newcontent.append(self.content[t - 1] / self.content[t + 1])
Expand Down Expand Up @@ -872,7 +868,6 @@ def set_prange(self, prange):
raise ValueError("Start and end point must define a range in the interval 0,T")

self.prange = prange
return

def show(self, x_range=None, comp=None, y_range=None, logscale=False, plateau=None, fit_res=None, fit_key=None, ylabel=None, save=None, auto_gamma=False, hide_sigma=None, references=None, title=None):
"""Plots the correlator using the tag of the correlator as label if available.
Expand Down
3 changes: 1 addition & 2 deletions pyerrors/obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ def _compute_drho(i, e_name=e_name, w_max=w_max, e_N=e_N):
self.ddvalue = 0.0
else:
self.ddvalue = np.sqrt(self.ddvalue) / self._dvalue
return

gm = gamma_method

Expand Down Expand Up @@ -1303,7 +1302,7 @@ def _compute_scalefactor_missing_rep(obs):
options = {
'base_step': 0.1,
'step_ratio': 2.5}
for key in options.keys():
for key in options:
kwarg = kwargs.get(key)
if kwarg is not None:
options[key] = kwarg
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
target-version = "py310"

[tool.ruff.lint]
extend-select = ["E", "W", "I", "B", "PIE", "PLE", "PLW", "UP", "NPY", "RUF"]
select = ["E", "W", "I", "B", "PIE", "PLE", "PLW", "UP", "NPY", "RUF", "F"]
ignore = [
"F403", # star imports in __init__ files are intentional
"E501", # line too long
Expand Down
Loading