Skip to content

Commit

Permalink
try to find out where these hdf5 headers are
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger committed Apr 30, 2024
1 parent 07827cf commit 67daabb
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 681 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ jobs:
python -m pip install --upgrade pip
python -m pip install build
- name: Install hdf5 (macOS)
if: runner.os == 'macOS'
run: brew install hdf5

- name: Check git status (not Windows)
if: runner.os != 'Windows'
run: |
env
if [[ -z "$(git status --porcelain)" ]]; then
echo "No changes found."
else
Expand Down
24 changes: 7 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.2
hooks:
- id: ruff
args:
- --preview
- --fix
- --exit-non-zero-on-fix
args: [--fix]
- id: ruff-format
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args: ["--select=E9,F63,F7,F82", "--show-source", "--statistics"]
- repo: https://github.com/pycqa/pylint
rev: v3.0.3
hooks:
- id: pylint
name: pylint
types: [python]
exclude: ^examples/|^tests/|^setup.py$
args: ["--rcfile=pyproject.toml"]
# - repo: https://github.com/pre-commit/mirrors-mypy # FIXME
# rev: v1.8.0
# hooks:
Expand Down Expand Up @@ -67,10 +57,10 @@ repos:
# - id: rst-inline-touching-normal
- id: rst-directive-colons
- id: text-unicode-replacement-char
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
# - repo: https://github.com/psf/black
# rev: 24.2.0
# hooks:
# - id: black
# - repo: https://github.com/adamchainz/blacken-docs
# rev: 1.16.0
# hooks:
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ ruff:
.PHONY: ruff-fix
ruff-fix:
ruff check --fix --preview .
ruff format .

## changelog Create the changelog
##
Expand Down
38 changes: 18 additions & 20 deletions cmethods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
# pylint: disable=consider-using-f-string,logging-not-lazy

r"""
Module providing the a method named "adjust" to apply different bias
correction techniques to time-series climate data.
Some variables used in this package:
T = Temperatures ($T$)
X = Some climate variable ($X$)
h = historical
p = scenario; future; predicted
obs = observed data ($T_{obs,h}$)
simh = modeled data with same time period as obs ($T_{sim,h}$)
simp = data to correct (predicted simulated data) ($T_{sim,p}$)
F = Cumulative Distribution Function
\mu = mean
\sigma = standard deviation
i = index
_{m} = long-term monthly interval
Module providing the a method named "adjust" to apply different bias
correction techniques to time-series climate data.
Some variables used in this package:
T = Temperatures ($T$)
X = Some climate variable ($X$)
h = historical
p = scenario; future; predicted
obs = observed data ($T_{obs,h}$)
simh = modeled data with same time period as obs ($T_{sim,h}$)
simp = data to correct (predicted simulated data) ($T_{sim,p}$)
F = Cumulative Distribution Function
\mu = mean
\sigma = standard deviation
i = index
_{m} = long-term monthly interval
"""

from __future__ import annotations
Expand Down Expand Up @@ -128,9 +128,7 @@
help="Temporal grouping",
),
constraint=If(
Equal("method", "linear_scaling")
& Equal("method", "variance_scaling")
& Equal("method", "delta_method"),
Equal("method", "linear_scaling") & Equal("method", "variance_scaling") & Equal("method", "delta_method"),
then=require_all,
),
)
Expand Down
6 changes: 2 additions & 4 deletions cmethods/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self: UnknownMethodError, method: str, available_methods: list):

def check_adjust_called(
function_name: str,
adjust_called: Optional[bool] = None, # noqa: FBT001
adjust_called: Optional[bool] = None,
) -> None:
"""
Displays a user warning in case a correction function was not called via
Expand All @@ -55,9 +55,7 @@ def check_xr_types(obs: XRData, simh: XRData, simp: XRData) -> None:
"""
Checks if the parameters are in the correct type. **only used internally**
"""
phrase: str = (
"must be type xarray.core.dataarray.Dataset or xarray.core.dataarray.DataArray"
)
phrase: str = "must be type xarray.core.dataarray.Dataset or xarray.core.dataarray.DataArray"

if not isinstance(obs, XRData_t):
raise TypeError(f"'obs' {phrase}")
Expand Down
Loading

0 comments on commit 67daabb

Please sign in to comment.