-
Notifications
You must be signed in to change notification settings - Fork 74
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
Replace enums to be extendable #151
Conversation
class Property: | ||
def __init__(self, name: str, value: Any) -> None: | ||
self.name = name | ||
self.value = value | ||
|
||
|
||
class SupportedModelFormats: | ||
TENSORFLOW = Property("TENSORFLOW", "tensorflow") | ||
KERAS_H5 = Property("KERAS_H5", "keras_h5") | ||
KERAS = Property("KERAS", "keras") | ||
NUMPY = Property("NUMPY", "numpy") | ||
PYTORCH = Property("PYTORCH", "pytorch") | ||
PICKLE = Property("PICKLE", "pickle") |
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.
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.
Replacing the enum since it's not extendable, in the current enum state other applications adding their own scanners can't add additional model formats or issue codes
class SkipCategories: | ||
SCAN_NOT_SUPPORTED = Property("SCAN_NOT_SUPPORTED", 1) | ||
BAD_ZIP = Property("BAD_ZIP", 2) | ||
MODEL_CONFIG = Property("MODEL_CONFIG", 3) | ||
H5_DATA = Property("H5_DATA", 4) | ||
NOT_IMPLEMENTED = Property("NOT_IMPLEMENTED", 5) | ||
MAGIC_NUMBER = Property("MAGIC_NUMBER", 6) |
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.
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.
same problem with not being extendable
Replace SkipCategories, IssueCode, DefaultModelFormats enums with extendable classes
Renames DefaultModelFormats to SupportedModelFormats