Skip to content

Commit

Permalink
Fix ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Nov 27, 2024
1 parent da25f2a commit 264d50a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cheta/tests/test_orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ def test_orbital_elements():
"mean_anomaly": 354.971325,
} # 354.9724 in reference (roundoff in example)

for key in expected:
for key in expected: # noqa: PLC0206
assert np.allclose(out[key], expected[key], atol=0.0, rtol=1e-6)
4 changes: 3 additions & 1 deletion test/compare_regr_vals.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def get_options():
if attr not in f:
continue
if len(f[attr]) != len(t[attr]):
print(f"[NOT OK] {msid} {stat}: Length mismatch: {len(f[attr])} {len(t[attr])}")
print(
f"[NOT OK] {msid} {stat}: Length mismatch: {len(f[attr])} {len(t[attr])}"
)
all_ok = False
continue
if attr == "quals":
Expand Down
42 changes: 21 additions & 21 deletions test/make_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
# run in pylab

import os
import sys
from matplotlib.pyplot import *

import cheta.fetch_sci as fetch
import matplotlib.pyplot as plt
from ska_matplotlib import plot_cxctime

print('Fetch file is', fetch.__file__)
print('ENG_ARCHIVE is', os.environ['ENG_ARCHIVE'])
import cheta.fetch_sci as fetch

print("Fetch file is", fetch.__file__)
print("ENG_ARCHIVE is", os.environ["ENG_ARCHIVE"])

msids = ('1crat', 'fptemp_11', 'orbitephem0_x', 'sim_z', 'tephin')
msids = ("1crat", "fptemp_11", "orbitephem0_x", "sim_z", "tephin")
rootdir = os.path.dirname(__file__)

for ifig, msid in enumerate(msids):
figure(ifig+1)
clf()
dat = fetch.MSID(msid, '2024:002', '2024:008', filter_bad=True)
dat5 = fetch.MSID(msid, '2024:002', '2024:008',stat='5min')
datday = fetch.MSID(msid, '2024:002', '2024:008', stat='daily')
subplot(3, 1, 1)
plot_cxctime(dat.times, dat.vals, '-b')
grid()
subplot(3, 1, 2)
plot_cxctime(dat5.times, dat5.means, '-r')
grid()
subplot(3, 1, 3)
plot_cxctime(datday.times, datday.means, '-c')
grid()
savefig(os.path.join(rootdir, 'plot_{0}.png'.format(msid)))
plt.figure(ifig + 1)
plt.clf()
dat = fetch.MSID(msid, "2024:002", "2024:008", filter_bad=True)
dat5 = fetch.MSID(msid, "2024:002", "2024:008", stat="5min")
datday = fetch.MSID(msid, "2024:002", "2024:008", stat="daily")
plt.subplot(3, 1, 1)
plot_cxctime(dat.times, dat.vals, "-b")
plt.grid()
plt.subplot(3, 1, 2)
plot_cxctime(dat5.times, dat5.means, "-r")
plt.grid()
plt.subplot(3, 1, 3)
plot_cxctime(datday.times, datday.means, "-c")
plt.grid()
plt.savefig(os.path.join(rootdir, "plot_{0}.png".format(msid)))

0 comments on commit 264d50a

Please sign in to comment.