Skip to content

Commit

Permalink
Merge pull request #215 from NREL/Gui/PresRat
Browse files Browse the repository at this point in the history
PresRat correction
  • Loading branch information
castelao authored Jul 23, 2024
2 parents b2f2ad9 + fd4f453 commit 1431d2f
Show file tree
Hide file tree
Showing 9 changed files with 2,320 additions and 579 deletions.
1,060 changes: 572 additions & 488 deletions pixi.lock

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ exclude = [
]

[tool.ruff.lint]
fixable = []
fixable = [
"E225", # missing-whitespace-around-operator
"E303", # too-many-blank-lines
"UP039", # unnecessary-class-parentheses
]
# preview = true
# logger-objects = []
task-tags = ["TODO", "FIXME", "XXX"]
Expand Down Expand Up @@ -210,6 +214,9 @@ ignore = [
# redundant-keyword-arg
# c-extension-no-member

[tool.ruff.lint.flake8-quotes]
inline-quotes = 'single'

[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 5.
max-complexity = 12
Expand Down Expand Up @@ -253,13 +260,13 @@ channels = ["conda-forge", "anaconda", "main"]
platforms = ["osx-arm64", "linux-64"]

[tool.pixi.dependencies]
python = "==3.11"
python = "~=3.11.0"
cftime = ">=1.6.2"
dask = ">=2022.0"
h5netcdf = ">=1.1.0"
pillow = ">=10.0"
matplotlib = ">=3.1"
numpy = ">=1.7.0"
numpy = "~=1.7"
pandas = ">=2.0"
scipy = ">=1.0.0"
tensorflow = ">2.4,<2.16"
Expand All @@ -279,6 +286,7 @@ doc = { features = ["doc"], solve-group = "default" }
test = { features = ["test"], solve-group = "default" }

[tool.pixi.tasks]
test = "pytest --pdb --durations=10 tests"

[tool.pixi.feature.doc.dependencies]
sphinx = ">=7.0"
Expand All @@ -292,3 +300,4 @@ build = ">=0.6"
twine = ">=5.0"
ruff = ">=0.4"
ipython = ">=8.0"
pytest-xdist = ">=3.0"
9 changes: 6 additions & 3 deletions sup3r/bias/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
"""Bias calculation and correction modules."""

from .bias_transforms import (global_linear_bc, local_linear_bc,
local_qdm_bc, monthly_local_linear_bc)
from .bias_calc import (LinearCorrection, MonthlyLinearCorrection,
MonthlyScalarCorrection, SkillAssessment)
from .qdm import QuantileDeltaMappingCorrection
from .bias_transforms import (global_linear_bc, local_linear_bc,
local_qdm_bc, local_presrat_bc,
monthly_local_linear_bc)
from .qdm import PresRat, QuantileDeltaMappingCorrection

__all__ = [
"global_linear_bc",
"local_linear_bc",
"local_qdm_bc",
"local_presrat_bc",
"monthly_local_linear_bc",
"LinearCorrection",
"MonthlyLinearCorrection",
"MonthlyScalarCorrection",
"PresRat",
"QuantileDeltaMappingCorrection",
"SkillAssessment",
]
4 changes: 2 additions & 2 deletions sup3r/bias/bias_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ def run(self,
class MonthlyLinearCorrection(LinearCorrection):
"""Calculate linear correction *scalar +adder factors to bias correct data
This calculation operates on single bias sites on a montly basis
This calculation operates on single bias sites on a monthly basis
"""

NT = 12
Expand Down Expand Up @@ -1044,7 +1044,7 @@ class MonthlyScalarCorrection(MonthlyLinearCorrection):
scalar factors are computed as mean(base_data) / mean(bias_data). Adder
factors are still written but are exactly zero.
This calculation operates on single bias sites on a montly basis
This calculation operates on single bias sites on a monthly basis
"""

@staticmethod
Expand Down
Loading

0 comments on commit 1431d2f

Please sign in to comment.