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

Node type overriding #139

Open
barneydobson opened this issue Jan 6, 2025 · 0 comments
Open

Node type overriding #139

barneydobson opened this issue Jan 6, 2025 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@barneydobson
Copy link
Collaborator

In addition to using node_type_override to make the Model "see" the Node as that type, you may also need to set the __name__, as some code uses this property to distinguish the type. For example, here which will impact if you are making a custom River subclass. In such a case in the subclass __init__ you would need to set self.__class__.__name__ = "River".

This needs to be updated in the documentation, or (preferably) this kind of behaviour needs to be fixed in some way, as it is not a good way to distinguish Node types.

@barneydobson barneydobson added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant