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

Custom Errors #268

Closed
PythonFZ opened this issue Mar 26, 2022 · 1 comment · Fixed by #384
Closed

Custom Errors #268

PythonFZ opened this issue Mar 26, 2022 · 1 comment · Fixed by #384

Comments

@PythonFZ
Copy link
Member

ZnTrack should raise custom errors such as NodeLoadingError

@PythonFZ
Copy link
Member Author

Currently there are at least the following issues given the following Node:

from zntrack import Node, zn

class WriteNumber(Node):
    input = zn.params()
    output = zn.outs()
    
    def run(self):
        self.output = self.input

No Graph written yet

When no dvc.yaml etc. exist the following issues occur:

print(empty_obj = WriteNumber["not-existend"])
# <main.WriteNumber object at 0x151794868550>(name=not-existend)

it should print some more information on the state of the Node. E.g. if the parameters could be read, outputs could be read, queued, git revision, ...

empty_obj.input # raises FileNotFoundError    
empty_obj.output# raises FileNotFoundError    

both of these should raise different errors! Maybe ParamterNotAvailable and OutputsNotAvailable or InvalidStateError

If the graph is written but not executed it the outputs are not available and should raise the same error.

empty_obj.output# raises FileNotFoundError    

@PythonFZ PythonFZ linked a pull request Sep 14, 2022 that will close this issue
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 a pull request may close this issue.

1 participant