Skip to content

Commit

Permalink
MNT: address black style changes, update pre-commit-config.yaml (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer authored Feb 22, 2024
1 parent 19487ea commit e7b7a39
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -10,23 +10,23 @@ repos:
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.15.1
hooks:
- id: pyupgrade
args:
- '--py38-plus'
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout
args: ['--extra-keys', 'metadata.kernelspec cell.metadata.pycharm cell.metadata.tags']
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.246'
rev: 'v0.2.2'
hooks:
- id: ruff
args: ['--fix']
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.2.0
hooks:
- id: black
- id: black-jupyter
4 changes: 1 addition & 3 deletions xradar/georeference/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ def get_crs(ds, datum="WGS84"):
crs_wkt = (
ds["crs_wkt"]
if "crs_wkt" in ds
else ds["spatial_ref"]
if "spatial_ref" in ds
else False
else ds["spatial_ref"] if "spatial_ref" in ds else False
)
if crs_wkt is not False:
proj_crs = pyproj.CRS.from_cf(crs_wkt.attrs)
Expand Down
6 changes: 3 additions & 3 deletions xradar/io/backends/furuno.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,9 @@ def open_store_variable(self, name, var):
attrs["scale_factor"] = scale_factor
attrs["_FillValue"] = 0.0
dims = (dim, "range")
attrs[
"coordinates"
] = "elevation azimuth range latitude longitude altitude time"
attrs["coordinates"] = (
"elevation azimuth range latitude longitude altitude time"
)
return Variable(dims, data, attrs, encoding)

def open_store_coordinates(self):
Expand Down
6 changes: 3 additions & 3 deletions xradar/io/backends/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -3834,9 +3834,9 @@ def open_store_variable(self, name, var):
mname = iris_mapping.get(name, name)
mapping = sweep_vars_mapping.get(mname, {})
attrs = {key: mapping[key] for key in moment_attrs if key in mapping}
attrs[
"coordinates"
] = "elevation azimuth range latitude longitude altitude time"
attrs["coordinates"] = (
"elevation azimuth range latitude longitude altitude time"
)
return mname, Variable((dim, "range"), data, attrs, encoding)

def open_store_coordinates(self, var):
Expand Down
6 changes: 3 additions & 3 deletions xradar/io/backends/odim.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,9 @@ def _get_odim_variable_name_and_attrs(name, attrs):
pass
else:
attrs.update({key: mapping[key] for key in moment_attrs})
attrs[
"coordinates"
] = "elevation azimuth range latitude longitude altitude time"
attrs["coordinates"] = (
"elevation azimuth range latitude longitude altitude time"
)
return name, attrs


Expand Down
6 changes: 3 additions & 3 deletions xradar/io/backends/rainbow.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,9 @@ def open_store_variable(self, var):
attrs["add_offset"] = vmin - scale_factor
attrs["scale_factor"] = scale_factor
attrs["_FillValue"] = 0
attrs[
"coordinates"
] = "elevation azimuth range latitude longitude altitude time"
attrs["coordinates"] = (
"elevation azimuth range latitude longitude altitude time"
)
return {mname: Variable((dim, "range"), data, attrs, encoding)}

def open_store_coordinates(self, var):
Expand Down
8 changes: 5 additions & 3 deletions xradar/io/export/cfradial1.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ def _sweep_info_mapper(dtree):

for var_name in sweep_vars:
var_data_list = [
np.unique(dtree[s][var_name].values[np.newaxis, ...])
if var_name in dtree[s]
else np.array([np.nan])
(
np.unique(dtree[s][var_name].values[np.newaxis, ...])
if var_name in dtree[s]
else np.array([np.nan])
)
for s in dtree.groups
if "sweep" in s
]
Expand Down

0 comments on commit e7b7a39

Please sign in to comment.