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

BDRSPS-1117: Move registries out of the classes they register #367

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

Lincoln-GR
Copy link
Contributor

@Lincoln-GR Lincoln-GR commented Dec 11, 2024

3 commits can be viewed individually:

  • Move mapper registry out of the mapper class
  • Move vocab registry out of the vocab class
  • Add get_flexible_vocab function and method, and use them where appropriate.

Also refactor get_mappers to registered_ids so there is less chance of registry being mutated where it shouldn't
These methods return Type[FlexibleVocabulary], rather than Type[Vocabulary]

This lets us move the __init__ arguments to the FlexibleVocab class,
and so code that is using regular, restricted vocabs, doesn't need to supply those args when instantiating the vocab.
@Lincoln-GR Lincoln-GR changed the title BDRSPS-1117 BDRSPS-1117: Move registries out of the classes they register Dec 11, 2024
@Lincoln-GR Lincoln-GR marked this pull request as ready for review December 11, 2024 09:10
@Lincoln-GR Lincoln-GR merged commit 73a415f into main Dec 12, 2024
9 checks passed
@Lincoln-GR Lincoln-GR deleted the BDRSPS-1117 branch December 12, 2024 01:02
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.

2 participants