-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Link up with yadg. * black * Remove debug print from test * Ask for a release of yadg. * Add externaldate exporting. * Add func & test for path
- Loading branch information
Peter Kraus
authored
May 11, 2022
1 parent
e25015d
commit 3790280
Showing
13 changed files
with
158 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
_device_to_parser = { | ||
"dummy": "dummy", | ||
"biologic": "electrochem", | ||
} | ||
|
||
|
||
def get_yadg_preset(method: list[dict], pipeline: dict) -> dict: | ||
preset = { | ||
"metadata": { | ||
"version": "4.1.1", | ||
"provenance": {"type": "tomato"}, | ||
"timezone": "localtime", | ||
}, | ||
"steps": [], | ||
} | ||
|
||
devices = {item["tag"]: item["driver"] for item in pipeline["devices"]} | ||
for dev in set([item["device"] for item in method]): | ||
step = { | ||
"tag": dev, | ||
"parser": _device_to_parser[devices[dev]], | ||
"input": {"folders": ["."], "prefix": dev, "suffix": "data.json"}, | ||
"parameters": {"filetype": "tomato.json"}, | ||
"externaldate": { | ||
"using": { | ||
"file": { | ||
"type": "json", | ||
"path": f"{dev}_status.json", | ||
"match": "uts" | ||
} | ||
}, | ||
} | ||
} | ||
preset["steps"].append(step) | ||
return preset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.