Skip to content
Merged

Format #1333

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

### 43.3.10 [#1333](https://github.com/openfisca/openfisca-core/pull/1332)

#### Technical changes

- Applying make format to the codebase
- This is a follow-up of the previous PR, which was not applied correctly.
- The codebase is now formatted with `black` and `isort`.

### 43.3.9 [#1332](https://github.com/openfisca/openfisca-core/pull/1332)

#### New features
Expand Down
2 changes: 0 additions & 2 deletions openfisca_core/data_storage/on_disk_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ def get_known_periods(self) -> KeysView[t.Period]:
Examples:
>>> import tempfile

>>> import numpy

>>> from openfisca_core import data_storage, periods

>>> instant = periods.Instant((2017, 1, 1))
Expand Down
2 changes: 0 additions & 2 deletions openfisca_core/indexed_enums/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ def _str_to_index(
The index array.

Examples:
>>> from array import array

>>> import numpy

>>> from openfisca_core import indexed_enums as enum
Expand Down
36 changes: 36 additions & 0 deletions openfisca_core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ class CoreEntity(Protocol):
plural: EntityPlural

def check_role_validity(self, role: object, /) -> None: ...

def check_variable_defined_for_entity(
self,
variable_name: VariableName,
/,
) -> None: ...

def get_variable(
self,
variable_name: VariableName,
Expand All @@ -158,6 +160,7 @@ class Role(Protocol):

@property
def key(self, /) -> RoleKey: ...

@property
def plural(self, /) -> None | RolePlural: ...

Expand Down Expand Up @@ -190,6 +193,7 @@ def __new__(

class Holder(Protocol):
def clone(self, population: CorePopulation, /) -> Holder: ...

def get_memory_usage(self, /) -> MemoryUsage: ...


Expand Down Expand Up @@ -218,6 +222,7 @@ class ParameterNodeAtInstant(Protocol):
_instant_str: InstantStr

def __contains__(self, __item: object, /) -> bool: ...

def __getitem__(
self, __index: str | Array[DTypeGeneric], /
) -> ParameterNodeChild: ...
Expand All @@ -227,6 +232,7 @@ class VectorialParameterNodeAtInstant(Protocol):
_instant_str: InstantStr

def __contains__(self, item: object, /) -> bool: ...

def __getitem__(
self, __index: str | Array[DTypeGeneric], /
) -> ParameterNodeChild: ...
Expand Down Expand Up @@ -302,27 +308,38 @@ def upper(self, /) -> str: ...
class Instant(Indexable[int], Iterable[int], Sized, Protocol):
@property
def year(self, /) -> int: ...

@property
def month(self, /) -> int: ...

@property
def day(self, /) -> int: ...

@property
def date(self, /) -> pendulum.Date: ...

def __lt__(self, __other: object, /) -> bool: ...

def __le__(self, __other: object, /) -> bool: ...

def offset(self, __offset: str | int, __unit: DateUnit, /) -> None | Instant: ...


class Period(Indexable[Union[DateUnit, Instant, int]], Protocol):
@property
def unit(self, /) -> DateUnit: ...

@property
def start(self, /) -> Instant: ...

@property
def size(self, /) -> int: ...

@property
def stop(self, /) -> Instant: ...

def contains(self, __other: Period, /) -> bool: ...

def offset(
self, __offset: str | int, __unit: None | DateUnit = None, /
) -> Period: ...
Expand Down Expand Up @@ -353,12 +370,15 @@ class Simulation(Protocol):
def calculate(
self, variable_name: VariableName, period: Period, /
) -> Array[DTypeGeneric]: ...

def calculate_add(
self, variable_name: VariableName, period: Period, /
) -> Array[DTypeGeneric]: ...

def calculate_divide(
self, variable_name: VariableName, period: Period, /
) -> Array[DTypeGeneric]: ...

def get_population(self, plural: None | str, /) -> CorePopulation: ...


Expand Down Expand Up @@ -418,49 +438,65 @@ def print_log(self, __aggregate: bool = ..., __max_depth: int = ..., /) -> None:

class FlatTrace(Protocol):
def get_trace(self, /) -> FlatNodeMap: ...

def get_serialized_trace(self, /) -> SerializedNodeMap: ...


class FullTracer(Protocol):
@property
def trees(self, /) -> list[TraceNode]: ...

def browse_trace(self, /) -> Iterator[TraceNode]: ...

def get_nb_requests(self, __name: VariableName, /) -> int: ...


class PerformanceLog(Protocol):
def generate_graph(self, __dir_path: str, /) -> None: ...

def generate_performance_tables(self, __dir_path: str, /) -> None: ...


class SimpleTracer(Protocol):
@property
def stack(self, /) -> SimpleStack: ...

def record_calculation_start(
self, __name: VariableName, __period: PeriodInt | Period, /
) -> None: ...

def record_calculation_end(self, /) -> None: ...


class TraceNode(Protocol):
@property
def children(self, /) -> list[TraceNode]: ...

@property
def end(self, /) -> Time: ...

@property
def name(self, /) -> str: ...

@property
def parameters(self, /) -> list[TraceNode]: ...

@property
def parent(self, /) -> None | TraceNode: ...

@property
def period(self, /) -> PeriodInt | Period: ...

@property
def start(self, /) -> Time: ...

@property
def value(self, /) -> None | VarArray: ...

def calculation_time(self, *, __round: bool = ...) -> Time: ...

def formula_time(self, /) -> Time: ...

def append_child(self, __node: TraceNode, /) -> None: ...


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

setup(
name="OpenFisca-Core",
version="43.3.9",
version="43.3.10",
author="OpenFisca Team",
author_email="contact@openfisca.org",
classifiers=[
Expand Down
Loading