Skip to content

Commit

Permalink
ref: (minor) swap if logic
Browse files Browse the repository at this point in the history
  • Loading branch information
leclairm committed Feb 11, 2025
1 parent c5022b5 commit 561a5a8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/sirocco/core/graph_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,8 @@ def __getitem__(self, key: tuple[str, dict]) -> GRAPH_ITEM_T:
return self._dict[name][coordinates]

def iter_from_cycle_spec(self, spec: TargetNodesBaseModel, ref_coordinates: dict) -> Iterator[GRAPH_ITEM_T]:
if not spec.when.is_active(ref_coordinates.get("date")):
return
yield from self._dict[spec.name].iter_from_cycle_spec(spec, ref_coordinates)
if spec.when.is_active(ref_coordinates.get("date")):
yield from self._dict[spec.name].iter_from_cycle_spec(spec, ref_coordinates)

def __iter__(self) -> Iterator[GRAPH_ITEM_T]:
yield from chain(*(self._dict.values()))

0 comments on commit 561a5a8

Please sign in to comment.