Skip to content

Commit

Permalink
use black 24 (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause authored Jan 29, 2024
1 parent 7c56bba commit 7667fe9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- statsmodels
- xarray>=2023.04 # because pandas 2 is required
# for testing
- black<23.1
- black!=23
- flake8
- isort
- pytest
Expand Down
1 change: 1 addition & 0 deletions examples/config_tas_cmip6ng_example.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Example configuration file
"""

import os.path

from mesmer.create_emulations import create_seed_dict
Expand Down
5 changes: 2 additions & 3 deletions mesmer/calibrate_mesmer/calibrate_mesmer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Functions to calibrate all modules of MESMER
"""

import logging
import warnings

Expand Down Expand Up @@ -212,9 +213,7 @@ def _calibrate_tas(
)

if use_tas2:
gt_tas2_s = {
scen: gt_tas_scen**2 for scen, gt_tas_scen in gt_tas_s.items()
}
gt_tas2_s = {scen: gt_tas_scen**2 for scen, gt_tas_scen in gt_tas_s.items()}

if use_hfds:
gt_hfds_s = gather_gt_data(
Expand Down
2 changes: 2 additions & 0 deletions mesmer/stats/_gaspari_cohn.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ def _gaspari_cohn_np(r):
sel = (r >= 0) & (r < 1)
r_sel = r[sel]

# fmt: off
out[sel] = (
1
- 5 / 3 * r_sel**2
+ 5 / 8 * r_sel**3
+ 1 / 2 * r_sel**4
- 1 / 4 * r_sel**5
)
# fmt: on

# compute for 1 <= r < 2
sel = (r >= 1) & (r < 2)
Expand Down
1 change: 1 addition & 0 deletions scripts/test_install.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test that all of our modules can be imported
Thanks https://stackoverflow.com/a/25562415/10473080
"""

import importlib
import pkgutil

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ tests =
dev =
%(docs)s
%(tests)s
black < 23
black !=23
flake8
isort
twine
Expand Down

0 comments on commit 7667fe9

Please sign in to comment.