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

Remove excess unit conversion info logging #168

Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed
- Remove duplicated service-level logging info lines of code introduced by PR #148 (PR #168, @emileten)

## [0.15.1] - 2021-12-29
### Fixed
Expand Down
3 changes: 3 additions & 0 deletions dodola/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ def xclim_units_any2pint(ds, var):
-------
xr.Dataset with `var` units str attribute converted to xclim's pint registry format
"""

logger.info(f"Reformatting {var} unit string representation")
ds[var].attrs["units"] = str(xclim_units.units2pint(ds[var].attrs["units"]))
return ds

Expand All @@ -430,6 +432,7 @@ def xclim_units_pint2cf(ds, var):
-------
xr.Dataset with `var` units str attribute converted to CF format
"""
logger.info(f"Reformatting {var} unit string representation")
ds[var].attrs["units"] = xclim_units.pint2cfunits(
xclim_units.units2pint(ds[var].attrs["units"])
)
Expand Down
5 changes: 0 additions & 5 deletions dodola/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def train_qdm(
hist = hist.isel(isel_slice)
ref = ref.isel(isel_slice)

logger.info(f"Converting {variable} units to xclim pint compatible units")
ref = xclim_units_any2pint(ref, variable)
hist = xclim_units_any2pint(hist, variable)

Expand Down Expand Up @@ -320,7 +319,6 @@ def apply_qdm(
qdm_ds.load()
sim_ds.load()

logger.info(f"Converting {variable} units to xclim pint compatible units")
sim_ds = xclim_units_any2pint(sim_ds, variable)

adjusted_ds = adjust_quantiledeltamapping(
Expand All @@ -332,7 +330,6 @@ def apply_qdm(
include_quantiles=True,
)

logger.info(f"Converting {variable} units back to CF compatible units")
adjusted_ds = xclim_units_pint2cf(adjusted_ds, variable)

if new_attrs:
Expand Down Expand Up @@ -397,7 +394,6 @@ def train_qplad(
ref_coarse.load()
ref_fine.load()

logger.info(f"Converting {variable} units to xclim pint compatible units")
ref_coarse = xclim_units_any2pint(ref_coarse, variable)
ref_fine = xclim_units_any2pint(ref_fine, variable)

Expand Down Expand Up @@ -484,7 +480,6 @@ def apply_qplad(

variable = str(variable)

logger.info(f"Converting {variable} units to xclim pint compatible units")
sim_ds = xclim_units_any2pint(sim_ds, variable)
for var in qplad_ds:
qplad_ds = xclim_units_any2pint(qplad_ds, var)
Expand Down