diff --git a/bw_graph_tools/graph_traversal.py b/bw_graph_tools/graph_traversal.py index 9cb3537..820a5bc 100644 --- a/bw_graph_tools/graph_traversal.py +++ b/bw_graph_tools/graph_traversal.py @@ -2,6 +2,7 @@ from dataclasses import dataclass from functools import lru_cache from heapq import heappop, heappush +from typing import Optional from bw2calc import LCA from scipy.sparse import spmatrix @@ -176,13 +177,13 @@ class NewNodeEachVisitGraphTraversal: def calculate( cls, lca_object: LCA, - cutoff: float | None = 5e-3, - biosphere_cutoff: float | None = 1e-4, - max_calc: int | None = 1e5, - skip_coproducts: bool | None = False, - separate_biosphere_flows: bool | None = True, - static_activity_indices: set[int] | None = set(), - functional_unit_unique_id: int | None = -1, + cutoff: Optional[float] = 5e-3, + biosphere_cutoff: Optional[float] = 1e-4, + max_calc: Optional[int] = 10000, + skip_coproducts: Optional[bool] = False, + separate_biosphere_flows: Optional[bool] = True, + static_activity_indices: Optional[set[int]] = set(), + functional_unit_unique_id: Optional[int] = -1, ) -> dict: """ Priority-first traversal (i.e. follow the past of highest score) of the supply chain graph. This class unrolls diff --git a/bw_graph_tools/testing.py b/bw_graph_tools/testing.py index daf15e7..1d81964 100644 --- a/bw_graph_tools/testing.py +++ b/bw_graph_tools/testing.py @@ -1,10 +1,11 @@ from numbers import Number +from typing import Union import numpy as np from . import Node, Edge, Flow -def equal_dict(a: Node | Edge | Flow, b: dict, fields: list[str]): +def equal_dict(a: Union[Node, Edge, Flow], b: dict, fields: list[str]): for field in fields: if field in b: if isinstance(b[field], Number):