Skip to content

Commit 501c657

Browse files
Merge pull request #8 from Kallinteris-Andreas/main
Add gymnasium_robotics notifications Adroid Hand Warning
2 parents e4625c3 + f7ff887 commit 501c657

2 files changed

Lines changed: 55 additions & 1 deletion

File tree

farama_notifications/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,23 @@
66
###############################################################
77
# notifications["project_name"] = dict()
88
# notifications["project_name"]["version_number"] = "Notification message."
9+
10+
GYMNASIUM_ROBOTICS_ADROIT_WARNING = "AdroitHandRelocateDense-v1, AdroitHandHammerDense-v1, AdroitHandDoorDense-v1 environment's reward functions were updated in v1.2.1 without an environment version update. Therefore, use gymnasium-robotics==1.2.0 for v1 reproducibility or use v2 in gymnasium-robotics>=1.4.3. See https://github.com/Farama-Foundation/Gymnasium-Robotics/pull/220 for more details"
11+
12+
GYMNASIUM_ROBOTICS_ADROIT_VERSIONS = {
13+
version: GYMNASIUM_ROBOTICS_ADROIT_WARNING
14+
for version in (
15+
"1.2.1",
16+
"1.2.2",
17+
"1.2.3",
18+
"1.2.4",
19+
"1.3.0",
20+
"1.3.1",
21+
"1.3.2",
22+
"1.4.0",
23+
"1.4.1",
24+
"1.4.2",
25+
)
26+
}
27+
28+
notifications["gymnasium_robotics"] = GYMNASIUM_ROBOTICS_ADROIT_VERSIONS

tests/ci-test.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
1-
from farama_notifications import notifications
1+
import sys
2+
from pathlib import Path
3+
4+
5+
def test_gymnasium_robotics_notifications(notifications):
6+
expected_versions = {
7+
"1.2.1",
8+
"1.2.2",
9+
"1.2.3",
10+
"1.2.4",
11+
"1.3.0",
12+
"1.3.1",
13+
"1.3.2",
14+
"1.4.0",
15+
"1.4.1",
16+
"1.4.2",
17+
}
18+
expected_message = "AdroitHandRelocateDense-v1, AdroitHandHammerDense-v1, AdroitHandDoorDense-v1 environment's reward functions were updated in v1.2.1 without an environment version update. Therefore, use gymnasium-robotics==1.2.0 for v1 reproducibility or use v2 in gymnasium-robotics>=1.4.3. See https://github.com/Farama-Foundation/Gymnasium-Robotics/pull/220 for more details"
19+
20+
assert "gymnasium_robotics" in notifications, "gymnasium_robotics notifications must be present."
21+
assert set(notifications["gymnasium_robotics"]) == expected_versions, (
22+
"gymnasium_robotics notifications must match the affected versions."
23+
)
24+
25+
for version in expected_versions:
26+
assert notifications["gymnasium_robotics"][version] == expected_message, (
27+
f"gymnasium_robotics {version} warning text must match expected message."
28+
)
29+
230

331
if __name__ == "__main__":
32+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
33+
34+
from farama_notifications import notifications
35+
436
assert isinstance(
537
notifications, dict
638
), f"notifications must be a dict, got {type(notifications)}."
@@ -14,3 +46,5 @@
1446
assert isinstance(
1547
notifications[package][version], str
1648
), f"notifications for each package-version combination must be a string, got {type(notifications[package][version])}."
49+
50+
test_gymnasium_robotics_notifications(notifications)

0 commit comments

Comments
 (0)