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

Can not inherit from Node #266

Closed
PythonFZ opened this issue Mar 25, 2022 · 0 comments · Fixed by #267
Closed

Can not inherit from Node #266

PythonFZ opened this issue Mar 25, 2022 · 0 comments · Fixed by #267
Labels
bug Something isn't working needs-tests p1-important

Comments

@PythonFZ
Copy link
Member

Something like the following currently does not work,

class Base(Node)
   deps = zn.deps()
   ...

class Method1(Base)
   def run(self):
        ...
@PythonFZ PythonFZ added bug Something isn't working p1-important needs-tests labels Mar 25, 2022
@PythonFZ PythonFZ mentioned this issue Mar 25, 2022
4 tasks
@PythonFZ PythonFZ linked a pull request Mar 25, 2022 that will close this issue
4 tasks
PythonFZ added a commit that referenced this issue Mar 25, 2022
PythonFZ added a commit that referenced this issue Mar 30, 2022
* add inheritance tests

* return object if requested

* partially fix #266

* update signature of `get_descriptors`

* add MRO instead of only direct parent search

When looking for an existing `__init__` search through the MRO until you hit the Node instance instead of just checking the class for an `__init__`

* call the __init__ explicitly instead of using super

* update `get_auto_init`

* fix `get_auto_init` order

* fix issue with `instance=None` and add error message

* fix order in test assertion

* bugfix

* fix edge case of ZnTrackOptions in Base and Child class used in `auto_init`

* make `node_name` an attribute instead of a property.

* temporarily disable test for `annotations`

* ensure compatibility with Python 3.7

* bugfix + add test

* remove entries from the params.yaml / zntrack.json before saving new values.

* raise KeyError if value could not be loaded

* Update documentation

* remove try/except

* fix tests

* add `typing.Any` to avoid type issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-tests p1-important
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant