Skip to content

Commit

Permalink
Maintenance (#717)
Browse files Browse the repository at this point in the history
* remove pydantic dependency

* poetry update

* remove deprecated code

* use `config.files` instead of hardcoding file path

* remove `write_graph`

* fix tests
  • Loading branch information
PythonFZ authored Sep 18, 2023
1 parent 33ab97d commit 9ab4d52
Show file tree
Hide file tree
Showing 29 changed files with 1,106 additions and 1,306 deletions.
7 changes: 2 additions & 5 deletions examples/docs/01_Intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"\n",
"In DVC, a pipeline is organized into multiple stages, which can be created by inheriting from ``zntrack.Node`` and implementing a ``run()`` method.\n",
"\n",
"The ``run()`` method defines the logic of your pipeline stage, which will later be executed by our pipeline manager (e.g. ``dvc repro``). To integrate your new Node with DVC, you write the input script with the ``write_graph()`` command.\n",
"The ``run()`` method defines the logic of your pipeline stage, which will later be executed by our pipeline manager (e.g. ``dvc repro``).\n",
"\n",
"As an example, let's create a ``RandomNumber`` Node that generates a random integer between 0 and a parameterized maximum value. To do this, we'll use the zntrack module to define our Node's inputs and outputs:"
]
Expand Down Expand Up @@ -182,10 +182,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To add the Node to the DVC pipeline we can use `write_graph()` to create the DVC stage and let DVC run the commands for us.\n",
"DVC will call `node = RandomNumber.load()` followed by `node.run_and_save()`.\n",
"By default, ZnTrack will only build the graph without running it. We can change that by using `write_graph(run=True)`.\n",
"You can also pass other commands like `always_changed=True, external=True` to the `write_graph()` command."
"To add the Node to the DVC pipeline we can employ a context manager and use `project.run()`."
]
},
{
Expand Down
5 changes: 4 additions & 1 deletion examples/docs/04_metrics_and_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,10 @@
" )\n",
"\n",
"\n",
"ZnTrackMetric().write_graph(run=True)"
"with zntrack.Project() as project:\n",
" node = ZnTrackMetric()\n",
"\n",
"project.run()"
]
},
{
Expand Down
10 changes: 8 additions & 2 deletions examples/docs/05_metadata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@
}
],
"source": [
"SleepNode().write_graph(run=True)"
"with zntrack.Project() as project:\n",
" node = SleepNode()\n",
"\n",
"project.run()"
]
},
{
Expand Down Expand Up @@ -310,7 +313,10 @@
}
],
"source": [
"SleepNodeMulti().write_graph(run=True)"
"with zntrack.Project() as project:\n",
" node = SleepNodeMulti()\n",
"\n",
"project.run()"
]
},
{
Expand Down
Loading

0 comments on commit 9ab4d52

Please sign in to comment.