Skip to content

Commit

Permalink
Add linting to travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanyam Kapoor committed Apr 9, 2018
1 parent c24de88 commit e01abcd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ disable=print-statement,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating
dict-values-not-iterating,
missing-docstring # @TODO: fix later

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ language: python
python:
- "3.6"

before_script:
- pip install -r requirements_dev.txt

script:
- pylint torchrl/ examples/
- pip install .

deploy:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.3.1
7 changes: 3 additions & 4 deletions examples/a2c_cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from torchrl.archs import SimpleQNet
from torchrl.algorithms import A2C

viz = visdom.Visdom()
window = None


def main():
viz = visdom.Visdom()
window = None

env = gym.make('CartPole-v1')
qnet = SimpleQNet(env.observation_space.shape[0], env.action_space.n)
agent = DQN(qnet)
Expand All @@ -28,7 +28,6 @@ def main():

# @TODO A general method to collect training stats?
if viz.check_connection():
global window
window = viz.line(torch.FloatTensor(reward_list), torch.FloatTensor(list(range(1, num_episodes + 1))),
win=window, name='training_episode_rewards', update='replace' if window else None,
opts={'title': 'Training Rewards', 'xlabel': 'Episode',
Expand Down
7 changes: 3 additions & 4 deletions examples/dqn_cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from torchrl.archs import SimpleQNet
from torchrl.algorithms import QLearning

viz = visdom.Visdom()
window = None


def main():
viz = visdom.Visdom()
window = None

env = gym.make('CartPole-v1')
qnet = SimpleQNet(env.observation_space.shape[0], env.action_space.n)
agent = DQN(qnet)
Expand All @@ -29,7 +29,6 @@ def main():

# @TODO A general method to collect training stats?
if viz.check_connection():
global window
window = viz.line(torch.FloatTensor(reward_list), torch.FloatTensor(list(range(1, num_episodes + 1))),
win=window, name='training_episode_rewards', update='replace' if window else None,
opts={'title': 'Training Rewards', 'xlabel': 'Episode',
Expand Down

0 comments on commit e01abcd

Please sign in to comment.