Skip to content

Commit bba8ced

Browse files
authored
Merge pull request #153 from Ocean-Data-Lab/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 389c70a + a570dea commit bba8ced

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
- id: black
2828

2929
- repo: https://github.com/PyCQA/flake8
30-
rev: 6.0.0
30+
rev: 6.1.0
3131
hooks:
3232
- id: flake8
3333

ooipy/hydrophone/basic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ def visualize(
883883
t = self.time[::res_reduction_time]
884884

885885
# Convert t to np.array of datetime.datetime
886-
if type(t[0]) == UTCDateTime:
886+
if type(t[0]) is UTCDateTime:
887887
for k in range(len(t)):
888888
t[k] = t[k].datetime
889889

@@ -916,7 +916,7 @@ def visualize(
916916
plt.colorbar(im, ax=ax, ticks=np.arange(vmin, vmax + vdelta, vdelta_cbar))
917917
plt.tick_params(axis="y")
918918

919-
if type(t[0]) == datetime.datetime:
919+
if type(t[0]) is datetime.datetime:
920920
ax.xaxis.set_major_formatter(mdates.DateFormatter("%y-%m-%d %H:%M"))
921921

922922
if save_spec:
@@ -1073,17 +1073,17 @@ def save(self, filename="psd.json", ancillary_data=[], ancillary_data_label=[]):
10731073
else:
10741074
f = self.freq
10751075

1076-
if type(self.values) != list:
1076+
if type(self.values) is not list:
10771077
values = self.values.tolist()
10781078

1079-
if type(f) != list:
1079+
if type(f) is not list:
10801080
f = f.tolist()
10811081

10821082
dct = {"psd": values, "f": f}
10831083

10841084
if len(ancillary_data) != 0:
10851085
for i in range(len(ancillary_data)):
1086-
if type(ancillary_data[i]) != list:
1086+
if type(ancillary_data[i]) is not list:
10871087
dct[ancillary_data_label[i]] = ancillary_data[i].tolist()
10881088
else:
10891089
dct[ancillary_data_label[i]] = ancillary_data[i]

tests/test_request.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def test_get_acoustic_data():
2020

2121
data = hyd_request.get_acoustic_data(start_time, end_time, node)
2222

23-
assert type(data) == HydrophoneData
24-
assert type(data.data) == np.ndarray
23+
assert type(data) is HydrophoneData
24+
assert type(data.data) is np.ndarray
2525

2626
diff_start = abs((start_time - data.stats.starttime.datetime).microseconds)
2727
diff_end = abs((end_time - data.stats.endtime.datetime).microseconds)
@@ -45,8 +45,8 @@ def test_get_acoustic_data():
4545

4646
data = hyd_request.get_acoustic_data(start_time, end_time, node, append=False)
4747

48-
assert type(data) == HydrophoneData
49-
assert type(data.data) == np.ndarray
48+
assert type(data) is HydrophoneData
49+
assert type(data.data) is np.ndarray
5050

5151
diff_start = abs((start_time - data.stats.starttime.datetime).microseconds)
5252
diff_end = abs((end_time - data.stats.endtime.datetime).microseconds)

0 commit comments

Comments
 (0)