mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-06-30 16:59:27 +02:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
89216fa202
6 changed files with 8 additions and 8 deletions
2
.github/workflows/flake8.yml
vendored
2
.github/workflows/flake8.yml
vendored
|
@ -21,6 +21,6 @@ jobs:
|
||||||
- name: flake8 Lint
|
- name: flake8 Lint
|
||||||
uses: py-actions/flake8@v1
|
uses: py-actions/flake8@v1
|
||||||
with:
|
with:
|
||||||
ignore: "E501,E722"
|
ignore: "E501"
|
||||||
exclude: "__init__.py, input/__init__.py"
|
exclude: "__init__.py, input/__init__.py"
|
||||||
path: "pyerrors"
|
path: "pyerrors"
|
||||||
|
|
|
@ -30,6 +30,6 @@ pytest --cov=pyerrors --cov-report html
|
||||||
```
|
```
|
||||||
The linter `flake8` is executed with the command
|
The linter `flake8` is executed with the command
|
||||||
```
|
```
|
||||||
flake8 --ignore=E501,E722 --exclude=__init__.py pyerrors
|
flake8 --ignore=E501 --exclude=__init__.py pyerrors
|
||||||
```
|
```
|
||||||
Please make sure that all tests are passed for a new pull requests.
|
Please make sure that all tests are passed for a new pull requests.
|
||||||
|
|
|
@ -536,7 +536,7 @@ class Corr:
|
||||||
y_min = min([(x[0].value - x[0].dvalue) for x in self.content[x_range[0]: x_range[1] + 1] if (x is not None) and x[0].dvalue < 2 * np.abs(x[0].value)])
|
y_min = min([(x[0].value - x[0].dvalue) for x in self.content[x_range[0]: x_range[1] + 1] if (x is not None) and x[0].dvalue < 2 * np.abs(x[0].value)])
|
||||||
y_max = max([(x[0].value + x[0].dvalue) for x in self.content[x_range[0]: x_range[1] + 1] if (x is not None) and x[0].dvalue < 2 * np.abs(x[0].value)])
|
y_max = max([(x[0].value + x[0].dvalue) for x in self.content[x_range[0]: x_range[1] + 1] if (x is not None) and x[0].dvalue < 2 * np.abs(x[0].value)])
|
||||||
ax1.set_ylim([y_min - 0.1 * (y_max - y_min), y_max + 0.1 * (y_max - y_min)])
|
ax1.set_ylim([y_min - 0.1 * (y_max - y_min), y_max + 0.1 * (y_max - y_min)])
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ax1.set_ylim(y_range)
|
ax1.set_ylim(y_range)
|
||||||
|
|
|
@ -187,7 +187,7 @@ def total_least_squares(x, y, func, silent=False, **kwargs):
|
||||||
for i in range(25):
|
for i in range(25):
|
||||||
try:
|
try:
|
||||||
func(np.arange(i), x.T[0])
|
func(np.arange(i), x.T[0])
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
@ -328,7 +328,7 @@ def _prior_fit(x, y, func, priors, silent=False, **kwargs):
|
||||||
for i in range(100):
|
for i in range(100):
|
||||||
try:
|
try:
|
||||||
func(np.arange(i), 0)
|
func(np.arange(i), 0)
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
@ -469,7 +469,7 @@ def _standard_fit(x, y, func, silent=False, **kwargs):
|
||||||
for i in range(25):
|
for i in range(25):
|
||||||
try:
|
try:
|
||||||
func(np.arange(i), x.T[0])
|
func(np.arange(i), x.T[0])
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
|
@ -226,7 +226,7 @@ def write_ADerrors(obs_list, file_path, bdio_path='./libbdio.so', **kwargs):
|
||||||
for key in keys:
|
for key in keys:
|
||||||
try: # Try to convert key to integer
|
try: # Try to convert key to integer
|
||||||
ids.append(int(key))
|
ids.append(int(key))
|
||||||
except: # If not possible construct a hash
|
except Exception: # If not possible construct a hash
|
||||||
ids.append(int(hashlib.sha256(key.encode('utf-8')).hexdigest(), 16) % 10 ** 8)
|
ids.append(int(hashlib.sha256(key.encode('utf-8')).hexdigest(), 16) % 10 ** 8)
|
||||||
print('ids', ids)
|
print('ids', ids)
|
||||||
nt = []
|
nt = []
|
||||||
|
|
|
@ -946,7 +946,7 @@ def _merge_idx(idl):
|
||||||
g = groupby(idl)
|
g = groupby(idl)
|
||||||
if next(g, True) and not next(g, False):
|
if next(g, True) and not next(g, False):
|
||||||
return idl[0]
|
return idl[0]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if np.all([type(idx) is range for idx in idl]):
|
if np.all([type(idx) is range for idx in idl]):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue