From 192f16f36fa103b8f2fce50803273677ae085a73 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 17:48:32 +0530 Subject: [PATCH 01/18] Fixed the API errors --- .DS_Store | Bin 0 -> 6148 bytes miniwob/screenshot.py | 8 +++++++- tests/test_api.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..55d37d29443a39e1d943b2b919de84c1aa058841 GIT binary patch literal 6148 zcmeHK%Wl&^6g?9{NqLk?-E@QGA7~{0z@$!5BrsAF)40@pu5Z-g^2H*ay&I5o|wZ^`DS_DUE1_mZwCgInMA7 zCpg0~(ZU=s2kyE9vUU%2y(Z{$<=(8{6bat5XM`>;vBYYSFDB!BF{VOZ7e86Le>8Xn zJl8BK`KK75N9~B1;x+YiOsi`5qNZ+RiUlTE)_C7*yhnJ$tjGMVDTe6R*uNX>IX>Z> z<%-$IRd#DuV;}N&me{yJjx}fg509`yhHtF9Y&*xSmhV?B-!rl{3c#BJV}6&=no;|ObxDl^+u zM{x2C%KV4w1OE|?rzQTEnLGH(`DS#VbFXGq_sd*LEpF8T?%5KZCmyXf2h0I;;MxIs zKSV5oalpc(zB*Xx5rEicvj(r_<3Kb~z&K#xkv$COr9>}v;fUe9ob6HI#Q_VCUJe%y zA1;jS!U@Ic=*%A}9WM50wK-r8R2_KWZ}(;Y?{7cxFE^hb$WGi{yeB2P{0Yg<&58YJ*kgz^yv)7d%h5ApigX literal 0 HcmV?d00001 diff --git a/miniwob/screenshot.py b/miniwob/screenshot.py index 9fe6f9bf..f333faca 100644 --- a/miniwob/screenshot.py +++ b/miniwob/screenshot.py @@ -41,7 +41,13 @@ def get_screenshot( if icc_profile: orig_icc = ImageCms.ImageCmsProfile(BytesIO(icc_profile)) srgb_icc = ImageCms.createProfile("sRGB") - pil_image = ImageCms.profileToProfile(pil_image, orig_icc, srgb_icc) + pil_image = ImageCms.profileToProfile( + pil_image, orig_icc, srgb_icc, inPlace=False + ) + + if pil_image is None: + raise ValueError("profileToProfile returned None unexpectedly") + return pil_image diff --git a/tests/test_api.py b/tests/test_api.py index 37b0733c..bc682265 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -3,7 +3,7 @@ import pytest from gymnasium import spaces from gymnasium.utils.env_checker import check_env -from gymnasium.wrappers import FlattenObservation +from gymnasium.wrappers.flatten_observation import FlattenObservation from tests.utils import get_all_registered_miniwob_envs From ee2f31e00a6e19f48774b191fbce8eb9673e8395 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 17:56:33 +0530 Subject: [PATCH 02/18] Bypassing pre-commit --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e172027a..82e47a1c 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -"""Setups the project.""" +"""Setups the project...""" import pathlib From 12cf6769d6d0e978051de48751a28da8bf744c98 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 18:00:10 +0530 Subject: [PATCH 03/18] fixed api errors --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 82e47a1c..e172027a 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -"""Setups the project...""" +"""Setups the project.""" import pathlib From 857c6b9096402dfba578e7d908cb511a9874bfd5 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 18:20:33 +0530 Subject: [PATCH 04/18] python 3.10 from 3.9 in build-docs.yml --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 2278c495..e4ae366c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.10' - name: Install dependencies run: pip install -r docs/requirements.txt From a168b64793b5177dc13eeb3d27e79a862538e84f Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 18:24:57 +0530 Subject: [PATCH 05/18] python 3.8 --- .github/workflows/build-docs.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index e4ae366c..3ad77421 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.8' - name: Install dependencies run: pip install -r docs/requirements.txt diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ff114595..1ece204e 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.8' - run: pip install pre-commit - run: pre-commit --version - run: pre-commit install From f315a2b791f68170c23db7a4fac487b3547c781e Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 18:37:51 +0530 Subject: [PATCH 06/18] reverted back to old gymnasium wrapper --- .github/workflows/build-docs.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- tests/test_api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 3ad77421..2278c495 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.9' - name: Install dependencies run: pip install -r docs/requirements.txt diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 1ece204e..ff114595 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: '3.8' + python-version: '3.10' - run: pip install pre-commit - run: pre-commit --version - run: pre-commit install diff --git a/tests/test_api.py b/tests/test_api.py index bc682265..37b0733c 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -3,7 +3,7 @@ import pytest from gymnasium import spaces from gymnasium.utils.env_checker import check_env -from gymnasium.wrappers.flatten_observation import FlattenObservation +from gymnasium.wrappers import FlattenObservation from tests.utils import get_all_registered_miniwob_envs From 71baae2002d66b41c54905d264d9944cf450e7c7 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 18:55:30 +0530 Subject: [PATCH 07/18] python 3.8 --- tests/test_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_api.py b/tests/test_api.py index 37b0733c..bc682265 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -3,7 +3,7 @@ import pytest from gymnasium import spaces from gymnasium.utils.env_checker import check_env -from gymnasium.wrappers import FlattenObservation +from gymnasium.wrappers.flatten_observation import FlattenObservation from tests.utils import get_all_registered_miniwob_envs From 8adc6a91a1192736d80419ceec1f39de8f6f803f Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 19:35:05 +0530 Subject: [PATCH 08/18] updated req gymnasium version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cc691390..52c2623a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Artificial Intelligence", ] dependencies = [ - "Gymnasium>=1.0.0a1", + "Gymnasium>=1.0.0", "Pillow>=9.0.0", "selenium>=4.5.0", "numpy>=1.18.0", From 3f45c75e8b944162daa644e48626f41080e501f9 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 19:37:08 +0530 Subject: [PATCH 09/18] updated req gymnasium version --- tests/test_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_api.py b/tests/test_api.py index bc682265..37b0733c 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -3,7 +3,7 @@ import pytest from gymnasium import spaces from gymnasium.utils.env_checker import check_env -from gymnasium.wrappers.flatten_observation import FlattenObservation +from gymnasium.wrappers import FlattenObservation from tests.utils import get_all_registered_miniwob_envs From 095fb1a0c85a3985127dd69d5daae220769cf7c3 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 19:56:26 +0530 Subject: [PATCH 10/18] updated req gymnasium version --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 52c2623a..e5098bbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "Gymnasium>=1.0.0", - "Pillow>=9.0.0", - "selenium>=4.5.0", - "numpy>=1.18.0", - "farama-notifications>=0.0.1", + "Pillow>=10.4.0", + "selenium>=4.20.0", + "numpy>=2.2.0", + "farama-notifications>=0.0.4", ] dynamic = ["version"] From dd102d6b12c56d47d3445f05d88257f52f72970c Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 20:01:02 +0530 Subject: [PATCH 11/18] updated req gymnasium version --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e5098bbc..828c469b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "Gymnasium>=1.0.0", - "Pillow>=10.4.0", - "selenium>=4.20.0", - "numpy>=2.2.0", + "Pillow>=8.3.0", + "selenium>=4.15.1", + "numpy>=1.24.0", "farama-notifications>=0.0.4", ] dynamic = ["version"] From f83b7c72770b52e89e77a0f504d92c122efffe4b Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 20:14:05 +0530 Subject: [PATCH 12/18] updated req gymnasium version --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 828c469b..52c2623a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "Gymnasium>=1.0.0", - "Pillow>=8.3.0", - "selenium>=4.15.1", - "numpy>=1.24.0", - "farama-notifications>=0.0.4", + "Pillow>=9.0.0", + "selenium>=4.5.0", + "numpy>=1.18.0", + "farama-notifications>=0.0.1", ] dynamic = ["version"] From 2fec927168586b7ea3f992ff85c63c5acb77dfb7 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 20:28:30 +0530 Subject: [PATCH 13/18] updated req gymnasium version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 52c2623a..a05f0b38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "Gymnasium>=1.0.0", "Pillow>=9.0.0", - "selenium>=4.5.0", + "selenium>=4.15.1", "numpy>=1.18.0", "farama-notifications>=0.0.1", ] From 616e3761a193d6c81e949ba7fca300f5721254a8 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 20:36:51 +0530 Subject: [PATCH 14/18] updated req gymnasium version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a05f0b38..52c2623a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "Gymnasium>=1.0.0", "Pillow>=9.0.0", - "selenium>=4.15.1", + "selenium>=4.5.0", "numpy>=1.18.0", "farama-notifications>=0.0.1", ] From 4a1c374c652207b65a9c89ebad9ec5a8e42f7df1 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 22:19:27 +0530 Subject: [PATCH 15/18] updated req gymnasium version --- miniwob/selenium_instance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/miniwob/selenium_instance.py b/miniwob/selenium_instance.py index 1d5f74e6..1cab6b0c 100644 --- a/miniwob/selenium_instance.py +++ b/miniwob/selenium_instance.py @@ -194,6 +194,7 @@ def create_driver(self): else: options.add_argument("app=" + self.url) self.driver = webdriver.Chrome(options=options) + self.driver.maximize_window() self.driver.implicitly_wait(5) if self.headless: self.driver.get(self.url) From 06bf0fa6cd0231ce0ed021a56bfd484ccb6282e3 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 22:42:50 +0530 Subject: [PATCH 16/18] updated req gymnasium version --- miniwob/environment.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/miniwob/environment.py b/miniwob/environment.py index 62d2b940..ecdfae5b 100644 --- a/miniwob/environment.py +++ b/miniwob/environment.py @@ -125,6 +125,10 @@ def reset( """ # The seed in Env is actually not used super().reset(seed=seed) + # Explicitly set NumPy's random seed to ensure deterministic observations + if seed is not None: + np.random.seed(seed) + # Hard reset the instances if needed if not self.instance or self.instance.died: logging.warning("Hard-resetting the instance ...") @@ -135,6 +139,11 @@ def reset( self.set_data_mode(options["data_mode"]) if "record_screenshots" in options: self.set_record_screenshots(options["record_screenshots"]) + + # Force a page reload to eliminate stale elements + self.instance.driver.refresh() + self.instance.wait() + # We pass lists for the instance to modify in-place. obs = [{}] infos = [{}] From 1cd986cfe743ebccdce1266a493990a5f47c6412 Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 22:51:14 +0530 Subject: [PATCH 17/18] updated req gymnasium version --- miniwob/environment.py | 9 --------- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/miniwob/environment.py b/miniwob/environment.py index ecdfae5b..62d2b940 100644 --- a/miniwob/environment.py +++ b/miniwob/environment.py @@ -125,10 +125,6 @@ def reset( """ # The seed in Env is actually not used super().reset(seed=seed) - # Explicitly set NumPy's random seed to ensure deterministic observations - if seed is not None: - np.random.seed(seed) - # Hard reset the instances if needed if not self.instance or self.instance.died: logging.warning("Hard-resetting the instance ...") @@ -139,11 +135,6 @@ def reset( self.set_data_mode(options["data_mode"]) if "record_screenshots" in options: self.set_record_screenshots(options["record_screenshots"]) - - # Force a page reload to eliminate stale elements - self.instance.driver.refresh() - self.instance.wait() - # We pass lists for the instance to modify in-place. obs = [{}] infos = [{}] diff --git a/pyproject.toml b/pyproject.toml index 52c2623a..7b72718a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Artificial Intelligence", ] dependencies = [ - "Gymnasium>=1.0.0", + "Gymnasium>=1.1.1", "Pillow>=9.0.0", "selenium>=4.5.0", "numpy>=1.18.0", From 9c888ab2af02f4a8922f4569b4262502bc91594b Mon Sep 17 00:00:00 2001 From: Jyotirmay Paliwal Date: Fri, 14 Mar 2025 23:03:19 +0530 Subject: [PATCH 18/18] updated req gymnasium version --- miniwob/selenium_instance.py | 1 - pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/miniwob/selenium_instance.py b/miniwob/selenium_instance.py index 1cab6b0c..1d5f74e6 100644 --- a/miniwob/selenium_instance.py +++ b/miniwob/selenium_instance.py @@ -194,7 +194,6 @@ def create_driver(self): else: options.add_argument("app=" + self.url) self.driver = webdriver.Chrome(options=options) - self.driver.maximize_window() self.driver.implicitly_wait(5) if self.headless: self.driver.get(self.url) diff --git a/pyproject.toml b/pyproject.toml index 7b72718a..52c2623a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Artificial Intelligence", ] dependencies = [ - "Gymnasium>=1.1.1", + "Gymnasium>=1.0.0", "Pillow>=9.0.0", "selenium>=4.5.0", "numpy>=1.18.0",