Skip to content

Commit

Permalink
Add future warning to nwm_client_new about package name change. (NO…
Browse files Browse the repository at this point in the history
…AA-OWP#267)

* remove python version dependent registry check

* add warning about package name change

* bump nwm-client-new to v7.5.0
  • Loading branch information
jarq6c authored Dec 3, 2024
1 parent f6b6144 commit 0ec21fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
from dataclasses import dataclass
import numpy.typing as npt
import pandas as pd
import sys

def _default_registry() -> pint.UnitRegistry:
"""Get a default registry depending upon Python version."""
version = sys.version_info.major + sys.version_info.minor/10.0
if version < 3.8:
return pint.UnitRegistry()
return pint.UnitRegistry(cache_folder=":auto:")

@dataclass
class UnitHandler:
Expand All @@ -21,7 +13,7 @@ class UnitHandler:
pint.UnitRegistry that handles all units used by UnitHandler.
"""
unit_registry: pint.UnitRegistry = _default_registry()
unit_registry: pint.UnitRegistry = pint.UnitRegistry()

def conversion_factor(self, from_units: str, to_units: str) -> float:
"""Compute and return a conversion factor from from_units to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822
from ._version import __version__

import warnings

warnings.warn(
"nwm_client_new will be renamed to nwm_client for v8.0+. Update imports as necessary.",
FutureWarning
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "7.4.4"
__version__ = "7.5.0"

0 comments on commit 0ec21fd

Please sign in to comment.