Skip to content

Commit

Permalink
Use external toml package to support Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmacaulay committed Aug 23, 2024
1 parent d039613 commit f3db790
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies = [
"pandas",
"mkdocstrings[python]",
"xarray",
"toml"
]

classifiers = [
Expand Down
6 changes: 3 additions & 3 deletions src/echosms/referencemodels.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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())
Expand Down

0 comments on commit f3db790

Please sign in to comment.