Skip to content

Commit

Permalink
updated cli version import to handle not installed case, updated H in…
Browse files Browse the repository at this point in the history
…italization test
  • Loading branch information
deronsmith committed Aug 23, 2024
1 parent 643305c commit 2111f06
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Binary file modified .coverage
Binary file not shown.
7 changes: 6 additions & 1 deletion esat/cli/esat_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import importlib.metadata
import sys
import os

Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/model/test_sa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2111f06

Please sign in to comment.