Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
BartekCupial committed Mar 4, 2024
1 parent c403425 commit e1bf6d2
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include = '\.pyi?$'
py_version = 38
line_length = 120
profile = 'black'
known_third_party = ["nle"]

[tool.pytest.ini_options]
addopts = "-s"
1 change: 1 addition & 0 deletions sample_factory/algo/utils/model_sharing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Utilities for sharing model parameters between components.
"""

import sys
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions sample_factory/algo/utils/running_mean_std.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
All credit goes to https://github.com/Denys88/rl_games (only slightly changed here, mostly with in-place operations)
Thanks a lot, great module!
"""

from typing import Dict, Final, List, Optional, Union

import gymnasium as gym
Expand Down
1 change: 1 addition & 0 deletions sample_factory/envs/env_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Gym env wrappers that make the environment suitable for the RL algorithms.
"""

import json
import os
from os.path import join
Expand Down
1 change: 0 additions & 1 deletion sample_factory/launcher/run_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""


import os
import time
from os.path import join
Expand Down
1 change: 0 additions & 1 deletion sample_factory/pbt/population_based_training.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Population-Based Training implementation, inspired by https://arxiv.org/abs/1807.01281."""


import copy
import json
import math
Expand Down
1 change: 1 addition & 0 deletions sample_factory/utils/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
If no data normalization is needed we just keep the original data.
Otherwise, we create a copy of data and do all of the operations operations in-place.
"""

from typing import Dict

import torch
Expand Down
1 change: 0 additions & 1 deletion sf_examples/brax/brax_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
render_mode=human (although still slow and in low resolution).
"""


from typing import Dict, List, Tuple

import brax
Expand Down
1 change: 1 addition & 0 deletions sf_examples/brax/train_brax.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Brax env integration.
"""

import sys
from typing import Dict, List, Optional, Tuple, Union

Expand Down
1 change: 1 addition & 0 deletions sf_examples/nethack/models/chaotic_dwarf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import torch
from nle import nethack
from torch import nn
Expand Down
1 change: 1 addition & 0 deletions sf_examples/nethack/nethack_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
NetHackStaircase,
NetHackStaircasePet,
)

from sample_factory.algo.utils.gymnasium_utils import patch_non_gymnasium_env
from sf_examples.nethack.utils.wrappers import (
BlstatsInfoWrapper,
Expand Down
1 change: 1 addition & 0 deletions sf_examples/nethack/utils/wrappers/gym_compatibility.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Compatibility wrappers for OpenAI gym V22 and V26."""

# pyright: reportGeneralTypeIssues=false, reportPrivateImportUsage=false
from __future__ import annotations

Expand Down
1 change: 0 additions & 1 deletion sf_examples/nethack/utils/wrappers/timelimit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import gym

from nle.env.base import NLE


Expand Down
1 change: 1 addition & 0 deletions sf_examples/train_custom_env_custom_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
python -m sf_examples.enjoy_custom_env_custom_model --algo=APPO --env=my_custom_env_v1 --experiment=example
"""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions sf_examples/train_custom_multi_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
python -m sf_examples.enjoy_custom_multi_env --algo=APPO --env=my_custom_multi_env_v1 --experiment=example_multi
"""

from __future__ import annotations

import random
Expand Down
1 change: 1 addition & 0 deletions sf_examples/vizdoom/train_custom_vizdoom_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
python -m sf_examples.vizdoom.enjoy_custom_vizdoom_env --algo=APPO --env=doom_my_custom_env --experiment=doom_my_custom_env_example
"""

import argparse
import functools
import os
Expand Down

0 comments on commit e1bf6d2

Please sign in to comment.