Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Isaacson committed Apr 25, 2024
1 parent 2e94b82 commit 5b08e94
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/beignet/func/_molecular_dynamics/_space/_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def space(
dimensions = torch.tensor([dimensions])

if dimensions is None:

def _displacement_fn(
a: Tensor,
b: Tensor,
Expand Down Expand Up @@ -134,6 +135,7 @@ def _shift_fn(a: Tensor, b: Tensor, **_) -> Tensor:
inverse_transformation = _inverse_transform(dimensions)

if normalized:

def _displacement_fn(
a: Tensor,
b: Tensor,
Expand Down Expand Up @@ -171,6 +173,7 @@ def _displacement_fn(
return displacement

if remapped:

def _u(a: Tensor, b: Tensor) -> Tensor:
return torch.remainder(a + b, 1.0)

Expand Down Expand Up @@ -252,6 +255,7 @@ def _displacement_fn(
return displacement

if remapped:

def _u(a: Tensor, b: Tensor) -> Tensor:
return torch.remainder(a + b, 1.0)

Expand Down Expand Up @@ -308,9 +312,11 @@ def _displacement_fn(
return displacement

if remapped:

def _shift_fn(a: Tensor, b: Tensor, **_) -> Tensor:
return torch.remainder(a + b, dimensions)
else:

def _shift_fn(a: Tensor, b: Tensor, **_) -> Tensor:
return a + b

Expand Down

0 comments on commit 5b08e94

Please sign in to comment.