Skip to content

Commit

Permalink
fix pstore.models.metadata
Browse files Browse the repository at this point in the history
- fix for key_0 not in join result
  • Loading branch information
dbrakenhoff committed Feb 7, 2025
1 parent 2cdc095 commit fe6d36c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pastastore/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,9 +1477,10 @@ def metadata(self):
names=["oseries", "modelname"],
)
modeldf = pd.DataFrame(index=idx)
modeldf = modeldf.join(
self.conn.oseries, on=modeldf.index.get_level_values(0)
).drop("key_0", axis=1)
modeldf = modeldf.join(self.conn.oseries, on=modeldf.index.get_level_values(0))
# drop key_0 column if it exists
if "key_0" in modeldf.columns:
modeldf.drop("key_0", axis=1, inplace=True)
modeldf["n_stressmodels"] = 0
for onam, mlnam in modeldf.index:
mldict = self.conn.get_models(mlnam, return_dict=True)
Expand Down

0 comments on commit fe6d36c

Please sign in to comment.