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

Avoid double registration problem #994

Open
lewfish opened this issue Sep 14, 2020 · 1 comment
Open

Avoid double registration problem #994

lewfish opened this issue Sep 14, 2020 · 1 comment
Labels

Comments

@lewfish
Copy link
Contributor

lewfish commented Sep 14, 2020

When putting the get_config function in the same module as the Pipeline and PipelineConfig, we got a RegistryError, saying that the type_hint had already been registered. I'm not sure why this was triggered in this situation, but there may be an easy way around it. Currently, we check that the type_hint hasn't been registered before (to catch mistakes where someone uses the same type_hint twice). This is good, but it leads to an error if the module gets imported twice. Hopefully we can avoid that problem if we only raise an error if the type hint and value (ie. the Config class) have already been registered.

Thanks to @echeipesh for this idea.

@lewfish lewfish added the bug label Sep 14, 2020
@AdeelH
Copy link
Collaborator

AdeelH commented Aug 5, 2022

Also reported on Gitter today: https://gitter.im/azavea/raster-vision?at=62ec8910f4d7a323deca075e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants