Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger committed Apr 30, 2024
1 parent db36bef commit 20cbf3e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
7 changes: 2 additions & 5 deletions cmethods/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ def apply_ufunc(
not isinstance(value, str) for value in kwargs["input_core_dims"].values()
):
raise ValueError(
"input_core_dims must have three key-value pairs like: "
'{"obs": "time", "simh": "time", "simp": "time"}',
"input_core_dims must have three key-value pairs like: " '{"obs": "time", "simh": "time", "simp": "time"}',
)

input_core_dims = kwargs["input_core_dims"]
Expand Down Expand Up @@ -187,9 +186,7 @@ def adjust(
**kwargs,
)

result = (
monthly_result if result is None else xr.merge([result, monthly_result])
)
result = monthly_result if result is None else xr.merge([result, monthly_result])

return result

Expand Down
4 changes: 1 addition & 3 deletions cmethods/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ def detrended_quantile_mapping(
xbins,
cdf_simh,
) # Eq. 1
X = (
get_inverse_of_cdf(cdf_obs, epsilon, xbins) + m_simp_mean - m_simh_mean
) # Eq. 1
X = get_inverse_of_cdf(cdf_obs, epsilon, xbins) + m_simp_mean - m_simh_mean # Eq. 1

else: # kind in cls.MULTIPLICATIVE:
epsilon = np.interp( # Eq. 2
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ lint.select = [
# "TD", # flake8-todos
# "TRY", # tryceratops # specify exception messages in class; not important
]
lint.extend-select = ["COM812"]
lint.fixable = ["ALL"]

lint.ignore = [
Expand Down
3 changes: 1 addition & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ def test_adjust_type_checking_failing() -> None:
)
with pytest.raises(
TypeError,
match="'obs' must be type xarray.core.dataarray.Dataset"
" or xarray.core.dataarray.DataArray",
match="'obs' must be type xarray.core.dataarray.Dataset" " or xarray.core.dataarray.DataArray",
):
adjust(
method="linear_scaling",
Expand Down

0 comments on commit 20cbf3e

Please sign in to comment.