-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f81fb7
commit b27db7c
Showing
9 changed files
with
72 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,3 @@ | ||
from __future__ import annotations | ||
|
||
from typing import NewType, Protocol | ||
|
||
import pendulum | ||
|
||
from openfisca_core import types as t | ||
|
||
# New types. | ||
|
||
#: For example "2000-01". | ||
InstantStr = NewType("InstantStr", str) | ||
|
||
#: For example "1:2000-01-01:day". | ||
PeriodStr = NewType("PeriodStr", str) | ||
|
||
|
||
# Periods | ||
|
||
|
||
class DateUnit(t.DateUnit, Protocol): | ||
... | ||
|
||
|
||
class Instant(t.Instant, 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) -> Instant | None: | ||
... | ||
|
||
|
||
class Period(t.Period, Protocol): | ||
@property | ||
def size(self) -> int: | ||
... | ||
|
||
@property | ||
def start(self) -> Instant: | ||
... | ||
|
||
@property | ||
def stop(self) -> Instant: | ||
... | ||
|
||
def offset(self, offset: str | int, unit: DateUnit | None = None) -> Period: | ||
... | ||
|
||
from openfisca_core.types import DateUnit, Instant, InstantStr, Period, PeriodStr | ||
|
||
__all__ = ["DateUnit", "Instant", "Period", "InstantStr", "PeriodStr"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.