Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gb/bias nc #181

Merged
merged 15 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
'sphinx_click.ext',
"sphinx_tabs.tabs",
"sphinx_copybutton",
]

intersphinx_mapping = {
Expand All @@ -81,7 +83,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -140,7 +142,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'rexdoc'
htmlhelp_basename = 'sup3rdoc'

# -- Options for LaTeX output ------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion sup3r/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"""Super Resolving Renewable Energy Resource Data (SUP3R)"""
import os
from sup3r.version import __version__
import sup3r.cli # import sets up CLI commands
# Next import sets up CLI commands
# This line could be "import sup3r.cli" but that breaks sphinx as of 12/11/2023
from sup3r.cli import main

__author__ = """Brandon Benton"""
__email__ = "[email protected]"
Expand Down
3 changes: 2 additions & 1 deletion sup3r/bias/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"""Bias calculation and correction modules."""
from .bias_transforms import (global_linear_bc, local_linear_bc,
monthly_local_linear_bc)
from .bias_calc import LinearCorrection, MonthlyLinearCorrection
from .bias_calc import (LinearCorrection, MonthlyLinearCorrection,
SkillAssessment)
302 changes: 212 additions & 90 deletions sup3r/bias/bias_calc.py

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion sup3r/bias/bias_correct_means.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import numpy as np
import pandas as pd
import rioxarray
import xarray as xr
from rex import Resource
from scipy.interpolate import interp1d
Expand Down Expand Up @@ -116,6 +115,11 @@ def convert_month_height_tif(self, month, height):
os.remove(outfile)

if not os.path.exists(outfile) or self.overwrite:
try:
import rioxarray
except ImportError as e:
msg = 'Need special installation of "rioxarray" to run this!'
raise ImportError(msg) from e
tmp = rioxarray.open_rasterio(infile)
ds = tmp.to_dataset("band")
ds = ds.rename(
Expand Down