Skip to content

Commit b0a7fd7

Browse files
committed
run ruff format
1 parent 414cf01 commit b0a7fd7

6 files changed

Lines changed: 33 additions & 18 deletions

File tree

src/cchdo/hydro/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,10 @@ def status_exchange(
268268

269269
out_path = Path(out_dir)
270270
cruises, files = cchdo_loader(dtype)
271-
file_paths = [(cached_file_loader(file), file) for file in track(files, description="Loading data files")]
271+
file_paths = [
272+
(cached_file_loader(file), file)
273+
for file in track(files, description="Loading data files")
274+
]
272275

273276
results = []
274277
all_unknown_params = {}

src/cchdo/hydro/accessors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ def sum_lon(deg_float):
383383
return f"{deg:>3d} {mins:05.2f} {hem}"
384384

385385
col_widths = [len(s) for s in SUM_COLUMN_HEADERS_1]
386-
col_widths = [max(x, len(s)) for x, s in zip(col_widths, SUM_COLUMN_HEADERS_2, strict=True)]
386+
col_widths = [
387+
max(x, len(s))
388+
for x, s in zip(col_widths, SUM_COLUMN_HEADERS_2, strict=True)
389+
]
387390

388391
sum_rows = []
389392
for _, prof in self._obj.groupby("N_PROF", squeeze=False):

src/cchdo/hydro/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def check_flags(dataset: xr.Dataset, raises=True):
131131
# TODO deal with strs
132132

133133
if np.issubdtype(data.values.dtype, np.number):
134-
fill_value_mismatch: xr.DataArray = ~(np.isfinite(data) ^ has_fill) #type: ignore[assignment]
134+
fill_value_mismatch: xr.DataArray = ~(np.isfinite(data) ^ has_fill) # type: ignore[assignment]
135135
if np.any(fill_value_mismatch):
136136
fill_value_mismatch.attrs["comments"] = (
137137
f"This is a boolean array in the same shape as '{data.name}' which is truthy where invalid values exist"

src/cchdo/hydro/exchange/helpers.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ def gen_template(
5959
ftype = FileType(ftype)
6060

6161
exclude = {
62-
"EXPOCODE",
63-
"STNNBR",
64-
"CASTNO",
65-
"SAMPNO",
66-
"LATITUDE",
67-
"LONGITUDE",
68-
"DATE",
69-
"TIME",
70-
"CTDPRS",
71-
"BTL_TIME",
72-
"BTL_DATE",
73-
}
62+
"EXPOCODE",
63+
"STNNBR",
64+
"CASTNO",
65+
"SAMPNO",
66+
"LATITUDE",
67+
"LONGITUDE",
68+
"DATE",
69+
"TIME",
70+
"CTDPRS",
71+
"BTL_TIME",
72+
"BTL_DATE",
73+
}
7474

7575
params = [
7676
"EXPOCODE",

src/cchdo/hydro/legacy/woce/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,18 @@ def quality_flags_of(column):
296296

297297
if acc.FLAG_NAME in column.attrs:
298298
flags.append(
299-
[f"{x:1d}" for x in column.attrs[acc.FLAG_NAME].fillna(9).to_numpy().astype(int)]
299+
[
300+
f"{x:1d}"
301+
for x in column.attrs[acc.FLAG_NAME]
302+
.fillna(9)
303+
.to_numpy()
304+
.astype(int)
305+
]
300306
)
301307

302-
for row_d, row_f in zip_longest(zip(*data, strict=True), zip(*flags, strict=True), fillvalue=""):
308+
for row_d, row_f in zip_longest(
309+
zip(*data, strict=True), zip(*flags, strict=True), fillvalue=""
310+
):
303311
data_lines.append(base_format.format(*row_d, "".join(row_f)))
304312

305313
return "".join([record2, record3, record4, *data_lines])

src/cchdo/hydro/tests/test_core_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ def test_remove_param(param, flag, error, empty, require_empty):
267267

268268
if not all(bools):
269269
_, _params, _units, _data = zip(
270-
*filter(lambda x: not x[0], zip(bools, params, units, data, strict=True)), strict=True
270+
*filter(lambda x: not x[0], zip(bools, params, units, data, strict=True)),
271+
strict=True,
271272
)
272273
else:
273274
_params = ()

0 commit comments

Comments
 (0)