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

Add node.state.eager to check, e.g. if figures should be saved #755

Open
PythonFZ opened this issue Jan 11, 2024 · 0 comments
Open

Add node.state.eager to check, e.g. if figures should be saved #755

PythonFZ opened this issue Jan 11, 2024 · 0 comments

Comments

@PythonFZ
Copy link
Member

PythonFZ commented Jan 11, 2024

loaded: bool
results: "NodeStatusResults"
remote: str = None
rev: str = None
tmp_path: pathlib.Path = dataclasses.field(
default=DISABLE_TMP_PATH, init=False, repr=False
)

This could be used as a check for everything that should be stored to disk.
Something like

fig = ...
if self.state.eager:
   fig.show()
else: # triggered via `dvc repro` or `zntrack run ...`
   fig.savefig(...)

Alternative names:

  • state.eager
  • state.dvc_run
  • state.is_interactive / state.interactive
  • state.mode == "interactive"

Could this already be checked via state.loaded?

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

No branches or pull requests

1 participant