Skip to content

Commit

Permalink
from typing to typing-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
adamamer20 committed Jul 3, 2024
1 parent ba7d17b commit f69d7b2
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
4 changes: 3 additions & 1 deletion mesa_frames/abstract/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
from abc import abstractmethod
from collections.abc import Callable, Collection, Iterable, Iterator, Sequence
from contextlib import suppress
from typing import TYPE_CHECKING, Any, Literal, Self, overload

from numpy.random import Generator
from typing_extensions import Any, Self, overload

from typing import TYPE_CHECKING, Literal

from mesa_frames.abstract.mixin import CopyMixin
from mesa_frames.types import BoolSeries, DataFrame, IdsLike, Index, MaskLike, Series
Expand Down
3 changes: 2 additions & 1 deletion mesa_frames/abstract/mixin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from abc import ABC, abstractmethod
from copy import copy, deepcopy
from typing import Self

from typing_extensions import Self


class CopyMixin(ABC):
Expand Down
8 changes: 4 additions & 4 deletions mesa_frames/concrete/agents.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from collections import defaultdict
from collections.abc import Callable, Iterable, Iterator, Sequence
from typing import Any, Literal, Self, cast, overload

from collections.abc import Collection
from collections.abc import Callable, Collection, Iterable, Iterator, Sequence

import polars as pl
from typing_extensions import Any, Self, overload

from typing import Literal, cast

from mesa_frames.abstract.agents import AgentContainer, AgentSetDF
from mesa_frames.types import DataFrame, IdsLike, MaskLike, Series
Expand Down
4 changes: 3 additions & 1 deletion mesa_frames/concrete/agentset_pandas.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from collections.abc import Callable, Collection, Iterable, Iterator, Sequence
from typing import TYPE_CHECKING, Any, Self, overload

import pandas as pd
import polars as pl
from typing_extensions import Any, Self, overload

from typing import TYPE_CHECKING

from mesa_frames.abstract.agents import AgentSetDF
from mesa_frames.concrete.agentset_polars import AgentSetPolars
Expand Down
4 changes: 3 additions & 1 deletion mesa_frames/concrete/agentset_polars.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from collections.abc import Callable, Collection, Iterable, Iterator, Sequence
from typing import TYPE_CHECKING, Any, Self, overload

import polars as pl
from polars.type_aliases import IntoExpr
from typing_extensions import Any, Self, overload

from typing import TYPE_CHECKING

from mesa_frames.concrete.agents import AgentSetDF
from mesa_frames.types import PolarsIdsLike, PolarsMaskLike
Expand Down
4 changes: 3 additions & 1 deletion mesa_frames/concrete/model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any

import numpy as np
from typing_extensions import Any

from typing import TYPE_CHECKING

from mesa_frames.concrete.agents import AgentsDF

Expand Down
2 changes: 1 addition & 1 deletion mesa_frames/types.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from collections.abc import Collection, Hashable
from typing import Literal

import pandas as pd
import polars as pl
from numpy import ndarray
from typing import Literal

####----- Agnostic Types -----####
AgnosticMask = Literal["all", "active"] | Hashable | None
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ authors = [
license = { text = "MIT" }
dependencies = [
"numpy~=1.26",
"typing-extensions>=4.9"
]

[project.optional-dependencies]
Expand Down

0 comments on commit f69d7b2

Please sign in to comment.