Skip to content

Commit

Permalink
add black profile
Browse files Browse the repository at this point in the history
  • Loading branch information
vwxyzjn committed Jan 26, 2022
1 parent e794ac9 commit a75b305
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ repos:
hooks:
- id: isort
args:
- --skip wandb
- --profile=black
- --skip=wandb
- repo: /~https://github.com/myint/autoflake
rev: v1.4
hooks:
Expand Down
14 changes: 11 additions & 3 deletions experiments/league.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@
import numpy as np
import pandas as pd
import torch
from peewee import (JOIN, CharField, DateTimeField, FloatField,
ForeignKeyField, Model, SmallIntegerField, SqliteDatabase,
fn)
from peewee import (
JOIN,
CharField,
DateTimeField,
FloatField,
ForeignKeyField,
Model,
SmallIntegerField,
SqliteDatabase,
fn,
)
from ppo_gridnet import Agent, MicroRTSStatsRecorder
from stable_baselines3.common.vec_env import VecMonitor
from trueskill import Rating, quality_1vs1, rate_1vs1
Expand Down
3 changes: 1 addition & 2 deletions experiments/ppo_gridnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import torch.nn as nn
import torch.optim as optim
from gym.spaces import MultiDiscrete
from stable_baselines3.common.vec_env import (VecEnvWrapper, VecMonitor,
VecVideoRecorder)
from stable_baselines3.common.vec_env import VecEnvWrapper, VecMonitor, VecVideoRecorder
from torch.distributions.categorical import Categorical
from torch.utils.tensorboard import SummaryWriter

Expand Down
32 changes: 18 additions & 14 deletions gym_microrts/envs/vec_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ def __init__(
from rts.units import UnitTypeTable

self.real_utt = UnitTypeTable()
from ai.rewardfunction import (AttackRewardFunction,
ProduceBuildingRewardFunction,
ProduceCombatUnitRewardFunction,
ProduceWorkerRewardFunction,
ResourceGatherRewardFunction,
RewardFunctionInterface,
WinLossRewardFunction)
from ai.rewardfunction import (
AttackRewardFunction,
ProduceBuildingRewardFunction,
ProduceCombatUnitRewardFunction,
ProduceWorkerRewardFunction,
ResourceGatherRewardFunction,
RewardFunctionInterface,
WinLossRewardFunction,
)

self.rfs = JArray(RewardFunctionInterface)(
[
Expand Down Expand Up @@ -272,13 +274,15 @@ def __init__(
from rts.units import UnitTypeTable

self.real_utt = UnitTypeTable()
from ai.rewardfunction import (AttackRewardFunction,
ProduceBuildingRewardFunction,
ProduceCombatUnitRewardFunction,
ProduceWorkerRewardFunction,
ResourceGatherRewardFunction,
RewardFunctionInterface,
WinLossRewardFunction)
from ai.rewardfunction import (
AttackRewardFunction,
ProduceBuildingRewardFunction,
ProduceCombatUnitRewardFunction,
ProduceWorkerRewardFunction,
ResourceGatherRewardFunction,
RewardFunctionInterface,
WinLossRewardFunction,
)

self.rfs = JArray(RewardFunctionInterface)(
[
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry.extras]
spyder = ["spyder"]
cleanrl = ["cleanrl"]
cleanrl = ["cleanrl"]

0 comments on commit a75b305

Please sign in to comment.