diff --git a/pyproject.toml b/pyproject.toml index 2000bf3..d39a01c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ dependencies = [ "pandas", "mkdocstrings[python]", "xarray", + "toml" ] classifiers = [ diff --git a/src/echosms/referencemodels.py b/src/echosms/referencemodels.py index f9db306..572faef 100644 --- a/src/echosms/referencemodels.py +++ b/src/echosms/referencemodels.py @@ -1,7 +1,7 @@ """Reference model parameters.""" from pathlib import Path -import tomllib +import toml # Could use standard library tomllib once python >=3.11 import pandas as pd pd.options.mode.copy_on_write = True @@ -25,8 +25,8 @@ def __init__(self): self.definitions = [] - with open(self.defs_filename, 'rb') as f: - self.definitions = tomllib.load(f) + with open(self.defs_filename, 'r') as f: + self.definitions = toml.load(f) # Flag duplicate target names pda = pd.Series(self.names())