Skip to content

Commit

Permalink
Bump the python-dependencies group with 2 updates (#318)
Browse files Browse the repository at this point in the history
Bumps the python-dependencies group with 2 updates:
[couchbase](https://github.com/couchbase/couchbase-python-client) and
[ruff](https://github.com/astral-sh/ruff). Makes a few changes to our Ruff
configuration to stay up-to-date with the latest changes in v0.2.0.
  • Loading branch information
ian-noaa authored Feb 5, 2024
2 parents 4d81e36 + 89ba79d commit 7243205
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 71 deletions.
90 changes: 45 additions & 45 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 30 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pyyaml = "^6.0.1"
xarray = "^2024.1.1"
netcdf4 = "^1.6.5"
cfgrib = "^0.9.10.4"
couchbase = "^4.1.9"
couchbase = "^4.1.11"
pyproj = "^3.6.1"
numpy = "^1.26.2"
metpy = "^1.5.1"
Expand All @@ -23,7 +23,7 @@ prometheus-client = "^0.19.0"
[tool.poetry.group.dev.dependencies]
pytest = "^8.0.0"
types-pyyaml = "^6.0.12.12"
ruff = "^0.1.6"
ruff = "^0.2.0"
coverage = "^7.4.1"

[build-system]
Expand All @@ -40,4 +40,31 @@ markers = [

[tool.coverage.run]
branch = true
source = ["src"]
source = ["src"]

[tool.ruff]
# Dirs that contain third party example scripts and other languages
exclude = [
"scripts",
"meta_update_middleware",
]
output-format="full"

# For a list of available rules, see: https://docs.astral.sh/ruff/rules/
lint.select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"UP", # pyupgrade
"I", # isort
"PTH", # flake8-use-pathlib
"PT", # flake8-pytest-style
"B", # bugbear
"SIM", # flake8-simplify
"LOG", # flake8-logging
]

lint.ignore = [
"E501", # Supress line-too-long warnings: trust the formatter's judgement on this one.
"W505", # Supress line-too-long warnings: trust the formatter's judgement on this one.
]
17 changes: 0 additions & 17 deletions ruff.toml

This file was deleted.

4 changes: 1 addition & 3 deletions src/vxingest/ctc_to_cb/ctc_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,7 @@ def handle_data(self, **kwargs):
correct_negatives = correct_negatives + 1
except Exception as _e:
logger.exception("unexpected exception:%s", str(_e))
data_elem[threshold] = (
data_elem[threshold] if threshold in data_elem else {}
)
data_elem[threshold] = data_elem.get(threshold, {})
data_elem[threshold]["hits"] = hits
data_elem[threshold]["false_alarms"] = false_alarms
data_elem[threshold]["misses"] = misses
Expand Down
6 changes: 3 additions & 3 deletions src/vxingest/partial_sums_to_cb/partial_sums_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,9 @@ def handle_sum(self, params_dict):
)
model_elem["UW"] = wind_components_t[0].magnitude
model_elem["VW"] = wind_components_t[1].magnitude
# If there is no observation or model data for this variable for this station, skip it by setting the value to None
obs_var = obs_elem[variable] if variable in obs_elem else None
model_var = model_elem[variable] if variable in model_elem else None
obs_var = obs_elem.get(variable)
model_var = model_elem.get(variable)
# If there is no observation or model data for this variable for this station, skip it
if obs_var is not None and model_var is not None:
obs_vals.append(obs_var)
model_vals.append(model_var)
Expand Down

0 comments on commit 7243205

Please sign in to comment.