Skip to content

Commit 92fe09d

Browse files
committed
Fix remaining lint issues
1 parent 4b3bdf2 commit 92fe09d

20 files changed

Lines changed: 56 additions & 57 deletions

File tree

BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
load("//envpool:requirements.bzl", "requirement")
21
load("@rules_python//python:defs.bzl", "py_binary")
2+
load("//envpool:requirements.bzl", "requirement")
33

44
filegroup(
55
name = "clang_tidy_config",

envpool/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//envpool:requirements.bzl", "requirement")
1615
load("@rules_python//python:defs.bzl", "py_library", "py_test")
16+
load("//envpool:requirements.bzl", "requirement")
1717

1818
package(default_visibility = ["//visibility:public"])
1919

envpool/atari/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//envpool:requirements.bzl", "requirement")
1615
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
1716
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
1817
load("@rules_python//python:defs.bzl", "py_library", "py_test")
18+
load("//envpool:requirements.bzl", "requirement")
1919

2020
package(default_visibility = ["//visibility:public"])
2121

envpool/box2d/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//envpool:requirements.bzl", "requirement")
1615
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
1716
load("@rules_cc//cc:defs.bzl", "cc_library")
1817
load("@rules_python//python:defs.bzl", "py_library", "py_test")
18+
load("//envpool:requirements.bzl", "requirement")
1919

2020
package(default_visibility = ["//visibility:public"])
2121

envpool/classic_control/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//envpool:requirements.bzl", "requirement")
1615
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
1716
load("@rules_cc//cc:defs.bzl", "cc_library")
1817
load("@rules_python//python:defs.bzl", "py_library", "py_test")
18+
load("//envpool:requirements.bzl", "requirement")
1919

2020
package(default_visibility = ["//visibility:public"])
2121

envpool/dummy/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//envpool:requirements.bzl", "requirement")
1615
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
1716
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
1817
load("@rules_python//python:defs.bzl", "py_library", "py_test")
18+
load("//envpool:requirements.bzl", "requirement")
1919

2020
py_library(
2121
name = "dummy",

envpool/minigrid/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//envpool:requirements.bzl", "requirement")
1615
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
1716
load("@rules_cc//cc:defs.bzl", "cc_library")
1817
load("@rules_python//python:defs.bzl", "py_library", "py_test")
18+
load("//envpool:requirements.bzl", "requirement")
1919

2020
package(default_visibility = ["//visibility:public"])
2121

envpool/mujoco/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//envpool:requirements.bzl", "requirement")
1615
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
1716
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
1817
load("@rules_python//python:defs.bzl", "py_library", "py_test")
18+
load("//envpool:requirements.bzl", "requirement")
1919

2020
package(default_visibility = ["//visibility:public"])
2121

envpool/mujoco/gym/humanoid.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,20 @@ class HumanoidEnvFns {
5555
if (conf["exclude_root_actuator_forces"_]) {
5656
obs_n -= 6;
5757
}
58-
return MakeDict(
59-
"obs"_.Bind(Spec<mjtNum>({obs_n}, {-inf, inf})),
58+
return MakeDict("obs"_.Bind(Spec<mjtNum>({obs_n}, {-inf, inf})),
6059
#ifdef ENVPOOL_TEST
61-
"info:qpos0"_.Bind(Spec<mjtNum>({24})),
62-
"info:qvel0"_.Bind(Spec<mjtNum>({23})),
60+
"info:qpos0"_.Bind(Spec<mjtNum>({24})),
61+
"info:qvel0"_.Bind(Spec<mjtNum>({23})),
6362
#endif
64-
"info:reward_linvel"_.Bind(Spec<mjtNum>({-1})),
65-
"info:reward_quadctrl"_.Bind(Spec<mjtNum>({-1})),
66-
"info:reward_alive"_.Bind(Spec<mjtNum>({-1})),
67-
"info:reward_impact"_.Bind(Spec<mjtNum>({-1})),
68-
"info:x_position"_.Bind(Spec<mjtNum>({-1})),
69-
"info:y_position"_.Bind(Spec<mjtNum>({-1})),
70-
"info:distance_from_origin"_.Bind(Spec<mjtNum>({-1})),
71-
"info:x_velocity"_.Bind(Spec<mjtNum>({-1})),
72-
"info:y_velocity"_.Bind(Spec<mjtNum>({-1})));
63+
"info:reward_linvel"_.Bind(Spec<mjtNum>({-1})),
64+
"info:reward_quadctrl"_.Bind(Spec<mjtNum>({-1})),
65+
"info:reward_alive"_.Bind(Spec<mjtNum>({-1})),
66+
"info:reward_impact"_.Bind(Spec<mjtNum>({-1})),
67+
"info:x_position"_.Bind(Spec<mjtNum>({-1})),
68+
"info:y_position"_.Bind(Spec<mjtNum>({-1})),
69+
"info:distance_from_origin"_.Bind(Spec<mjtNum>({-1})),
70+
"info:x_velocity"_.Bind(Spec<mjtNum>({-1})),
71+
"info:y_velocity"_.Bind(Spec<mjtNum>({-1})));
7372
}
7473
template <typename Config>
7574
static decltype(auto) ActionSpec(const Config& conf) {

envpool/mujoco/gym/inverted_double_pendulum.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ namespace mujoco_gym {
3131
class InvertedDoublePendulumEnvFns {
3232
public:
3333
static decltype(auto) DefaultConfig() {
34-
return MakeDict("reward_threshold"_.Bind(9100.0), "frame_skip"_.Bind(5),
35-
"post_constraint"_.Bind(true), "healthy_reward"_.Bind(10.0),
36-
"reward_if_not_terminated"_.Bind(false),
37-
"constraint_obs_dim"_.Bind(3),
38-
"healthy_z_max"_.Bind(1.0), "observation_min"_.Bind(-10.0),
39-
"observation_max"_.Bind(10.0),
40-
"reset_noise_scale"_.Bind(0.1));
34+
return MakeDict(
35+
"reward_threshold"_.Bind(9100.0), "frame_skip"_.Bind(5),
36+
"post_constraint"_.Bind(true), "healthy_reward"_.Bind(10.0),
37+
"reward_if_not_terminated"_.Bind(false), "constraint_obs_dim"_.Bind(3),
38+
"healthy_z_max"_.Bind(1.0), "observation_min"_.Bind(-10.0),
39+
"observation_max"_.Bind(10.0), "reset_noise_scale"_.Bind(0.1));
4140
}
4241
template <typename Config>
4342
static decltype(auto) StateSpec(const Config& conf) {
@@ -122,11 +121,10 @@ class InvertedDoublePendulumEnv : public Env<InvertedDoublePendulumEnvSpec>,
122121
mjtNum vel_penalty = 1e-3 * v1 * v1 + 5e-3 * v2 * v2;
123122
// reward and done
124123
bool terminated = !IsHealthy();
125-
mjtNum alive_bonus =
126-
reward_if_not_terminated_ ? healthy_reward_ * static_cast<int>(!terminated)
127-
: healthy_reward_;
128-
auto reward =
129-
static_cast<float>(alive_bonus - dist_penalty - vel_penalty);
124+
mjtNum alive_bonus = reward_if_not_terminated_
125+
? healthy_reward_ * static_cast<int>(!terminated)
126+
: healthy_reward_;
127+
auto reward = static_cast<float>(alive_bonus - dist_penalty - vel_penalty);
130128
++elapsed_step_;
131129
done_ = terminated || (elapsed_step_ >= max_episode_steps_);
132130
WriteState(reward);

0 commit comments

Comments
 (0)