Skip to content

Commit

Permalink
Fix tracer period type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Sep 13, 2022
1 parent f785f78 commit 1020c25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions openfisca_core/tracers/full_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ def __init__(self) -> None:
def record_calculation_start(
self,
variable: str,
period: Period,
period: str,
) -> None:
self._simple_tracer.record_calculation_start(variable, period)
self.enter_calculation(variable, period)
self.record_start_time()

def enter_calculation(self, variable: str, period: Period) -> None:
def enter_calculation(self, variable: str, period: str) -> None:
new_node = tracers.TraceNode(
name = variable,
period = period,
Expand All @@ -53,7 +53,7 @@ def enter_calculation(self, variable: str, period: Period) -> None:
def record_parameter_access(
self,
parameter: str,
period: Period,
period: str,
value: ArrayLike,
) -> None:

Expand Down
2 changes: 1 addition & 1 deletion openfisca_core/tracers/simple_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SimpleTracer:
def __init__(self) -> None:
self._stack = []

def record_calculation_start(self, variable: str, period: Period) -> None:
def record_calculation_start(self, variable: str, period: str) -> None:
self.stack.append({'name': variable, 'period': period})

def record_calculation_result(self, value: ArrayLike) -> None:
Expand Down
2 changes: 1 addition & 1 deletion openfisca_core/tracers/trace_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@dataclasses.dataclass
class TraceNode:
name: str
period: Period
period: str
parent: typing.Optional[TraceNode] = None
children: typing.List[TraceNode] = dataclasses.field(default_factory = list)
parameters: typing.List[TraceNode] = dataclasses.field(default_factory = list)
Expand Down

0 comments on commit 1020c25

Please sign in to comment.