diff --git a/pyproject.toml b/pyproject.toml index f594c5d541c3..d350ef8b96c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,7 +79,7 @@ test = [ "PyVisa-sim>=0.6.0", "sphinx>=4.5.0", # sphinx extension tests "types-jsonschema>=4.16.0", - "types-networkx >= 3.6.1.20260303", # minimum version required for correct edge_subgraph types + "types-networkx >= 3.6.1.20260512", # minimum version required for generic data types in graph "types_requests>=0.1.8", "types-tabulate>=0.1.0", "types-tqdm>=4.64.6", diff --git a/requirements.txt b/requirements.txt index 9096578226b4..b83287c8b60d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -456,7 +456,7 @@ traitlets==5.15.0 # nbsphinx types-jsonschema==4.26.0.20260508 # via qcodes (pyproject.toml) -types-networkx==3.6.1.20260508 +types-networkx==3.6.1.20260512 # via qcodes (pyproject.toml) types-pywin32==311.0.0.20260508 # via qcodes (pyproject.toml) diff --git a/src/qcodes/dataset/descriptions/dependencies.py b/src/qcodes/dataset/descriptions/dependencies.py index 43c374c57036..35be8cb36002 100644 --- a/src/qcodes/dataset/descriptions/dependencies.py +++ b/src/qcodes/dataset/descriptions/dependencies.py @@ -53,7 +53,9 @@ def __init__( inferences: ParamSpecTree | None = None, standalones: tuple[ParamSpecBase, ...] = (), ): - self._graph: nx.DiGraph[str] = nx.DiGraph() + self._graph: nx.DiGraph[str, dict[str, ParamSpecBase], dict[str, str]] = ( + nx.DiGraph() + ) self.add_dependencies(dependencies) self.add_inferences(inferences) self.add_standalones(standalones) @@ -260,7 +262,9 @@ def paramspecs(self) -> tuple[ParamSpecBase, ...]: """ Return the ParamSpecBase objects of this instance """ - return tuple(paramspec for _, paramspec in self.graph.nodes(data="value")) + return tuple( + paramspec_dict["value"] for _, paramspec_dict in self.graph.nodes(data=True) + ) @property def top_level_parameters(self) -> tuple[ParamSpecBase, ...]: @@ -355,7 +359,7 @@ def __getitem__(self, name: str) -> ParamSpecBase: return self._node_to_paramspec(name) @property - def graph(self) -> nx.DiGraph[str]: + def graph(self) -> nx.DiGraph[str, dict[str, ParamSpecBase], dict[str, str]]: return self._graph def to_ipycytoscape_json(self) -> dict[str, list[dict[str, Any]]]: