Skip to content

Commit

Permalink
add zn.Meta for metadata which is not tracked by DVC (#404)
Browse files Browse the repository at this point in the history
* add `zn.Meta` for metadata which is not tracked by DVC

* Merge branch 'main' into 294-...

* add 'zntrack.meta.Text' ZnTrackOption

* fix merge conflicts

* improve test
  • Loading branch information
PythonFZ authored Oct 18, 2022
1 parent 0293044 commit 14d18c4
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 6 deletions.
53 changes: 53 additions & 0 deletions tests/integration_tests/test_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import pathlib
import subprocess

import pytest
import yaml

import zntrack


class NodeWithMeta(zntrack.Node):
author = zntrack.meta.Text("Fabian")
title = zntrack.meta.Text("Test Node")


def test_NodeWithMeta(proj_path):
NodeWithMeta().write_graph()

node_w_meta = NodeWithMeta.load()
assert node_w_meta.author == "Fabian"

dvc_yaml = yaml.safe_load(pathlib.Path("dvc.yaml").read_text())
assert dvc_yaml["stages"]["NodeWithMeta"]["meta"] == {
"author": "Fabian",
"title": "Test Node",
}


class CombinedNodeWithMeta(zntrack.Node):
input: str = zntrack.zn.params("Hello ")
output: str = zntrack.zn.outs()
author: str = zntrack.meta.Text()

def run(self):
self.output = self.input + self.author


def test_CombinedNodeWithMeta(proj_path):
with pytest.raises(TypeError):
# should raise an error because author is missing as kwarg
_ = CombinedNodeWithMeta()

CombinedNodeWithMeta(author="World").write_graph(run=True)
assert CombinedNodeWithMeta.load().output == "Hello World"
assert CombinedNodeWithMeta.load().author == "World"

CombinedNodeWithMeta(author="there").write_graph(run=True)
# changing the 'meta.Text' should not trigger running the model again
assert CombinedNodeWithMeta.load().output == "Hello World"
assert CombinedNodeWithMeta.load().author == "there"

subprocess.check_call(["dvc", "repro", "-f"])
# Forcing rerun should use the updated meta keyword.
assert CombinedNodeWithMeta.load().output == "Hello there"
35 changes: 35 additions & 0 deletions tests/unit_tests/utils/test_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,38 @@ def pathlib_open(*args, **kwargs):
open_mock().write.assert_called_once_with(yaml.safe_dump(dvc_dict, indent=4))
else:
assert not open_mock().called


@pytest.mark.parametrize("data", ({"author": "Fabian"}, None))
def test_update_meta(data):
dvc_dict = {"stages": {"MyNode": {"cmd": "run", "meta": {"a": "b"}}}}

open_mock = mock_open(read_data=yaml.safe_dump(dvc_dict))

def pathlib_open(*args, **kwargs):
return open_mock(*args, **kwargs)

file = pathlib.Path("dvc.yaml")

with patch.object(pathlib.Path, "open", pathlib_open):
file_io.update_meta(file=file, node_name="MyNode", data=data)

if data is not None:
dvc_dict["stages"]["MyNode"]["meta"].update(data)
open_mock().write.assert_called_once_with(yaml.safe_dump(dvc_dict, indent=4))
else:
assert not open_mock().called


def test_update_meta_existing():
dvc_dict = {"stages": {"MyNode": {"meta": "not a dict"}}}
open_mock = mock_open(read_data=yaml.safe_dump(dvc_dict))

def pathlib_open(*args, **kwargs):
return open_mock(*args, **kwargs)

file = pathlib.Path("dvc.yaml")

with patch.object(pathlib.Path, "open", pathlib_open):
with pytest.raises(ValueError):
file_io.update_meta(file=file, node_name="MyNode", data={"a": "b"})
10 changes: 7 additions & 3 deletions zntrack/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import zninit
import znjson

from zntrack import dvc, utils, zn
from zntrack import dvc, meta, utils, zn
from zntrack.core.dvcgraph import (
DVCRunOptions,
ZnTrackInfo,
Expand Down Expand Up @@ -195,7 +195,7 @@ class Node(NodeBase, metaclass=LoadViaGetItem):
"""

init_subclass_basecls = NodeBase
init_descriptors = [zn.params, zn.deps, zn.Method, zn.Nodes] + dvc.options
init_descriptors = [zn.params, zn.deps, zn.Method, zn.Nodes, meta.Text] + dvc.options

@utils.deprecated(
reason=(
Expand Down Expand Up @@ -283,7 +283,7 @@ def save(self, results: bool = False, hash_only: bool = False):
# only save results
option.save(instance=self)
else:
if option.zn_type not in utils.VALUE_DVC_TRACKED:
if option.zn_type not in utils.VALUE_DVC_TRACKED + utils.GIT_TRACKED:
# save all dvc.<options>
option.save(instance=self)
else:
Expand Down Expand Up @@ -591,6 +591,10 @@ def write_graph(

run_post_dvc_cmd(descriptor_list=self._descriptor_list, instance=self)

for option in self._descriptor_list:
if option.zn_type in utils.GIT_TRACKED:
option.save(instance=self)

if write_desc:
utils.file_io.update_desc(
file=utils.Files.dvc, node_name=self.node_name, desc=self.__doc__
Expand Down
51 changes: 51 additions & 0 deletions zntrack/meta/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""ZnTrack Node meta data __init__
Collection of Nodes that allow the storage of data inside a Node that is neither a true
parameter but also not an output. This can be e.g. information about the user, some
description but also e.g. different paths to binaries that should be used.
In principle, it is advisable to add the binary as a direct dependency but often
this is not feasible and can be circumvented by using 'meta'.
"""
import pathlib

from zntrack import utils
from zntrack.core.zntrackoption import ZnTrackOption


class Text(ZnTrackOption):
"""ZnTrack Text based meta descriptor
This ZnTrackOption allows the storage of plain text data in the 'dvc.yaml' meta key.
"""

zn_type = utils.ZnTypes.META
file = utils.Files.dvc
dvc_option = utils.DVCOptions.PARAMS

def get_filename(self, instance) -> pathlib.Path:
return

def mkdir(self, instance):
return

def get_data_from_files(self, instance):
try:
file_content = utils.file_io.read_file(self.file)
except FileNotFoundError as err:
raise self._get_loading_errors(instance) from err

try:
values = file_content["stages"][instance.node_name]["meta"][self.name]
except KeyError as err:
raise self._get_loading_errors(instance) from err
return values

def save(self, instance):
if instance.__dict__.get(self.name) is utils.LazyOption:
# do not save anything if __get__/__set__ was never used
return
utils.file_io.update_meta(
file=utils.Files.dvc,
node_name=instance.node_name,
data={self.name: getattr(instance, self.name)},
)
2 changes: 2 additions & 0 deletions zntrack/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from zntrack.utils.nwd import nwd
from zntrack.utils.structs import (
FILE_DVC_TRACKED,
GIT_TRACKED,
VALUE_DVC_TRACKED,
DVCOptions,
LazyOption,
Expand Down Expand Up @@ -45,4 +46,5 @@
"LazyOption",
"helpers",
"nwd",
"GIT_TRACKED",
]
15 changes: 15 additions & 0 deletions zntrack/utils/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,18 @@ def update_desc(file: pathlib.Path, node_name: str, desc: str):
file_content = read_file(file)
file_content["stages"][node_name]["desc"] = desc
write_file(file, value=file_content)


def update_meta(file: pathlib.Path, node_name: str, data: dict):
"""Update the file (dvc.yaml) given the Node for 'meta' key with the data"""
if data is not None:
file_content = read_file(file)
meta_data = file_content["stages"][node_name].get("meta", {})
if not isinstance(meta_data, dict):
raise ValueError(
"The 'meta' key in the 'dvc.yaml' is not empty or was otherwise modified."
" To use 'zntrack.meta' it is not possible to use that field otherwise."
)
meta_data.update(data)
file_content["stages"][node_name]["meta"] = meta_data
write_file(file, value=file_content)
11 changes: 8 additions & 3 deletions zntrack/utils/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,22 @@ class ZnTypes(enum.Enum):
RESULTS = enum.auto()
PLOTS = enum.auto()
HASH = enum.auto()
META = enum.auto()


FILE_DVC_TRACKED = (ZnTypes.DVC,)
FILE_DVC_TRACKED = [ZnTypes.DVC]
# if the getattr(instance, self.name) is an affected file,
# e.g. the dvc.<outs> is a file / list of files
VALUE_DVC_TRACKED = (

VALUE_DVC_TRACKED = [
ZnTypes.RESULTS,
ZnTypes.METADATA,
ZnTypes.PLOTS,
ZnTypes.HASH,
)
]

# The data is not tracked / used via any DVC command
GIT_TRACKED = [ZnTypes.META]


# if the internal file,
Expand Down

21 comments on commit 14d18c4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000212603 0.000594808 0.000245664 6.17857e-05 0.000220153 2.7401e-05 8;16 4070.59 90 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000827811 0.000999414 0.00084025 1.34391e-05 0.000835961 1.1399e-05 45;14 1190.12 510 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000827914 0.00114112 0.000842243 2.77402e-05 0.000835614 1.0801e-05 9;16 1187.31 490 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00141362 0.00239143 0.001457 0.000121906 0.00143042 1.73e-05 19;20 686.343 363 1
4 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00146912 0.00433116 0.0015304 0.000130861 0.00150992 4.56262e-05 12;46 653.424 545 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00159562 0.00286114 0.00165844 0.000159104 0.00161542 2.04735e-05 28;48 602.978 379 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00619919 0.00951453 0.00656031 0.000420094 0.00644934 0.000224054 5;6 152.432 100 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.22634 1.35573 1.28147 0.053363 1.28999 0.0841072 2;0 0.780353 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000320124 0.00238857 0.000546437 0.00031743 0.000435282 0.000206115 8;6 1830.04 68 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00090347 0.0012746 0.0011241 2.93088e-05 0.00112354 2.1301e-05 75;45 889.602 490 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000958874 0.00314134 0.00114336 0.000123578 0.00112814 2.71525e-05 14;68 874.615 424 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00169733 0.0088946 0.00215489 0.000597402 0.00203786 0.000199417 15;18 464.06 315 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00170084 0.00218917 0.00193487 4.16413e-05 0.00193965 2.5902e-05 55;45 516.832 356 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00176494 0.0386076 0.0021146 0.00178518 0.00184745 0.000167313 12;62 472.902 487 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00750719 0.306509 0.0196086 0.051737 0.00807124 0.000838267 1;7 50.998 34 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.39025 1.44411 1.41282 0.0223773 1.40183 0.0344338 2;0 0.707806 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000300516 0.000560531 0.000350498 6.58441e-05 0.000317018 5.36027e-05 15;9 2853.08 79 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000840547 0.00131167 0.00101627 2.90156e-05 0.00101406 2.0701e-05 108;65 983.989 753 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.00090395 0.00191351 0.00104609 9.40739e-05 0.00102846 2.4801e-05 42;79 955.937 720 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00156559 0.00204081 0.00170951 3.85249e-05 0.0017109 2.5401e-05 47;33 584.963 350 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00163649 0.00369891 0.00183971 0.00021366 0.0017864 0.000136107 27;25 543.563 450 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.0017493 0.00429014 0.00185266 0.000148366 0.001825 5.5203e-05 23;53 539.766 624 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00326438 0.005295 0.00355677 0.000286932 0.0034851 0.000211637 22;17 281.154 231 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.37557 1.7913 1.52006 0.166198 1.51588 0.201788 1;0 0.657868 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000316823 0.00384478 0.000424881 0.000425422 0.000354926 6.07045e-05 1;7 2353.6 68 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00103608 0.00127889 0.00112867 3.27989e-05 0.00112908 2.4701e-05 84;53 886.001 494 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.00104838 0.00155601 0.00115814 7.18194e-05 0.00113478 3.3203e-05 49;56 863.45 402 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00178228 0.00202871 0.00192603 3.68571e-05 0.00193315 2.5302e-05 67;43 519.204 346 1
4 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00178413 0.183363 0.00278245 0.0113478 0.00188744 5.5304e-05 3;45 359.395 488 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00179673 0.00222506 0.00193771 4.09173e-05 0.00194414 2.6952e-05 65;46 516.073 325 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00704541 0.0140114 0.00758122 0.000742171 0.00745744 0.000334924 3;5 131.905 93 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.45331 1.94364 1.65254 0.231666 1.5103 0.400674 1;0 0.605128 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000298603 0.00266423 0.000668305 0.000470774 0.000502305 0.000447105 9;5 1496.32 82 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000923111 0.00127671 0.00101335 2.09326e-05 0.00101136 1.9199e-05 113;40 986.822 746 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00093501 0.0088585 0.00111706 0.000444468 0.00103436 7.7701e-05 25;64 895.209 750 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00137541 0.00310143 0.00167222 0.000116347 0.00169276 9.77e-05 14;4 598.007 294 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00157012 0.00186743 0.0017075 3.4311e-05 0.00171172 2.36015e-05 67;46 585.651 403 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00168302 0.0368012 0.00206125 0.00188807 0.00180302 0.000159702 11;69 485.144 622 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00329854 0.03654 0.00403073 0.00246445 0.00362374 0.000348804 6;25 248.094 232 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.31056 1.48231 1.3839 0.0731963 1.37059 0.125918 2;0 0.722597 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000341602 0.0011992 0.000549556 0.000164983 0.000497202 0.000152551 13;5 1819.65 63 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000897404 0.00348861 0.00117779 0.000238059 0.00112781 0.000245427 100;18 849.046 581 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000970804 0.00433332 0.00131762 0.000305096 0.00124061 0.000247376 36;16 758.942 369 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.0015809 0.00491761 0.00206651 0.000349756 0.00201581 0.000367801 62;13 483.906 325 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00160661 0.00513312 0.00209423 0.000330571 0.00206626 0.000339651 76;8 477.501 352 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00168661 0.00684273 0.00230663 0.000634882 0.00215431 0.000361202 28;29 433.532 433 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00632943 0.0113463 0.00773189 0.000926621 0.00757138 0.000880605 23;7 129.334 114 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.48787 1.57661 1.5272 0.0351708 1.51652 0.0530377 2;0 0.654795 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000295211 0.00189687 0.000474878 0.000316217 0.000354514 0.000147106 5;8 2105.8 76 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000905537 0.00120625 0.00104794 7.47209e-05 0.00105774 0.000111904 216;0 954.252 544 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000906037 0.00124685 0.00105302 7.18617e-05 0.00105884 9.5454e-05 184;0 949.651 500 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00152744 0.00231246 0.00176169 0.000127565 0.0017739 0.000196506 128;1 567.635 358 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00154356 0.00196268 0.00182554 8.30618e-05 0.00183037 0.000101104 69;7 547.783 235 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00160057 0.00508481 0.00178186 0.000202025 0.00175142 8.9004e-05 23;28 561.212 522 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00675138 0.0103174 0.00737228 0.000498493 0.00728341 0.000310488 6;4 135.643 83 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.27672 1.32774 1.3014 0.0183483 1.29972 0.0195502 2;0 0.768405 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000315307 0.00344627 0.000608589 0.000489413 0.00046706 0.000338957 6;6 1643.15 80 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000919122 0.00559833 0.00102313 0.000203882 0.00100312 3.0201e-05 13;109 977.392 646 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000935522 0.00202135 0.00102398 5.64875e-05 0.00101812 1.99508e-05 12;21 976.582 483 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00160574 0.00312037 0.00172196 0.000115286 0.00171014 2.05753e-05 5;11 580.734 293 1
4 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00163634 0.00552903 0.00195377 0.000401379 0.00182244 0.000128127 58;90 511.831 593 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00165124 0.00305637 0.00171523 8.16537e-05 0.00170934 2.27992e-05 2;6 583.014 293 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00327588 0.00643645 0.00352147 0.000423243 0.00341188 0.000136403 8;20 283.972 186 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.36888 1.51235 1.43722 0.0529938 1.43228 0.0675569 2;0 0.695789 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000288804 0.000984114 0.000409012 0.000138629 0.000380155 0.000158302 7;4 2444.92 62 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00105852 0.00239343 0.001207 0.000150976 0.00116222 8.18768e-05 24;26 828.497 447 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.00106592 0.00128602 0.00113887 1.97817e-05 0.00113582 2.1e-05 72;19 878.061 478 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00179733 0.0679664 0.00223306 0.00340685 0.00194808 6.2101e-05 5;65 447.816 386 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00180833 0.00219643 0.001959 2.36965e-05 0.00195703 1.97e-05 38;14 510.464 349 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00186293 0.00428116 0.00200044 0.00018662 0.00196793 2.76243e-05 8;29 499.889 231 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00775191 0.262218 0.0120614 0.0267576 0.00848132 0.000880409 2;7 82.909 94 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.45766 1.57704 1.49343 0.0494679 1.47326 0.058478 1;0 0.6696 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000270403 0.000650907 0.000311052 6.79695e-05 0.000283303 3.405e-05 10;12 3214.9 80 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00095111 0.00104441 0.000967581 1.31194e-05 0.00096261 1.72243e-05 121;8 1033.5 509 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.00095521 0.00130751 0.000974554 2.74036e-05 0.000967011 2.05e-05 22;11 1026.11 494 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00157011 0.00532753 0.00165563 0.000172529 0.00163121 4.9375e-05 11;53 603.998 537 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00163061 0.00183021 0.00165939 1.97243e-05 0.00165531 2.3401e-05 39;6 602.632 348 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00163852 0.00179222 0.00166687 1.9436e-05 0.00166292 2.24505e-05 63;9 599.928 313 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00727864 0.00927485 0.0080708 0.000395401 0.00803059 0.000450603 30;6 123.903 112 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.23253 1.64569 1.34737 0.169885 1.27499 0.148881 1;1 0.742187 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000238503 0.000671309 0.000320364 8.68788e-05 0.000289104 4.55e-05 9;11 3121.45 79 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000797111 0.00144632 0.00100095 0.000116765 0.000996213 0.000174302 158;3 999.056 431 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000799011 0.00132302 0.00106122 9.88109e-05 0.00107691 0.000136002 157;5 942.315 475 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00136482 0.00249833 0.0018429 0.000156814 0.00186927 0.000162902 70;20 542.622 298 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00137032 0.00232953 0.00181897 0.000168221 0.00183327 0.000225703 118;1 549.763 374 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00157312 0.0645694 0.00230732 0.00448218 0.00190407 0.000101601 4;20 433.402 498 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00604952 0.00804592 0.00687401 0.00035206 0.00686002 0.000443579 31;1 145.475 103 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.28833 1.84654 1.53222 0.237179 1.55544 0.403258 2;0 0.652649 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000279311 0.000914236 0.000372057 0.000106242 0.000321613 7.97033e-05 13;9 2687.76 79 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000940235 0.00126625 0.00102744 2.60312e-05 0.00102239 1.7701e-05 43;25 973.29 632 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000966336 0.00285411 0.00108768 0.000179261 0.00102214 2.93007e-05 66;94 919.386 547 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00138856 0.00505071 0.00179212 0.000273828 0.00171742 4.0601e-05 45;121 557.998 494 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00152936 0.00676606 0.00186844 0.000423373 0.00175777 0.000168206 20;31 535.207 413 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00174997 0.0136816 0.00229811 0.0010507 0.00202418 0.000390415 36;61 435.141 598 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00337864 0.0144002 0.00412269 0.00105166 0.00375695 0.000885461 29;13 242.56 241 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.38333 1.57197 1.43733 0.0785199 1.40879 0.0874867 1;0 0.695737 5 1

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000226597 0.000801592 0.000264055 8.26114e-05 0.000232648 2.74e-05 6;12 3787.08 84 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000870292 0.00097699 0.000885555 1.14538e-05 0.000881692 1.05e-05 66;25 1129.23 558 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00087599 0.00187838 0.000902174 7.89899e-05 0.000886591 1.545e-05 13;32 1108.43 360 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00138438 0.0489507 0.00154551 0.00196205 0.00144798 4.65998e-05 1;48 647.034 587 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00153588 0.00184318 0.00155957 2.39287e-05 0.00155478 1.5175e-05 16;15 641.204 407 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00153618 0.00164418 0.00156058 1.24048e-05 0.00155858 1.44497e-05 101;8 640.786 409 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.0058952 0.143343 0.0234488 0.0314251 0.006084 0.0406756 16;3 42.6462 122 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.24053 1.30501 1.26026 0.0268528 1.24588 0.032172 1;0 0.79349 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000217809 0.000544221 0.000248456 5.5562e-05 0.000224358 2.94005e-05 11;11 4024.86 84 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000865934 0.00100314 0.000878047 1.0553e-05 0.000874534 9.7e-06 73;21 1138.89 590 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000869034 0.000963938 0.000883488 1.00809e-05 0.000880235 1.0651e-05 93;17 1131.88 584 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00133595 0.00370675 0.00141693 0.00010566 0.00140256 4.4652e-05 24;38 705.749 585 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00152756 0.00168787 0.00154959 1.55034e-05 0.00154746 1.54267e-05 54;11 645.332 421 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00153576 0.00172747 0.00155883 1.46406e-05 0.00155726 1.66008e-05 79;7 641.508 423 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00583443 0.00692387 0.00599663 0.000120076 0.00597584 9.13537e-05 12;7 166.76 123 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.23325 1.47494 1.38163 0.0896304 1.40368 0.0811269 2;0 0.723785 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000385402 0.00406642 0.000672707 0.000433562 0.000603253 0.000326601 2;2 1486.53 80 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000919602 0.00701861 0.00116735 0.000414489 0.0010829 0.000141576 37;72 856.641 733 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000923602 0.0127024 0.00117186 0.000751353 0.00107975 7.82505e-05 13;83 853.344 744 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00151481 0.00512313 0.00179186 0.000302213 0.00175401 0.000192526 27;24 558.078 521 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00153661 0.00423482 0.0018421 0.000303186 0.00179751 0.000171726 24;22 542.858 495 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.0018897 0.110484 0.00278697 0.00569796 0.00223571 0.000404205 5;18 358.813 542 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00351721 0.133195 0.00513534 0.00975234 0.00392689 0.000665928 3;14 194.729 181 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.52869 1.88741 1.66627 0.135501 1.63124 0.149702 2;0 0.600144 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.0001979 0.000515099 0.000218879 4.75781e-05 0.0002019 1.28e-05 9;12 4568.74 95 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.0008066 0.000896899 0.000818676 8.26694e-06 0.0008161 7.65e-06 195;49 1221.48 915 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000807999 0.000924 0.000821162 8.88629e-06 0.000818899 8.4e-06 166;35 1217.79 886 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.001212 0.0036476 0.00129038 0.000106228 0.0012697 6.795e-05 39;24 774.963 785 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00138929 0.00149359 0.00140632 1.0747e-05 0.00140489 1.325e-05 143;13 711.076 592 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00139419 0.00156429 0.00141328 1.30421e-05 0.00141089 1.47757e-05 115;9 707.574 587 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.0025603 0.0030041 0.00267531 6.81292e-05 0.00266685 8.16995e-05 77;8 373.789 288 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.12438 1.15577 1.14129 0.0141491 1.14375 0.026196 2;0 0.876203 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000265702 0.000581605 0.000328186 8.05024e-05 0.000298652 8.6802e-05 10;6 3047.05 82 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000944316 0.00116112 0.000960348 2.22593e-05 0.000954316 1.58003e-05 18;16 1041.29 495 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000945816 0.00116552 0.000960221 1.42357e-05 0.000956317 1.37505e-05 50;10 1041.43 484 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00148773 0.0592185 0.00170172 0.00254565 0.00153198 5.35515e-05 3;39 587.642 560 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00161343 0.00221034 0.00163987 5.06702e-05 0.00163243 1.69e-05 10;13 609.803 366 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00161803 0.006087 0.00166286 0.000223815 0.00164063 2.1801e-05 6;29 601.372 414 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.0061066 0.00753423 0.00646314 0.000233593 0.00642821 0.000280705 28;2 154.724 113 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.20702 1.26691 1.22951 0.0237105 1.23008 0.0308602 1;0 0.813333 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000375802 0.00122251 0.000632354 0.000215688 0.000568353 0.000284351 21;2 1581.39 68 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000974906 0.00367222 0.00123418 0.000210178 0.00122321 0.000233603 47;2 810.256 346 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00100901 0.00201771 0.00126083 0.000121702 0.00123171 0.000132201 92;15 793.126 438 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00166431 0.00675544 0.00209135 0.00037334 0.00205251 0.000306603 16;2 478.16 306 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00166501 0.00941046 0.00208726 0.000554165 0.00201276 0.000304103 12;12 479.097 330 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00184411 0.00548173 0.00236033 0.000352632 0.00228876 0.000286402 64;24 423.67 486 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00758715 0.0127889 0.00933731 0.000921045 0.00919166 0.00104861 26;3 107.097 103 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.56156 1.73201 1.63677 0.0616859 1.62904 0.0627069 2;0 0.61096 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000236802 0.00183382 0.000473454 0.00032344 0.000338104 0.000260604 13;7 2112.14 95 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00084231 0.00172532 0.000880435 6.25063e-05 0.000861361 2.245e-05 53;68 1135.8 584 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000847208 0.00108301 0.000862848 1.91706e-05 0.000858109 1.205e-05 32;24 1158.95 675 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00141431 0.00832718 0.00155383 0.000361532 0.00147401 0.000107902 31;49 643.571 637 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00141811 0.00165632 0.00143828 1.54153e-05 0.00143546 1.6901e-05 41;3 695.276 478 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00141851 0.00225222 0.00144602 4.6591e-05 0.00144016 1.7201e-05 8;10 691.554 466 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00275643 0.00399604 0.00295076 0.000211213 0.00287923 0.000144702 26;22 338.896 214 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.2107 1.25845 1.23369 0.0232105 1.22547 0.044199 2;0 0.810579 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000247901 0.000530103 0.000323215 6.05891e-05 0.000291801 6.2726e-05 15;6 3093.91 81 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000951205 0.00113001 0.000966756 1.51503e-05 0.000962405 1.45e-05 59;13 1034.39 578 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000952305 0.0011032 0.000967169 1.34718e-05 0.000963105 1.49252e-05 71;6 1033.95 555 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00158871 0.0617019 0.00178406 0.00253538 0.00166351 4.41255e-05 1;42 560.52 561 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00162131 0.00190161 0.00165162 4.27905e-05 0.00164291 1.76242e-05 15;20 605.466 405 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00162451 0.00178131 0.00164995 1.64645e-05 0.00164676 1.9e-05 64;7 606.08 346 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00622803 0.00840174 0.00673743 0.000348121 0.00666658 0.000426852 27;1 148.425 104 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.27277 1.33203 1.29533 0.0271176 1.27893 0.0450732 1;0 0.772004 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.0003579 0.0017936 0.000678633 0.000187965 0.000675001 6.79e-05 15;17 1473.55 72 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.00101222 0.00410297 0.00117027 0.000283648 0.00110242 0.000148353 26;27 854.505 568 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00102322 0.00742633 0.00118 0.000355493 0.00113207 0.000106152 8;18 847.459 464 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00182393 0.00319536 0.00198078 0.000159351 0.00194873 0.000125752 20;17 504.853 315 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00182813 0.00308185 0.00198795 0.000137267 0.00197218 0.000116502 62;17 503.03 386 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00192473 0.00595991 0.00240716 0.000381607 0.00237284 0.000344582 63;15 415.427 419 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00686152 0.0116165 0.00771573 0.000727191 0.00754753 0.000696113 17;6 129.605 114 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.42352 1.8178 1.53366 0.162118 1.45983 0.143564 1;1 0.652033 5 1

Please sign in to comment.