Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Sep 24, 2024
1 parent 2f8072f commit e1c05d6
Show file tree
Hide file tree
Showing 22 changed files with 77 additions and 130 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### 41.5.6 [#1185](https://github.com/openfisca/openfisca-core/pull/1185)

#### Technical changes

- Remove pre Python 3.9 syntax.

### 41.5.5 [#1220](https://github.com/openfisca/openfisca-core/pull/1220)

#### Technical changes
Expand Down
6 changes: 1 addition & 5 deletions openfisca_core/entities/_core_entity.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import os
from abc import abstractmethod

from . import types as t
from .role import Role

if TYPE_CHECKING:
from . import types as t


class _CoreEntity:
"""Base class to build entities from."""
Expand Down
5 changes: 1 addition & 4 deletions openfisca_core/entities/group_entity.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING
from collections.abc import Iterable, Sequence

import textwrap
from itertools import chain
Expand All @@ -9,9 +9,6 @@
from ._core_entity import _CoreEntity
from .role import Role

if TYPE_CHECKING:
from collections.abc import Iterable, Sequence


class GroupEntity(_CoreEntity):
"""Represents an entity containing several others with different roles.
Expand Down
8 changes: 2 additions & 6 deletions openfisca_core/entities/helpers.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
from __future__ import annotations

from typing import TYPE_CHECKING
from collections.abc import Iterable, Sequence

from . import types as t
from .entity import Entity
from .group_entity import GroupEntity

if TYPE_CHECKING:
from collections.abc import Iterable, Sequence

from . import types as t


def build_entity(
key: str,
Expand Down
8 changes: 3 additions & 5 deletions openfisca_core/entities/role.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any
from collections.abc import Iterable, Mapping
from typing import Any

import dataclasses
import textwrap

if TYPE_CHECKING:
from collections.abc import Iterable, Mapping

from .types import SingleEntity
from .types import SingleEntity


class Role:
Expand Down
6 changes: 2 additions & 4 deletions openfisca_core/entities/types.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from __future__ import annotations

from typing import TYPE_CHECKING, NewType, Protocol
from collections.abc import Iterable
from typing import NewType, Protocol
from typing_extensions import Required, TypedDict

from openfisca_core import types as t

if TYPE_CHECKING:
from collections.abc import Iterable

# Entities

#: For example "person".
Expand Down
5 changes: 1 addition & 4 deletions openfisca_core/errors/situation_parsing_error.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from __future__ import annotations

from typing import TYPE_CHECKING
from collections.abc import Iterable

import os

import dpath.util

if TYPE_CHECKING:
from collections.abc import Iterable


class SituationParsingError(Exception):
"""Exception raised when the situation provided as an input for a simulation cannot be parsed."""
Expand Down
6 changes: 2 additions & 4 deletions openfisca_core/holders/holder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any
from collections.abc import Sequence
from typing import Any

import os
import warnings
Expand All @@ -20,9 +21,6 @@

from .memory_usage import MemoryUsage

if TYPE_CHECKING:
from collections.abc import Sequence


class Holder:
"""A holder keeps tracks of a variable values after they have been calculated, or set as an input."""
Expand Down
11 changes: 4 additions & 7 deletions openfisca_core/projectors/helpers.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from __future__ import annotations

from typing import TYPE_CHECKING
from collections.abc import Mapping

from openfisca_core import entities, projectors

if TYPE_CHECKING:
from collections.abc import Mapping
from openfisca_core.types import GroupEntity, Role, SingleEntity

from openfisca_core.types import GroupEntity, Role, SingleEntity
from openfisca_core import entities, projectors

from .typing import GroupPopulation, Population
from .typing import GroupPopulation, Population


def projectable(function):
Expand Down
8 changes: 3 additions & 5 deletions openfisca_core/projectors/typing.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Protocol
from collections.abc import Mapping
from typing import Protocol

if TYPE_CHECKING:
from collections.abc import Mapping

from openfisca_core.types import GroupEntity, SingleEntity
from openfisca_core.types import GroupEntity, SingleEntity


class Population(Protocol):
Expand Down
7 changes: 2 additions & 5 deletions openfisca_core/simulations/_build_from_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

from __future__ import annotations

from typing import TYPE_CHECKING
from typing_extensions import Self

from openfisca_core import errors

from ._build_default_simulation import _BuildDefaultSimulation
from ._type_guards import is_variable_dated

if TYPE_CHECKING:
from .simulation import Simulation
from .typing import Entity, Population, TaxBenefitSystem, Variables
from .simulation import Simulation
from .typing import Entity, Population, TaxBenefitSystem, Variables


class _BuildFromVariables:
Expand Down
23 changes: 10 additions & 13 deletions openfisca_core/simulations/_type_guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

from __future__ import annotations

from typing import TYPE_CHECKING
from collections.abc import Iterable
from typing_extensions import TypeGuard

if TYPE_CHECKING:
from collections.abc import Iterable

from .typing import (
Axes,
DatedVariable,
FullySpecifiedEntities,
ImplicitGroupEntities,
Params,
UndatedVariable,
Variables,
)
from .typing import (
Axes,
DatedVariable,
FullySpecifiedEntities,
ImplicitGroupEntities,
Params,
UndatedVariable,
Variables,
)


def are_entities_fully_specified(
Expand Down
10 changes: 4 additions & 6 deletions openfisca_core/simulations/simulation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from __future__ import annotations

from typing import TYPE_CHECKING, NamedTuple
from collections.abc import Mapping
from typing import NamedTuple

from openfisca_core.types import Population, TaxBenefitSystem, Variable

import tempfile
import warnings
Expand All @@ -16,11 +19,6 @@
warnings as core_warnings,
)

if TYPE_CHECKING:
from collections.abc import Mapping

from openfisca_core.types import Population, TaxBenefitSystem, Variable


class Simulation:
"""Represents a simulation, and handles the calculation logic."""
Expand Down
39 changes: 18 additions & 21 deletions openfisca_core/simulations/simulation_builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import annotations

from typing import TYPE_CHECKING, NoReturn
from collections.abc import Iterable, Sequence
from numpy.typing import NDArray as Array
from typing import NoReturn

import copy

Expand All @@ -19,26 +21,21 @@
has_axes,
)
from .simulation import Simulation

if TYPE_CHECKING:
from collections.abc import Iterable, Sequence
from numpy.typing import NDArray as Array

from .typing import (
Axis,
Entity,
FullySpecifiedEntities,
GroupEntities,
GroupEntity,
ImplicitGroupEntities,
Params,
ParamsWithoutAxes,
Population,
Role,
SingleEntity,
TaxBenefitSystem,
Variables,
)
from .typing import (
Axis,
Entity,
FullySpecifiedEntities,
GroupEntities,
GroupEntity,
ImplicitGroupEntities,
Params,
ParamsWithoutAxes,
Population,
Role,
SingleEntity,
TaxBenefitSystem,
Variables,
)


class SimulationBuilder:
Expand Down
6 changes: 2 additions & 4 deletions openfisca_core/simulations/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from __future__ import annotations

from collections.abc import Iterable, Sequence
from typing import TYPE_CHECKING, Protocol, TypeVar, TypedDict, Union
from numpy.typing import NDArray as Array
from typing import Protocol, TypeVar, TypedDict, Union
from typing_extensions import NotRequired, Required, TypeAlias

import datetime
Expand All @@ -18,9 +19,6 @@
str_ as String,
)

if TYPE_CHECKING:
from numpy.typing import NDArray as Array

#: Generic type variables.
E = TypeVar("E")
G = TypeVar("G", covariant=True)
Expand Down
13 changes: 5 additions & 8 deletions openfisca_core/taxbenefitsystems/tax_benefit_system.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any
from collections.abc import Sequence
from typing import Any

from openfisca_core.types import ParameterNodeAtInstant

import ast
import copy
Expand All @@ -17,20 +20,14 @@
import traceback

from openfisca_core import commons, periods, variables
from openfisca_core.entities import Entity
from openfisca_core.errors import VariableNameConflictError, VariableNotFoundError
from openfisca_core.parameters import ParameterNode
from openfisca_core.periods import Instant, Period
from openfisca_core.populations import GroupPopulation, Population
from openfisca_core.simulations import SimulationBuilder
from openfisca_core.variables import Variable

if TYPE_CHECKING:
from collections.abc import Sequence

from openfisca_core.types import ParameterNodeAtInstant

from openfisca_core.entities import Entity

log = logging.getLogger(__name__)


Expand Down
10 changes: 4 additions & 6 deletions openfisca_core/tools/test_runner.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any
from collections.abc import Sequence
from typing import Any
from typing_extensions import Literal, TypedDict

from openfisca_core.types import TaxBenefitSystem

import dataclasses
import os
import pathlib
Expand All @@ -18,11 +21,6 @@
from openfisca_core.tools import assert_near
from openfisca_core.warnings import LibYAMLWarning

if TYPE_CHECKING:
from collections.abc import Sequence

from openfisca_core.types import TaxBenefitSystem


class Options(TypedDict, total=False):
aggregate: bool
Expand Down
7 changes: 2 additions & 5 deletions openfisca_core/variables/helpers.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import sortedcontainers

if TYPE_CHECKING:
from openfisca_core import variables
from openfisca_core.periods import Period
from openfisca_core import variables
from openfisca_core.periods import Period


def get_annualized_variable(
Expand Down
Loading

0 comments on commit e1c05d6

Please sign in to comment.