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

Refactor FeatureType #462

Merged
merged 4 commits into from
Sep 9, 2022
Merged

Refactor FeatureType #462

merged 4 commits into from
Sep 9, 2022

Conversation

odashi
Copy link
Contributor

@odashi odashi commented Sep 9, 2022

This PR refactors implementation around FeatureTypes:

  • Remove @dataclass decorator to make all FeatureTypes usual classes. All members are converted to immutable property.
  • Implement Serializable interface and its TypeRegistry so that it can be serialized/deserialized using the common serializer.

Fixes #423

@odashi odashi requested a review from neubig September 9, 2022 11:22
@odashi
Copy link
Contributor Author

odashi commented Sep 9, 2022

I've forgotten to add unittests around feature.py..

@odashi odashi marked this pull request as draft September 9, 2022 11:24
@odashi odashi marked this pull request as ready for review September 9, 2022 13:50
@odashi odashi requested a review from pfliu-nlp as a code owner September 9, 2022 13:50
@odashi
Copy link
Contributor Author

odashi commented Sep 9, 2022

@neubig @pfliu-nlp ready for review.

Copy link
Collaborator

@pfliu-nlp pfliu-nlp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good! Overall, it seems that we gradually replaced all dataclass with Serializable class.

@odashi odashi merged commit df48ff1 into main Sep 9, 2022
@odashi odashi deleted the feature-serializer branch September 9, 2022 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate feature registry to TypeRegistry
3 participants