Skip to content

Commit

Permalink
Update ruff version + recheck (#37)
Browse files Browse the repository at this point in the history
* updated ruff toolchain

* run ruff check
  • Loading branch information
Howuhh authored Aug 16, 2024
1 parent 40fb034 commit af7a541
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# ruff checking
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.6.0
hooks:
# Run the linter.
- id: ruff
Expand All @@ -11,7 +11,7 @@ repos:

# pyright checking
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.371
rev: v1.1.376
hooks:
- id: pyright
args: [--project=pyproject.toml]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ version = {attr = "xminigrid.__version__"}
[tool.ruff]
line-length = 120
target-version = "py310"
exclude = ["examples/*.ipynb"]

[tool.ruff.lint]
# disabling rules conflicting with the formatter (from the docs)
Expand Down
1 change: 1 addition & 0 deletions scripts/benchmark_xland.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import jax
import jax.tree_util as jtu
import numpy as np

import xminigrid
from xminigrid import load_benchmark
from xminigrid.wrappers import GymAutoResetWrapper
Expand Down
3 changes: 2 additions & 1 deletion scripts/benchmark_xland_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import jax
import jax.tree_util as jtu
import numpy as np
import xminigrid
from tqdm.auto import tqdm

import xminigrid
from xminigrid import load_benchmark
from xminigrid.wrappers import GymAutoResetWrapper

Expand Down
1 change: 1 addition & 0 deletions scripts/ruleset_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import jax.numpy as jnp
from tqdm.auto import tqdm, trange

from xminigrid.benchmarks import save_bz2_pickle
from xminigrid.core.constants import Colors, Tiles
from xminigrid.core.goals import (
Expand Down
1 change: 1 addition & 0 deletions training/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from flax.linen.dtypes import promote_dtype
from flax.linen.initializers import glorot_normal, orthogonal, zeros_init
from flax.typing import Dtype

from xminigrid.core.constants import NUM_COLORS, NUM_TILES


Expand Down
3 changes: 2 additions & 1 deletion training/train_meta_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
import orbax
import pyrallis
import wandb
import xminigrid
from flax.jax_utils import replicate, unreplicate
from flax.training import orbax_utils
from flax.training.train_state import TrainState
from nn import ActorCriticRNN
from utils import Transition, calculate_gae, ppo_update_networks, rollout

import xminigrid
from xminigrid.benchmarks import Benchmark
from xminigrid.environment import Environment, EnvParams
from xminigrid.wrappers import DirectionObservationWrapper, GymAutoResetWrapper
Expand Down
3 changes: 2 additions & 1 deletion training/train_single_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
import optax
import pyrallis
import wandb
import xminigrid
from flax.jax_utils import replicate, unreplicate
from flax.training.train_state import TrainState
from nn import ActorCriticRNN
from utils import Transition, calculate_gae, ppo_update_networks, rollout

import xminigrid
from xminigrid.environment import Environment, EnvParams
from xminigrid.wrappers import DirectionObservationWrapper, GymAutoResetWrapper

Expand Down
1 change: 1 addition & 0 deletions training/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jax.numpy as jnp
from flax import struct
from flax.training.train_state import TrainState

from xminigrid.environment import Environment, EnvParams


Expand Down

0 comments on commit af7a541

Please sign in to comment.