Skip to content

Modifies Installation Instructions for black - #201

Merged
muupan merged 3 commits into
pfnet:masterfrom
prabhatnagarajan:black_install
Dec 14, 2025
Merged

muupan merged 3 commits into
pfnet:masterfrom
prabhatnagarajan:black_install

Conversation

@prabhatnagarajan

@prabhatnagarajan prabhatnagarajan commented Nov 28, 2025 •

Copy link
Copy Markdown
Contributor

I rewrite the installation instructions for installing the linter.

@prabhatnagarajan

Copy link
Copy Markdown
Contributor Author

@keisuke-nakata following up for a review when you have time.

Comment thread CONTRIBUTING.md Outdated
Co-authored-by: NAKATA Keisuke <keisuke.nakata.919@gmail.com>

@keisuke-nakata keisuke-nakata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@prabhatnagarajan

Copy link
Copy Markdown
Contributor Author

@keisuke-nakata I think I need you to run tests.

@keisuke-nakata

Copy link
Copy Markdown
Member

/test

@pfn-ci-bot

Copy link
Copy Markdown

Successfully created a job for commit ec2c54d:

@keisuke-nakata

Copy link
Copy Markdown
Member

The failing tests seem to be unrelated to this PR, but the merge policy requires all tests to pass before merging.
@prabhatnagarajan Can you see the CI (pfrl.lint) log?
If not, please refer the log I copied from CI:

00:00:07.537305 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/examples/atari/train_drqn_ale.py	2025-12-11 06:50:13.036945+00:00	
00:00:07.537318 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/examples/atari/train_drqn_ale.py	2025-12-11 06:50:18.769362+00:00	
00:00:07.537326 STDOUT 1192]	@@ -7,10 +7,11 @@	
00:00:07.537561 STDOUT 1192]	     python train_drqn_ale.py --recurrent	
00:00:07.537563 STDOUT 1192]		
00:00:07.537566 STDOUT 1192]	 To train DQRN using a recurrent model on flickering 1-frame Breakout, run:	
00:00:07.537592 STDOUT 1192]	     python train_drqn_ale.py --recurrent --flicker --no-frame-stack	
00:00:07.537593 STDOUT 1192]	 """	
00:00:07.537596 STDOUT 1192]	+	
00:00:07.537622 STDOUT 1192]	 import argparse	
00:00:07.537623 STDOUT 1192]		
00:00:07.537626 STDOUT 1192]	 import gym	
00:00:07.537651 STDOUT 1192]	 import gym.wrappers	
00:00:07.537653 STDOUT 1192]	 import numpy as np	
00:00:07.538090 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/examples/atari/train_drqn_ale.py	
00:00:07.626010 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/examples/atari/train_ppo_ale.py	2025-12-11 06:50:13.036945+00:00	
00:00:07.626023 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/examples/atari/train_ppo_ale.py	2025-12-11 06:50:18.860875+00:00	
00:00:07.626031 STDOUT 1192]	@@ -6,10 +6,11 @@	
00:00:07.626093 STDOUT 1192]	     python train_ppo_ale.py	
00:00:07.626095 STDOUT 1192]		
00:00:07.626098 STDOUT 1192]	 To train PPO using a recurrent model on a flickering Atari env, run:	
00:00:07.626121 STDOUT 1192]	     python train_ppo_ale.py --recurrent --flicker --no-frame-stack	
00:00:07.626128 STDOUT 1192]	 """	
00:00:07.626132 STDOUT 1192]	+	
00:00:07.626154 STDOUT 1192]	 import argparse	
00:00:07.626156 STDOUT 1192]	 import functools	
00:00:07.626159 STDOUT 1192]		
00:00:07.626181 STDOUT 1192]	 import numpy as np	
00:00:07.626182 STDOUT 1192]	 import torch	
00:00:07.626618 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/examples/atari/train_ppo_ale.py	
00:00:07.863694 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/examples/atlas/train_soft_actor_critic_atlas.py	2025-12-11 06:50:13.040946+00:00	
00:00:07.863709 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/examples/atlas/train_soft_actor_critic_atlas.py	2025-12-11 06:50:19.103276+00:00	
00:00:07.863717 STDOUT 1192]	@@ -1,6 +1,7 @@	
00:00:07.863939 STDOUT 1192]	 """A training script of Soft Actor-Critic on RoboschoolAtlasForwardWalk-v1."""	
00:00:07.863941 STDOUT 1192]	+	
00:00:07.863945 STDOUT 1192]	 import argparse	
00:00:07.863973 STDOUT 1192]	 import functools	
00:00:07.863975 STDOUT 1192]	 import logging	
00:00:07.863979 STDOUT 1192]	 import sys	
00:00:07.864002 STDOUT 1192]		
00:00:07.865260 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/examples/atlas/train_soft_actor_critic_atlas.py	
00:00:08.071995 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/examples/gym/train_reinforce_gym.py	2025-12-11 06:50:13.985035+00:00	
00:00:08.072009 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/examples/gym/train_reinforce_gym.py	2025-12-11 06:50:19.312047+00:00	
00:00:08.072018 STDOUT 1192]	@@ -7,10 +7,11 @@	
00:00:08.072177 STDOUT 1192]	     python train_reinforce_gym.py	
00:00:08.072179 STDOUT 1192]		
00:00:08.072183 STDOUT 1192]	 To solve InvertedPendulum-v1, run:	
00:00:08.072210 STDOUT 1192]	     python train_reinforce_gym.py --env InvertedPendulum-v1	
00:00:08.072212 STDOUT 1192]	 """	
00:00:08.072215 STDOUT 1192]	+	
00:00:08.072242 STDOUT 1192]	 import argparse	
00:00:08.072244 STDOUT 1192]		
00:00:08.072246 STDOUT 1192]	 import gym	
00:00:08.072271 STDOUT 1192]	 import gym.spaces	
00:00:08.072272 STDOUT 1192]	 import torch	
00:00:08.073251 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/examples/gym/train_reinforce_gym.py	
00:00:08.275587 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/ppo/train_ppo.py	2025-12-11 06:50:13.036945+00:00	
00:00:08.275600 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/ppo/train_ppo.py	2025-12-11 06:50:19.515315+00:00	
00:00:08.275634 STDOUT 1192]	@@ -1,10 +1,11 @@	
00:00:08.275798 STDOUT 1192]	 """A training script of PPO on OpenAI Gym Mujoco environments.	
00:00:08.275800 STDOUT 1192]		
00:00:08.275803 STDOUT 1192]	 This script follows the settings of https://arxiv.org/abs/1709.06560 as much	
00:00:08.275844 STDOUT 1192]	 as possible.	
00:00:08.275846 STDOUT 1192]	 """	
00:00:08.275850 STDOUT 1192]	+	
00:00:08.275873 STDOUT 1192]	 import argparse	
00:00:08.275875 STDOUT 1192]	 import functools	
00:00:08.275881 STDOUT 1192]		
00:00:08.275908 STDOUT 1192]	 import gym	
00:00:08.275910 STDOUT 1192]	 import gym.spaces	
00:00:08.276660 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/ppo/train_ppo.py	
00:00:08.384960 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/soft_actor_critic/train_soft_actor_critic.py	2025-12-11 06:50:13.036945+00:00	
00:00:08.384982 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/soft_actor_critic/train_soft_actor_critic.py	2025-12-11 06:50:19.624452+00:00	
00:00:08.385050 STDOUT 1192]	@@ -1,10 +1,11 @@	
00:00:08.385053 STDOUT 1192]	 """A training script of Soft Actor-Critic on OpenAI Gym Mujoco environments.	
00:00:08.385081 STDOUT 1192]		
00:00:08.385083 STDOUT 1192]	 This script follows the settings of https://arxiv.org/abs/1812.05905 as much	
00:00:08.385086 STDOUT 1192]	 as possible.	
00:00:08.385110 STDOUT 1192]	 """	
00:00:08.385112 STDOUT 1192]	+	
00:00:08.385114 STDOUT 1192]	 import argparse	
00:00:08.385137 STDOUT 1192]	 import functools	
00:00:08.385138 STDOUT 1192]	 import logging	
00:00:08.385141 STDOUT 1192]	 import sys	
00:00:08.385164 STDOUT 1192]	 from distutils.version import LooseVersion	
00:00:08.385710 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/soft_actor_critic/train_soft_actor_critic.py	
00:00:08.581822 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/trpo/train_trpo.py	2025-12-11 06:50:13.036945+00:00	
00:00:08.581835 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/trpo/train_trpo.py	2025-12-11 06:50:19.821719+00:00	
00:00:08.581844 STDOUT 1192]	@@ -1,10 +1,11 @@	
00:00:08.582003 STDOUT 1192]	 """A training script of TRPO on OpenAI Gym Mujoco environments.	
00:00:08.582005 STDOUT 1192]		
00:00:08.582009 STDOUT 1192]	 This script follows the settings of https://arxiv.org/abs/1709.06560 as much	
00:00:08.582034 STDOUT 1192]	 as possible.	
00:00:08.582040 STDOUT 1192]	 """	
00:00:08.582044 STDOUT 1192]	+	
00:00:08.582068 STDOUT 1192]	 import argparse	
00:00:08.582069 STDOUT 1192]	 import logging	
00:00:08.582072 STDOUT 1192]		
00:00:08.582095 STDOUT 1192]	 import gym	
00:00:08.582096 STDOUT 1192]	 import gym.spaces	
00:00:08.582523 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/examples/mujoco/reproduction/trpo/train_trpo.py	
00:00:09.529217 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/pfrl/agents/iqn.py	2025-12-11 06:50:13.985035+00:00	
00:00:09.529230 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/pfrl/agents/iqn.py	2025-12-11 06:50:20.767705+00:00	
00:00:09.529244 STDOUT 1192]	@@ -28,11 +28,10 @@	
00:00:09.529402 STDOUT 1192]	     assert embedding.shape == x.shape + (n_basis_functions,)	
00:00:09.529405 STDOUT 1192]	     return embedding	
00:00:09.529408 STDOUT 1192]		
00:00:09.529436 STDOUT 1192]		
00:00:09.529438 STDOUT 1192]	 class CosineBasisLinear(nn.Module):	
00:00:09.529441 STDOUT 1192]	-	
00:00:09.529469 STDOUT 1192]	     """Linear layer following cosine basis functions.	
00:00:09.529470 STDOUT 1192]		
00:00:09.529474 STDOUT 1192]	     Args:	
00:00:09.529503 STDOUT 1192]	         n_basis_functions (int): Number of cosine basis functions.	
00:00:09.529504 STDOUT 1192]	         out_size (int): Output size.	
00:00:09.529508 STDOUT 1192]	@@ -79,11 +78,10 @@	
00:00:09.529535 STDOUT 1192]	     h = h.reshape(batch_size, n_taus, n_actions)	
00:00:09.529537 STDOUT 1192]	     return QuantileDiscreteActionValue(h)	
00:00:09.529540 STDOUT 1192]		
00:00:09.529567 STDOUT 1192]		
00:00:09.529568 STDOUT 1192]	 class ImplicitQuantileQFunction(nn.Module):	
00:00:09.529571 STDOUT 1192]	-	
00:00:09.529601 STDOUT 1192]	     """Implicit quantile network-based Q-function.	
00:00:09.529602 STDOUT 1192]		
00:00:09.529606 STDOUT 1192]	     Args:	
00:00:09.529634 STDOUT 1192]	         psi (torch.nn.Module): Callable module	
00:00:09.529635 STDOUT 1192]	             (batch_size, obs_size) -> (batch_size, hidden_size).	
00:00:09.529639 STDOUT 1192]	@@ -123,11 +121,10 @@	
00:00:09.529663 STDOUT 1192]		
00:00:09.529665 STDOUT 1192]	         return evaluate_with_quantile_thresholds	
00:00:09.529668 STDOUT 1192]		
00:00:09.529693 STDOUT 1192]		
00:00:09.529695 STDOUT 1192]	 class RecurrentImplicitQuantileQFunction(Recurrent, nn.Module):	
00:00:09.529698 STDOUT 1192]	-	
00:00:09.529725 STDOUT 1192]	     """Recurrent implicit quantile network-based Q-function.	
00:00:09.529726 STDOUT 1192]		
00:00:09.529729 STDOUT 1192]	     Args:	
00:00:09.529756 STDOUT 1192]	         psi (torch.nn.Module): Module that implements	
00:00:09.529762 STDOUT 1192]	             `pfrl.nn.Recurrent`.	
00:00:09.529765 STDOUT 1192]	@@ -254,11 +251,10 @@	
00:00:09.529791 STDOUT 1192]	         loss = loss_sum	
00:00:09.529792 STDOUT 1192]	     return loss	
00:00:09.529796 STDOUT 1192]		
00:00:09.529818 STDOUT 1192]		
00:00:09.529820 STDOUT 1192]	 class IQN(dqn.DQN):	
00:00:09.529823 STDOUT 1192]	-	
00:00:09.529856 STDOUT 1192]	     """Implicit Quantile Networks.	
00:00:09.529858 STDOUT 1192]		
00:00:09.529861 STDOUT 1192]	     See https://arxiv.org/abs/1806.06923.	
00:00:09.529885 STDOUT 1192]		
00:00:09.529886 STDOUT 1192]	     Args:	
00:00:09.531158 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/pfrl/agents/iqn.py	1.0s
00:00:10.573780 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/pfrl/initializers/chainer_default.py	2025-12-11 06:50:13.985035+00:00	
00:00:10.573794 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/pfrl/initializers/chainer_default.py	2025-12-11 06:50:21.814753+00:00	
00:00:10.573802 STDOUT 1192]	@@ -1,7 +1,7 @@	
00:00:10.574024 STDOUT 1192]	-"""Initializes the weights and biases of a layer to chainer default.	
00:00:10.574026 STDOUT 1192]	-"""	
00:00:10.574030 STDOUT 1192]	+"""Initializes the weights and biases of a layer to chainer default."""	
00:00:10.574068 STDOUT 1192]	+	
00:00:10.574070 STDOUT 1192]	 import torch	
00:00:10.574074 STDOUT 1192]	 import torch.nn as nn	
00:00:10.574103 STDOUT 1192]		
00:00:10.574105 STDOUT 1192]	 from pfrl.initializers.lecun_normal import init_lecun_normal	
00:00:10.574108 STDOUT 1192]		
00:00:10.574919 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/pfrl/initializers/chainer_default.py	2.8s
00:00:13.384328 STDOUT 1192]	--- /tmp/flexci/run-00417839/work/src/tests/wrappers_tests/test_atari_wrappers.py	2025-12-11 06:50:13.985035+00:00	
00:00:13.384363 STDOUT 1192]	+++ /tmp/flexci/run-00417839/work/src/tests/wrappers_tests/test_atari_wrappers.py	2025-12-11 06:50:24.624953+00:00	
00:00:13.384371 STDOUT 1192]	@@ -1,8 +1,7 @@	
00:00:13.384526 STDOUT 1192]	 """Currently this script tests `pfrl.wrappers.atari_wrappers.FrameStack`	
00:00:13.384529 STDOUT 1192]	 only."""	
00:00:13.384534 STDOUT 1192]	-	
00:00:13.384577 STDOUT 1192]		
00:00:13.384579 STDOUT 1192]	 from unittest import mock	
00:00:13.384583 STDOUT 1192]		
00:00:13.384602 STDOUT 1192]	 import gym	
00:00:13.384603 STDOUT 1192]	 import gym.spaces	
00:00:13.385064 STDERR 1192]	would reformat /tmp/flexci/run-00417839/work/src/tests/wrappers_tests/test_atari_wrappers.py	
00:00:13.392222 STDERR 1192]		
00:00:13.392235 STDERR 1192]	Oh no! 💥 💔 💥	
00:00:13.392287 STDERR 1192]	10 files would be reformatted, 203 files would be left unchanged.

@prabhatnagarajan

Copy link
Copy Markdown
Contributor Author

@keisuke-nakata Can you run the tests for this PR: #202? I applied the linters to the repository.

@prabhatnagarajan prabhatnagarajan mentioned this pull request Dec 11, 2025
@prabhatnagarajan

Copy link
Copy Markdown
Contributor Author

@keisuke-nakata Sorry (tests need running again). I just merged with the changes to master.

@muupan

muupan commented Dec 14, 2025

Copy link
Copy Markdown
Member

/test

@pfn-ci-bot

Copy link
Copy Markdown

Successfully created a job for commit d5396d9:

@muupan
muupan merged commit 89ce16b into pfnet:master Dec 14, 2025
7 checks passed
@prabhatnagarajan
prabhatnagarajan deleted the black_install branch April 12, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants