Skip to content

Commit 3254dbd

Browse files
authored
Merge branch 'main' into 118-fix-lru-cache-in-env-loading
2 parents 16e32c3 + 648df31 commit 3254dbd

6 files changed

+21
-14
lines changed

flatland/envs/rail_env.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class RailEnv(Environment):
7777
7878
Every time an agent stops, an agent has a certain probability of malfunctioning. Malfunctions of trains follow a
7979
poisson process with a certain rate. Not all trains will be affected by malfunctions during episodes to keep
80-
complexity managable.
80+
complexity manageable.
8181
8282
TODO: currently, the parameters that control the stochasticity of the environment are hard-coded in init().
8383
For Round 2, they will be passed to the constructor as arguments, to allow for more flexibility.
@@ -140,7 +140,7 @@ def __init__(self,
140140
vectors for each agent.
141141
remove_agents_at_target : bool
142142
If remove_agents_at_target is set to true then the agents will be removed by placing to
143-
RailEnv.DEPOT_POSITION when the agent has reach it's target position.
143+
RailEnv.DEPOT_POSITION when the agent has reached its target position.
144144
random_seed : int or None
145145
if None, then its ignored, else the random generators are seeded with this number to ensure
146146
that stochastic operations are replicable across multiple operations
@@ -441,7 +441,7 @@ def preprocess_action(self, action, agent):
441441

442442
action = action_preprocessing.preprocess_moving_action(action, self.rail, current_position, current_direction)
443443

444-
# Check transitions, bounts for executing the action in the given position and directon
444+
# Check transitions, bounts for executing the action in the given position and direction
445445
if action.is_moving_action() and not check_valid_action(action, self.rail, current_position, current_direction):
446446
action = RailEnvActions.STOP_MOVING
447447

@@ -674,7 +674,7 @@ def get_valid_directions_on_grid(self, row: int, col: int) -> List[int]:
674674
def _exp_distirbution_synced(self, rate: float) -> float:
675675
"""
676676
Generates sample from exponential distribution
677-
We need this to guarantee synchronity between different instances with same seed.
677+
We need this to guarantee synchronicity between different instances with the same seed.
678678
:param rate:
679679
:return:
680680
"""
@@ -684,7 +684,7 @@ def _exp_distirbution_synced(self, rate: float) -> float:
684684

685685
def _is_agent_ok(self, agent: EnvAgent) -> bool:
686686
"""
687-
Check if an agent is ok, meaning it can move and is not malfuncitoinig
687+
Checks if an agent is ok, meaning it can move and is not malfunctioning.
688688
Parameters
689689
----------
690690
agent
@@ -706,7 +706,7 @@ def render(self, mode="rgb_array", gl="PGL", agent_render_variant=AgentRenderVar
706706
show_observations=False, show_predictions=False,
707707
show_rowcols=False, return_image=True):
708708
"""
709-
This methods provides the option to render the
709+
Provides the option to render the
710710
environment's behavior as an image or to a window.
711711
Parameters
712712
----------
@@ -764,7 +764,7 @@ def update_renderer(self, mode, show, show_observations, show_predictions,
764764

765765
def close(self):
766766
"""
767-
This methods closes any renderer window.
767+
Closes any renderer window.
768768
"""
769769
if hasattr(self, "renderer") and self.renderer is not None:
770770
try:

pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
'Programming Language :: Python :: 3.12',
2020
]
2121
dependencies = [
22-
"attr",
22+
"attrs",
2323
"boto3",
2424
"click",
2525
"crowdai_api",
@@ -42,6 +42,8 @@ dependencies = [
4242
"recordtype",
4343
"redis",
4444
"seaborn",
45+
# https://docs.python.org/3/whatsnew/3.12.html: Python 3.12 has removed pkg_resources from the standard library (moved to setuptools):
46+
"setuptools",
4547
"svgutils",
4648
"timeout_decorator",
4749
]

requirements-dev.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ async-lru==2.0.4
2424
# via jupyterlab
2525
async-timeout==5.0.1
2626
# via redis
27-
attr==0.3.2
28-
# via flatland-rl (pyproject.toml)
2927
attrs==25.1.0
3028
# via
3129
# flake8-eradicate
30+
# flatland-rl (pyproject.toml)
3231
# jsonschema
3332
# referencing
3433
babel==2.17.0

requirements-ml.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ async-timeout==5.0.1
2424
# via
2525
# aiohttp
2626
# redis
27-
attr==0.3.2
28-
# via flatland-rl (pyproject.toml)
2927
attrs==25.1.0
3028
# via
3129
# aiohttp
30+
# flatland-rl (pyproject.toml)
3231
# jsonschema
3332
# referencing
3433
boto3==1.36.20

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ asttokens==3.0.0
88
# via stack-data
99
async-timeout==5.0.1
1010
# via redis
11-
attr==0.3.2
11+
attrs==25.1.0
1212
# via flatland-rl (pyproject.toml)
1313
boto3==1.36.20
1414
# via flatland-rl (pyproject.toml)

tox.ini

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
env_list = py{310,311,312},notebooks,py{310,311,312}-ml
2+
env_list = py{310,311,312},notebooks,py{310,311,312}-ml,py{310,311,312}-verify-install
33

44
[gh-actions]
55
python =
@@ -123,3 +123,10 @@ deps =
123123
-r requirements-dev.txt
124124
commands =
125125
python -m build
126+
127+
[testenv:py{310,311,312}-verify-install]
128+
# install flatland-rl without additional dependencies
129+
skip_install = false
130+
commands =
131+
python --version
132+
python -c 'from flatland.evaluators.service import FlatlandRemoteEvaluationService'

0 commit comments

Comments
 (0)