Skip to content

Commit

Permalink
🚨 Fix linter warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
fbriol committed Nov 25, 2023
1 parent 88f2d54 commit 3a94dfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/pyinterp/tests/test_orbit_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def load_test_ephemeris(

def to_dict(comments) -> Dict[str, float]:
"""Returns a dictionary describing the parameters of the orbit."""
result = dict()
result = {}
for item in comments:
assert item.startswith('#'), 'Comments must start with #'
key, value = item[1:].split('=')
Expand Down
14 changes: 7 additions & 7 deletions src/pyinterp/tests/test_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,28 +343,28 @@ def test_period_list_cross_a_period():
numpy.datetime64('2019-12-02T01:40', 'ms'),
numpy.timedelta64(1, 's'))
flags = handler.cross_a_period(dates)
indices = numpy.where(flags == False)
indices = numpy.where(flags is False)
assert numpy.all(
dates[indices] > numpy.datetime64('2019-12-02T01:33:25.794', 'ms'))

dates = numpy.arange(numpy.datetime64('2019-12-02T00:42', 'ms'),
numpy.datetime64('2019-12-02T01:33', 'ms'),
numpy.timedelta64(1, 's'))
flags = handler.cross_a_period(dates)
assert numpy.all(flags == True)
assert numpy.all(flags is True)

dates = numpy.arange(numpy.datetime64('2019-12-01T08:32', 'ms'),
numpy.datetime64('2019-12-02T00:40', 'ms'),
numpy.timedelta64(1, 's'))
flags = handler.cross_a_period(dates)
assert numpy.all(flags == False)
assert numpy.all(flags is False)

dates = numpy.arange(numpy.datetime64('2019-12-01T08:30', 'ms'),
numpy.datetime64('2019-12-02T00:40', 'us'),
numpy.timedelta64(1, 's'))
flags = handler.cross_a_period(dates)
assert not numpy.all(flags == False)
index = numpy.max(numpy.where(flags == True)[0])
assert not numpy.all(flags is False)
index = numpy.max(numpy.where(flags is True)[0])
assert dates[index] > numpy.datetime64('2019-12-01T08:30')

other = pickle.loads(pickle.dumps(handler))
Expand All @@ -374,13 +374,13 @@ def test_period_list_cross_a_period():
numpy.datetime64('2019-12-01T04:00:00.000', 'ms'),
numpy.timedelta64(1, 's'))
flags = handler.cross_a_period(dates)
assert numpy.all(flags == False)
assert numpy.all(flags is False)

dates = numpy.arange(numpy.datetime64('2019-12-01T03:20:00.000', 'ms'),
numpy.datetime64('2019-12-01T04:00:00.000', 'ms'),
numpy.timedelta64(1, 's'))
flags = handler.cross_a_period(dates)
assert dates[flags == False][0] > numpy.datetime64(
assert dates[flags is False][0] > numpy.datetime64(
'2019-12-01T03:24:59.504', 'ms')


Expand Down

0 comments on commit 3a94dfc

Please sign in to comment.