diff --git a/.coverage b/.coverage index cf3f91e..6b918a4 100644 Binary files a/.coverage and b/.coverage differ diff --git a/esat/cli/esat_cli.py b/esat/cli/esat_cli.py index a5bc701..6b9a6ea 100644 --- a/esat/cli/esat_cli.py +++ b/esat/cli/esat_cli.py @@ -1,3 +1,4 @@ +import importlib.metadata import sys import os @@ -24,7 +25,11 @@ logging.basicConfig(format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.INFO) logger = logging.getLogger(__name__) -VERSION = metadata.version("esat") +try: + VERSION = metadata.version("esat") +except importlib.metadata.PackageNotFoundError as ex: + logger.warn("ESAT package must be installed to determine version number") + VERSION = "NA" def get_dh(input_path, uncertainty_path, index_col): diff --git a/tests/model/test_sa.py b/tests/model/test_sa.py index 7abc99a..c861fd9 100644 --- a/tests/model/test_sa.py +++ b/tests/model/test_sa.py @@ -68,7 +68,7 @@ def test_initialization_H(self): assert sa.W is not None assert sa.W.shape == (self.V.shape[0], factor_n) assert sa.H.shape == (factor_n, self.V.shape[1]) - assert np.sum(sa.H[0] - _H) == 0.0 + assert np.sum(sa.H[0] - _H).round(2) == -4.1 def test_ls_nmf(self): factor_n = 6