Skip to content

Commit

Permalink
pre-commit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
saleml committed Mar 21, 2024
1 parent 70ae3e1 commit 87c29b5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/gfn/containers/replay_buffer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import os
import torch
from typing import TYPE_CHECKING, Literal

import torch

from gfn.containers.trajectories import Trajectories
from gfn.containers.transitions import Transitions

Expand Down
2 changes: 1 addition & 1 deletion src/gfn/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class DiscreteEnvStates(DiscreteStates):

def make_actions_class(self) -> type[Actions]:
env = self
n_actions = self.n_actions
self.n_actions

class DiscreteEnvActions(Actions):
action_shape = env.action_shape
Expand Down
2 changes: 1 addition & 1 deletion src/gfn/states.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations # This allows to use the class name in type hints

from abc import ABC, abstractmethod
from abc import ABC
from copy import deepcopy
from math import prod
from typing import Callable, ClassVar, Optional, Sequence, cast
Expand Down
4 changes: 3 additions & 1 deletion testing/test_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ def test_box_fwd_step(delta: float):
]

for failing_actions_list in failing_actions_lists_at_s0:
actions = env.actions_from_tensor(format_tensor(failing_actions_list, discrete=False))
actions = env.actions_from_tensor(
format_tensor(failing_actions_list, discrete=False)
)
with pytest.raises(NonValidActionsError):
states = env._step(states, actions)

Expand Down

0 comments on commit 87c29b5

Please sign in to comment.