Skip to content

Commit

Permalink
Merge pull request #46 from EMMC-ASBL/modify_excel_parse
Browse files Browse the repository at this point in the history
Modify excel parse
  • Loading branch information
daniel-sintef authored Apr 8, 2022
2 parents 2a2f7ed + 5d71a07 commit 57bf366
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions oteapi_dlite/strategies/parse_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class DLiteExcelParseConfig(AttrDict):
...,
description="DLite-specific excel configurations.",
)
storage_path: Optional[str] = Field(
None,
description="Path to metadata storage",
)


class DLiteExcelParseResourceConfig(ResourceConfig):
Expand Down Expand Up @@ -115,9 +119,13 @@ def get(self, session: "Optional[Dict[str, Any]]" = None) -> SessionUpdate:
rec = dict2recarray(columns, names=names)

if config.metadata:
raise NotImplementedError("")
# else
meta = infer_metadata(rec, units=units)
if config.storage_path is not None:
for storage_path in config.storage_path.split("|"):
dlite.storage_path.append(storage_path)
meta = dlite.get_instance(config.metadata)
# check the metadata config would go here
else:
meta = infer_metadata(rec, units=units)

inst = meta(dims=[len(rec)], id=config.id)
for name in names:
Expand Down

0 comments on commit 57bf366

Please sign in to comment.