-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #28 - Allowing CatalogMetadata Serialisation/Deserialisation to/from JSON #169
Conversation
… dataclassbase.py.
Also testing that catalog metadata can easily be serialised to/deserialised from JSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of my comments are important more just little responses to seeing some things I knew we needed/like seeing.
"Location of a JSON file containing the Catalog Metadata for this qube. " | ||
"If present, this overrides any configuration found in the info.json." | ||
), | ||
type=click.Path(exists=True, path_type=Path, file_okay=True, dir_okay=False), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one for the documentation on the series of overrides.
- Catalog information from
info.json
- Catalog information from scraper
- Catalog information from
catalog-metadata.json
- Runtime changes
@@ -33,34 +34,9 @@ | |||
T = TypeVar("T", bound=object) | |||
|
|||
|
|||
def _from_dict(cls: Type[T], d: dict) -> T: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found where all the lines where dropped. :D
json.dump(self.as_json_dict(), f, indent=4) | ||
|
||
@classmethod | ||
def from_json_file(cls, file_path: Path) -> "CatalogMetadata": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
Part of Issue #28.