Skip to content

Commit

Permalink
be able to load Metadata with additional columns
Browse files Browse the repository at this point in the history
  • Loading branch information
attila-balint-kul committed Feb 20, 2024
1 parent f21ac63 commit e6a98bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/enfobench/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0"
__version__ = "0.4.1"
3 changes: 2 additions & 1 deletion src/enfobench/dataset/_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def get_by_unique_id(self, unique_id: str) -> Metadata:
if df.empty:
msg = f"Unique id '{unique_id}' was not found."
raise KeyError(msg)
return Metadata(**df.to_dict(orient="records")[0])
metadata = df.iloc[0].to_dict()
return Metadata(**{k: v for k, v in metadata.items() if k in Metadata.__annotations__.keys()})


class WeatherSubset(Subset):
Expand Down

0 comments on commit e6a98bd

Please sign in to comment.