Skip to content

Commit

Permalink
more support for working out of directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jcblemai committed Apr 19, 2024
1 parent 4ff5a5a commit ec654c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flepimop/gempyor_pkg/src/gempyor/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from . import model_info, NPI, utils
import datetime
import xarray as xr
import os

logger = logging.getLogger(__name__)

Expand All @@ -29,6 +30,7 @@ def __init__(
ti: datetime.date,
tf: datetime.date,
subpop_names: list,
path_prefix: str = ".",
):
self.pconfig = parameter_config
self.pnames = []
Expand All @@ -55,7 +57,7 @@ def __init__(

# Parameter given as a file
elif self.pconfig[pn]["timeseries"].exists():
fn_name = self.pconfig[pn]["timeseries"].get()
fn_name = os.path.join(path_prefix, self.pconfig[pn]["timeseries"].get())
df = utils.read_df(fn_name).set_index("date")
df.index = pd.to_datetime(df.index)
if len(df.columns) == 1: # if only one ts, assume it applies to all subpops
Expand Down

0 comments on commit ec654c1

Please sign in to comment.