Skip to content

Commit

Permalink
Upgrade black to 24
Browse files Browse the repository at this point in the history
  • Loading branch information
kngwyu committed Apr 2, 2024
1 parent e6064cf commit 214c816
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
6 changes: 2 additions & 4 deletions src/emevo/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def init_uniqueid(n: int, max_n: int) -> UniqueID:
class ObsProtocol(Protocol):
"""Abstraction for agent's observation"""

def as_array(self) -> jax.Array:
...
def as_array(self) -> jax.Array: ...


OBS = TypeVar("OBS", bound="ObsProtocol")
Expand All @@ -109,8 +108,7 @@ class StateProtocol(Protocol):
status: Status
n_born_agents: jax.Array

def is_extinct(self) -> bool:
...
def is_extinct(self) -> bool: ...


STATE = TypeVar("STATE", bound="StateProtocol")
Expand Down
12 changes: 4 additions & 8 deletions src/emevo/environments/env_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ def get_slice(self, index: int) -> Self:
class ReprNumFn(Protocol):
initial: int

def __call__(self, n_steps: int, state: FoodNumState) -> FoodNumState:
...
def __call__(self, n_steps: int, state: FoodNumState) -> FoodNumState: ...


@dataclasses.dataclass(frozen=True)
Expand Down Expand Up @@ -176,16 +175,13 @@ def __call__(self, *args: Any, **kwargs: Any) -> tuple[ReprNumFn, FoodNumState]:


class Coordinate(Protocol):
def bbox(self) -> tuple[tuple[float, float], tuple[float, float]]:
...
def bbox(self) -> tuple[tuple[float, float], tuple[float, float]]: ...

def contains_circle(
self, center: jax.Array, radius: jax.Array | float
) -> jax.Array:
...
) -> jax.Array: ...

def uniform(self, key: chex.PRNGKey) -> jax.Array:
...
def uniform(self, key: chex.PRNGKey) -> jax.Array: ...


@dataclasses.dataclass
Expand Down
3 changes: 1 addition & 2 deletions src/emevo/environments/phyjax2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ class _PositionLike(Protocol):
angle: jax.Array # Angular velocity (N,)
xy: jax.Array # (N, 2)

def __init__(self, angle: jax.Array, xy: jax.Array) -> None:
...
def __init__(self, angle: jax.Array, xy: jax.Array) -> None: ...

def batch_size(self) -> int:
return self.angle.shape[0]
Expand Down
3 changes: 1 addition & 2 deletions src/emevo/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ def close(self) -> None:
"""Close this visualizer"""
...

def get_image(self) -> NDArray:
...
def get_image(self) -> NDArray: ...

def render(self, state: STATE, **kwargs) -> None:
"""Render image"""
Expand Down

0 comments on commit 214c816

Please sign in to comment.