Skip to content

Commit 8c55f8c

Browse files
authored
Dependencies (#3)
TL;DR: added tests, made minor adjustments to pass tests * added .gitignore and .github/workflows * updated dependencies * dependency typo * testing out using caribou dependencies * adding dependencies back in * adding dependencies back in * adding dependencies back in * float32 observation outputs for IPM_v2
1 parent c344457 commit 8c55f8c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,14 @@ name = "rl4greencrab" # rename this if you plan to publish to test PyPI
88
# You will learn how to setup dynamic versioning in a followup tutorial.
99
version = "1.0.0"
1010

11-
dependencies = ["gymnasium", "numpy", "scipy", "stable-baselines3", "sb3-contrib", "yaml"]
11+
# dependencies = ["gymnasium", "numpy", "scipy", "stable-baselines3", "sb3-contrib", "pyyaml"]
12+
dependencies = ["gymnasium",
13+
"numpy",
14+
"pandas",
15+
"scipy",
16+
"matplotlib",
17+
"typing",
18+
"pyyaml"]
19+
20+
[project.optional-dependencies]
21+
tests = ["pytest", "pytest-cov", "stable_baselines3", "sb3-contrib"]

src/rl4greencrab/invasive_ipm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,14 @@ def step(self, action):
282282
np.float32(scaled_action)
283283
)
284284
normalized_cpue = 2 * self.cpue_2(obs, scaled_action) - 1
285-
return np.append(normalized_cpue, action), rew, term, trunc, info
285+
observation = np.float32(np.append(normalized_cpue, action))
286+
return observation, rew, term, trunc, info
286287

287288
def reset(self, seed=42, options=None):
288289
_, info = super().reset(seed=seed, options=options)
289290

290291
# completely new obs
291-
return - np.ones(shape=self.observation_space.shape), info
292+
return - np.ones(shape=self.observation_space.shape, dtype=np.float32), info
292293

293294
def cpue_2(self, obs, scaled_action):
294295
if any(scaled_action <= 0):

0 commit comments

Comments
 (0)