Skip to content
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

Remove global config for dataclass_wizard #36

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions mllam_data_prep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ class InvalidConfigException(Exception):
pass


class GlobalJSONMeta(JSONWizard.Meta):
"""
Global settings for the JSON load/dump process, that should apply to
*all* subclasses of `JSONWizard`.

Note: it does not matter where this class is defined, as long as it's
declared before any methods in `JSONWizard` are called.
"""

raise_on_unknown_json_key = True


@dataclass
class Range:
"""
Expand Down Expand Up @@ -275,7 +263,7 @@ class Output:


@dataclass
class Config(dataclass_wizard.YAMLWizard):
class Config(dataclass_wizard.JSONWizard, dataclass_wizard.YAMLWizard):
"""Configuration for the model.

Attributes:
Expand Down Expand Up @@ -305,6 +293,9 @@ class Config(dataclass_wizard.YAMLWizard):
schema_version: str
dataset_version: str

class _(JSONWizard.Meta):
raise_on_unknown_json_key = True


if __name__ == "__main__":
import argparse
Expand Down
Loading