From 03e781905e00cffeef7b1555e6b6f690121c32f8 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Mon, 9 Oct 2023 23:09:27 +0000 Subject: [PATCH 01/16] GitHub Actions: Update mac_requirements.txt --- utils/setup/mac_requirements.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/utils/setup/mac_requirements.txt b/utils/setup/mac_requirements.txt index a240aaf5a0..94de53cac2 100644 --- a/utils/setup/mac_requirements.txt +++ b/utils/setup/mac_requirements.txt @@ -17,15 +17,16 @@ execnet==2.0.2 filelock==3.12.4 flatbuffers==23.5.26 frozenlist==1.4.0 +fsspec==2023.9.2 future==0.18.3 gast==0.4.0 -google-auth==2.23.2 +google-auth==2.23.3 google-auth-oauthlib==1.0.0 google-pasta==0.2.0 grpcio==1.49.1 Gymnasium==0.26.3 gymnasium-notices==0.0.1 -h5py==3.9.0 +h5py==3.10.0 hyperlink==21.0.0 idna==3.4 imageio==2.31.5 @@ -40,7 +41,7 @@ keras==2.13.1 lazy_loader==0.3 libclang==16.0.6 lz4==4.3.2 -Markdown==3.4.4 +Markdown==3.5 markdown-it-py==3.0.0 MarkupSafe==2.1.3 mdurl==0.1.2 @@ -60,7 +61,7 @@ pandas==2.0.3 Pillow==10.0.1 pkgutil_resolve_name==1.3.10 pluggy==1.3.0 -protobuf==4.24.3 +protobuf==4.24.4 psutil==5.9.5 py==1.11.0 py-cpuinfo==9.0.0 @@ -83,7 +84,7 @@ referencing==0.30.2 requests==2.31.0 requests-oauthlib==1.3.1 rich==13.6.0 -rpds-py==0.10.3 +rpds-py==0.10.4 rsa==4.9 scikit-image==0.21.0 scipy==1.10.1 @@ -101,8 +102,8 @@ tensorflow-probability==0.21.0 termcolor==2.3.0 tifffile==2023.7.10 tomli==2.0.1 -torch==2.0.1 -torchvision==0.15.2 +torch==2.1.0 +torchvision==0.16.0 trimesh==3.23.5 Twisted==23.8.0 typer==0.9.0 @@ -114,4 +115,4 @@ Werkzeug==3.0.0 wrapt==1.15.0 yattag==1.15.1 zipp==3.17.0 -zope.interface==6.0 +zope.interface==6.1 From 2dcef1b4a6d2f4632ad31c5ab07b55d083b40781 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Wed, 11 Oct 2023 10:37:24 -0400 Subject: [PATCH 02/16] Update installation documentation. (#2093) --- docs/setup.rst | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/setup.rst b/docs/setup.rst index 09d3163f16..851ae5bef1 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -15,12 +15,32 @@ Demo Video Prerequisites ------------- -+ ``python3 (3.8 or 3.9)`` ++ ``python3 (3.8, 3.9, 3.10, 3.11)`` + ``ubuntu (>=16.04)`` Installation ------------ +Package +^^^^^^^ + +This includes SMARTS but none of the examples. + +.. code-block:: bash + + # For Mac OS X users, ensure XQuartz is pre-installed. + # Install the system requirements. You may use the `-y` option to enable + # automatic assumption of "yes" to all prompts to avoid timeout from + # waiting for user input. + $ bash utils/setup/install_deps.sh + + # This should install the latest version of SMARTS from package index (generally PyPI). + $ pip install 'smarts[camera_obs,sumo,example]' + + +Development +^^^^^^^^^^^ + Run the following commands to setup the SMARTS simulator. .. code-block:: bash @@ -61,9 +81,11 @@ Run the following commands to setup the SMARTS simulator. # Install smarts with extras as needed. Extras include the following: # `camera_obs` - needed for rendering camera observations, and for testing. # `sumo` - needed for using SUMO scenarios. - # `test` - needed for testing. + # `test` - needed for running tests. # `example` - needed for running examples. - $ pip install -e .[camera_obs,sumo,test,example] + # `--config-settings editable_mode=strict` - may be needed depending on version of setuptools. + # See https://github.com/huawei-noah/SMARTS/issues/2090. + $ pip install -e '.[camera_obs,sumo,test,example]' --config-settings editable_mode=strict # Run sanity-test and verify they are passing. # If tests fail, check './sanity_test_result.xml' for test report. From ffa85d91a9903d4341d9f72a1b28f41055cf4178 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Wed, 11 Oct 2023 14:43:47 +0000 Subject: [PATCH 03/16] GitHub Actions: Update requirements.txt --- requirements.txt | 60 ++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0b08c89a22..56758d28f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,12 +5,11 @@ attrs==23.1.0 Automat==22.10.0 cachetools==5.3.1 certifi==2023.7.22 -charset-normalizer==3.2.0 +charset-normalizer==3.3.0 click==8.1.7 cloudpickle==2.2.1 -cmake==3.27.5 constantly==15.1.0 -coverage==7.3.1 +coverage==7.3.2 decorator==5.1.1 dm-tree==0.1.8 exceptiongroup==1.1.3 @@ -18,18 +17,19 @@ execnet==2.0.2 filelock==3.12.4 flatbuffers==23.5.26 frozenlist==1.4.0 +fsspec==2023.9.2 future==0.18.3 gast==0.4.0 -google-auth==2.23.1 +google-auth==2.23.3 google-auth-oauthlib==1.0.0 google-pasta==0.2.0 grpcio==1.51.3 Gymnasium==0.26.3 gymnasium-notices==0.0.1 -h5py==3.9.0 +h5py==3.10.0 hyperlink==21.0.0 idna==3.4 -imageio==2.31.4 +imageio==2.31.5 importlib-metadata==6.8.0 importlib-resources==6.1.0 incremental==22.10.0 @@ -40,9 +40,8 @@ jsonschema-specifications==2023.7.1 keras==2.13.1 lazy_loader==0.3 libclang==16.0.6 -lit==17.0.1 lz4==4.3.2 -Markdown==3.4.4 +Markdown==3.5 markdown-it-py==3.0.0 MarkupSafe==2.1.3 mdurl==0.1.2 @@ -50,22 +49,23 @@ mpmath==1.3.0 msgpack==1.0.7 networkx==3.1 numpy==1.24.3 -nvidia-cublas-cu11==11.10.3.66 -nvidia-cuda-cupti-cu11==11.7.101 -nvidia-cuda-nvrtc-cu11==11.7.99 -nvidia-cuda-runtime-cu11==11.7.99 -nvidia-cudnn-cu11==8.5.0.96 -nvidia-cufft-cu11==10.9.0.58 -nvidia-curand-cu11==10.2.10.91 -nvidia-cusolver-cu11==11.4.0.1 -nvidia-cusparse-cu11==11.7.4.91 -nvidia-nccl-cu11==2.14.3 -nvidia-nvtx-cu11==11.7.91 +nvidia-cublas-cu12==12.1.3.1 +nvidia-cuda-cupti-cu12==12.1.105 +nvidia-cuda-nvrtc-cu12==12.1.105 +nvidia-cuda-runtime-cu12==12.1.105 +nvidia-cudnn-cu12==8.9.2.26 +nvidia-cufft-cu12==11.0.2.54 +nvidia-curand-cu12==10.3.2.106 +nvidia-cusolver-cu12==11.4.5.107 +nvidia-cusparse-cu12==12.1.0.106 +nvidia-nccl-cu12==2.18.1 +nvidia-nvjitlink-cu12==12.2.140 +nvidia-nvtx-cu12==12.1.105 oauthlib==3.2.2 opencv-python==4.8.1.78 opencv-python-headless==4.8.1.78 opt-einsum==3.3.0 -packaging==23.1 +packaging==23.2 Panda3D==1.10.13 panda3d-gltf==0.13 panda3d-simplepbr==0.10 @@ -73,7 +73,7 @@ pandas==2.0.3 Pillow==10.0.1 pkgutil_resolve_name==1.3.10 pluggy==1.3.0 -protobuf==4.24.3 +protobuf==4.24.4 psutil==5.9.5 py==1.11.0 py-cpuinfo==9.0.0 @@ -95,8 +95,8 @@ ray==2.5.1 referencing==0.30.2 requests==2.31.0 requests-oauthlib==1.3.1 -rich==13.5.3 -rpds-py==0.10.3 +rich==13.6.0 +rpds-py==0.10.4 rsa==4.9 scikit-image==0.21.0 scipy==1.10.1 @@ -114,18 +114,18 @@ tensorflow-probability==0.21.0 termcolor==2.3.0 tifffile==2023.7.10 tomli==2.0.1 -torch==2.0.1 -torchvision==0.15.2 +torch==2.1.0 +torchvision==0.16.0 trimesh==3.23.5 -triton==2.0.0 +triton==2.1.0 Twisted==23.8.0 typer==0.9.0 typing_extensions==4.5.0 tzdata==2023.3 -urllib3==2.0.5 -wcwidth==0.2.6 -Werkzeug==2.3.7 +urllib3==2.0.6 +wcwidth==0.2.8 +Werkzeug==3.0.0 wrapt==1.15.0 yattag==1.15.1 zipp==3.17.0 -zope.interface==6.0 +zope.interface==6.1 From 9d7d2a54cf5873cf0c981915f926428371718f4f Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Mon, 16 Oct 2023 23:11:11 +0000 Subject: [PATCH 04/16] GitHub Actions: Update mac_requirements.txt --- utils/setup/mac_requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/setup/mac_requirements.txt b/utils/setup/mac_requirements.txt index 94de53cac2..0ae35c24d0 100644 --- a/utils/setup/mac_requirements.txt +++ b/utils/setup/mac_requirements.txt @@ -7,7 +7,7 @@ cachetools==5.3.1 certifi==2023.7.22 charset-normalizer==3.3.0 click==8.1.7 -cloudpickle==2.2.1 +cloudpickle==3.0.0 constantly==15.1.0 coverage==7.3.2 decorator==5.1.1 @@ -58,11 +58,11 @@ Panda3D==1.10.13 panda3d-gltf==0.13 panda3d-simplepbr==0.10 pandas==2.0.3 -Pillow==10.0.1 +Pillow==10.1.0 pkgutil_resolve_name==1.3.10 pluggy==1.3.0 protobuf==4.24.4 -psutil==5.9.5 +psutil==5.9.6 py==1.11.0 py-cpuinfo==9.0.0 pyarrow==13.0.0 @@ -84,11 +84,11 @@ referencing==0.30.2 requests==2.31.0 requests-oauthlib==1.3.1 rich==13.6.0 -rpds-py==0.10.4 +rpds-py==0.10.6 rsa==4.9 scikit-image==0.21.0 scipy==1.10.1 -shapely==2.0.1 +shapely==2.0.2 six==1.16.0 sympy==1.12 tableprint==0.9.1 @@ -104,7 +104,7 @@ tifffile==2023.7.10 tomli==2.0.1 torch==2.1.0 torchvision==0.16.0 -trimesh==3.23.5 +trimesh==4.0.0 Twisted==23.8.0 typer==0.9.0 typing_extensions==4.5.0 From 7bb8c065317c0898d07cc28304b26e9f4b465f3a Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Mon, 23 Oct 2023 23:11:53 +0000 Subject: [PATCH 05/16] GitHub Actions: Update mac_requirements.txt --- utils/setup/mac_requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/setup/mac_requirements.txt b/utils/setup/mac_requirements.txt index 0ae35c24d0..a2adee3d7c 100644 --- a/utils/setup/mac_requirements.txt +++ b/utils/setup/mac_requirements.txt @@ -5,7 +5,7 @@ attrs==23.1.0 Automat==22.10.0 cachetools==5.3.1 certifi==2023.7.22 -charset-normalizer==3.3.0 +charset-normalizer==3.3.1 click==8.1.7 cloudpickle==3.0.0 constantly==15.1.0 @@ -17,7 +17,7 @@ execnet==2.0.2 filelock==3.12.4 flatbuffers==23.5.26 frozenlist==1.4.0 -fsspec==2023.9.2 +fsspec==2023.10.0 future==0.18.3 gast==0.4.0 google-auth==2.23.3 @@ -29,7 +29,7 @@ gymnasium-notices==0.0.1 h5py==3.10.0 hyperlink==21.0.0 idna==3.4 -imageio==2.31.5 +imageio==2.31.6 importlib-metadata==6.8.0 importlib-resources==6.1.0 incremental==22.10.0 @@ -58,7 +58,7 @@ Panda3D==1.10.13 panda3d-gltf==0.13 panda3d-simplepbr==0.10 pandas==2.0.3 -Pillow==10.1.0 +Pillow==10.0.1 pkgutil_resolve_name==1.3.10 pluggy==1.3.0 protobuf==4.24.4 @@ -93,7 +93,7 @@ six==1.16.0 sympy==1.12 tableprint==0.9.1 tensorboard==2.13.0 -tensorboard-data-server==0.7.1 +tensorboard-data-server==0.7.2 tensorboardX==2.6.2.2 tensorflow==2.13.1 tensorflow-estimator==2.13.0 @@ -109,7 +109,7 @@ Twisted==23.8.0 typer==0.9.0 typing_extensions==4.5.0 tzdata==2023.3 -urllib3==2.0.6 +urllib3==2.0.7 wcwidth==0.2.8 Werkzeug==3.0.0 wrapt==1.15.0 From 66b30d344e1fbbb8f2d64a94b0566d4fbdc9dd52 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Mon, 30 Oct 2023 11:23:25 -0400 Subject: [PATCH 06/16] Fix pickling error. (#2100) --- CHANGELOG.md | 1 + envision/client_config.py | 9 +++++---- envision/tests/test_data_replay.py | 8 +++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19a30f68d3..25aabc7812 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Copy and pasting the git commit messages is __NOT__ enough. ### Deprecated ### Fixed - Fixed issue where `SumoTrafficSimulation` could get locked up on reset if a scenario had only 1 map but multiple scenario variations. +- Fixed an issue where an out-of-scope method reference caused a pickling error. ### Removed ### Security diff --git a/envision/client_config.py b/envision/client_config.py index 9e5078a055..b5e6155cbf 100644 --- a/envision/client_config.py +++ b/envision/client_config.py @@ -36,6 +36,10 @@ class SingleAttributeOverride(NamedTuple): """The maximum number of elements an iterable attribute can contain.""" +def _default_override(): + return SingleAttributeOverride(True, None) + + @dataclass(frozen=True) class EnvisionStateFilter: """A state filtering tool.""" @@ -49,7 +53,4 @@ class EnvisionStateFilter: def default(cls): """Give a new default filter.""" - def default_override(): - return SingleAttributeOverride(True, None) - - return cls(defaultdict(default_override), defaultdict(default_override)) + return cls(defaultdict(_default_override), defaultdict(_default_override)) diff --git a/envision/tests/test_data_replay.py b/envision/tests/test_data_replay.py index a98bbe5c2c..5ac7b44a5c 100644 --- a/envision/tests/test_data_replay.py +++ b/envision/tests/test_data_replay.py @@ -42,11 +42,13 @@ TIMESTEP_SEC = 0.1 +class KeepLaneAgent(Agent): + def act(self, obs): + return "keep_lane" + + @pytest.fixture def agent_spec(): - class KeepLaneAgent(Agent): - def act(self, obs): - return "keep_lane" return AgentSpec( interface=AgentInterface.from_type( From 0de1d9cb03f37325a5600337485286f2e6c09f73 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Mon, 30 Oct 2023 15:29:05 +0000 Subject: [PATCH 07/16] GitHub Actions: Update requirements.txt --- requirements.txt | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/requirements.txt b/requirements.txt index 56758d28f3..eda3f645ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,21 +3,21 @@ aiosignal==1.3.1 astunparse==1.6.3 attrs==23.1.0 Automat==22.10.0 -cachetools==5.3.1 +cachetools==5.3.2 certifi==2023.7.22 -charset-normalizer==3.3.0 +charset-normalizer==3.3.1 click==8.1.7 -cloudpickle==2.2.1 -constantly==15.1.0 +cloudpickle==3.0.0 +constantly==23.10.4 coverage==7.3.2 decorator==5.1.1 dm-tree==0.1.8 exceptiongroup==1.1.3 execnet==2.0.2 -filelock==3.12.4 +filelock==3.13.0 flatbuffers==23.5.26 frozenlist==1.4.0 -fsspec==2023.9.2 +fsspec==2023.10.0 future==0.18.3 gast==0.4.0 google-auth==2.23.3 @@ -29,13 +29,13 @@ gymnasium-notices==0.0.1 h5py==3.10.0 hyperlink==21.0.0 idna==3.4 -imageio==2.31.5 +imageio==2.31.6 importlib-metadata==6.8.0 importlib-resources==6.1.0 incremental==22.10.0 iniconfig==2.0.0 Jinja2==3.1.2 -jsonschema==4.19.1 +jsonschema==4.19.2 jsonschema-specifications==2023.7.1 keras==2.13.1 lazy_loader==0.3 @@ -59,7 +59,7 @@ nvidia-curand-cu12==10.3.2.106 nvidia-cusolver-cu12==11.4.5.107 nvidia-cusparse-cu12==12.1.0.106 nvidia-nccl-cu12==2.18.1 -nvidia-nvjitlink-cu12==12.2.140 +nvidia-nvjitlink-cu12==12.3.52 nvidia-nvtx-cu12==12.1.105 oauthlib==3.2.2 opencv-python==4.8.1.78 @@ -74,7 +74,7 @@ Pillow==10.0.1 pkgutil_resolve_name==1.3.10 pluggy==1.3.0 protobuf==4.24.4 -psutil==5.9.5 +psutil==5.9.6 py==1.11.0 py-cpuinfo==9.0.0 pyarrow==13.0.0 @@ -82,7 +82,7 @@ pyasn1==0.5.0 pyasn1-modules==0.3.0 pybullet==3.2.5 Pygments==2.16.1 -pytest==7.4.2 +pytest==7.4.3 pytest-benchmark==4.0.0 pytest-cov==4.1.0 pytest-forked==1.6.0 @@ -96,16 +96,16 @@ referencing==0.30.2 requests==2.31.0 requests-oauthlib==1.3.1 rich==13.6.0 -rpds-py==0.10.4 +rpds-py==0.10.6 rsa==4.9 scikit-image==0.21.0 scipy==1.10.1 -shapely==2.0.1 +shapely==2.0.2 six==1.16.0 sympy==1.12 tableprint==0.9.1 tensorboard==2.13.0 -tensorboard-data-server==0.7.1 +tensorboard-data-server==0.7.2 tensorboardX==2.6.2.2 tensorflow==2.13.1 tensorflow-estimator==2.13.0 @@ -116,16 +116,16 @@ tifffile==2023.7.10 tomli==2.0.1 torch==2.1.0 torchvision==0.16.0 -trimesh==3.23.5 +trimesh==4.0.1 triton==2.1.0 Twisted==23.8.0 typer==0.9.0 typing_extensions==4.5.0 tzdata==2023.3 -urllib3==2.0.6 +urllib3==2.0.7 wcwidth==0.2.8 -Werkzeug==3.0.0 +Werkzeug==3.0.1 wrapt==1.15.0 -yattag==1.15.1 +yattag==1.15.2 zipp==3.17.0 zope.interface==6.1 From fc90e72443e71e82a53503a39825a7801bfda38e Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Mon, 30 Oct 2023 23:09:45 +0000 Subject: [PATCH 08/16] GitHub Actions: Update mac_requirements.txt --- utils/setup/mac_requirements.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/utils/setup/mac_requirements.txt b/utils/setup/mac_requirements.txt index a2adee3d7c..60207aae66 100644 --- a/utils/setup/mac_requirements.txt +++ b/utils/setup/mac_requirements.txt @@ -3,18 +3,18 @@ aiosignal==1.3.1 astunparse==1.6.3 attrs==23.1.0 Automat==22.10.0 -cachetools==5.3.1 +cachetools==5.3.2 certifi==2023.7.22 charset-normalizer==3.3.1 click==8.1.7 cloudpickle==3.0.0 -constantly==15.1.0 +constantly==23.10.4 coverage==7.3.2 decorator==5.1.1 dm-tree==0.1.8 exceptiongroup==1.1.3 execnet==2.0.2 -filelock==3.12.4 +filelock==3.13.1 flatbuffers==23.5.26 frozenlist==1.4.0 fsspec==2023.10.0 @@ -35,7 +35,7 @@ importlib-resources==6.1.0 incremental==22.10.0 iniconfig==2.0.0 Jinja2==3.1.2 -jsonschema==4.19.1 +jsonschema==4.19.2 jsonschema-specifications==2023.7.1 keras==2.13.1 lazy_loader==0.3 @@ -70,7 +70,7 @@ pyasn1==0.5.0 pyasn1-modules==0.3.0 pybullet==3.2.5 Pygments==2.16.1 -pytest==7.4.2 +pytest==7.4.3 pytest-benchmark==4.0.0 pytest-cov==4.1.0 pytest-forked==1.6.0 @@ -104,15 +104,15 @@ tifffile==2023.7.10 tomli==2.0.1 torch==2.1.0 torchvision==0.16.0 -trimesh==4.0.0 +trimesh==4.0.1 Twisted==23.8.0 typer==0.9.0 typing_extensions==4.5.0 tzdata==2023.3 urllib3==2.0.7 -wcwidth==0.2.8 -Werkzeug==3.0.0 +wcwidth==0.2.9 +Werkzeug==3.0.1 wrapt==1.15.0 -yattag==1.15.1 +yattag==1.15.2 zipp==3.17.0 zope.interface==6.1 From 98bfa4bf3de6ffb75f338254d11ee4459ff93016 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Wed, 1 Nov 2023 15:48:24 -0400 Subject: [PATCH 09/16] Fix lambda cannot be serialized. (#2102) * Fix issue where a lambda cannot be serialized. * Update changelog. * Make format. --- CHANGELOG.md | 1 + envision/data_formatter.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25aabc7812..8720e3399f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Copy and pasting the git commit messages is __NOT__ enough. ### Fixed - Fixed issue where `SumoTrafficSimulation` could get locked up on reset if a scenario had only 1 map but multiple scenario variations. - Fixed an issue where an out-of-scope method reference caused a pickling error. +- Fixed an issue where the `EnvisionDataFormatterArgs` default would use a locally defined lambda and cause a serialization failure. ### Removed ### Security diff --git a/envision/data_formatter.py b/envision/data_formatter.py index 1a0dae4e36..3e8a124bac 100644 --- a/envision/data_formatter.py +++ b/envision/data_formatter.py @@ -75,6 +75,10 @@ class Operation(IntEnum): _primitives = {int, float, str, VehicleType, TrafficActorType} +def _passthrough_method_1_arg(v): + return v + + class ReductionContext: """Mappings between an object and its reduction to an ID.""" @@ -126,7 +130,7 @@ class EnvisionDataFormatterArgs(NamedTuple): """Data formatter configurations.""" id: Optional[str] - serializer: Callable[[list], Any] = lambda d: d + serializer: Callable[[list], Any] = _passthrough_method_1_arg float_decimals: int = 2 bool_as_int: bool = True enable_reduction: bool = True From e6f9f95ca8abc160b84f6da5710867ffcbdd2211 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Wed, 1 Nov 2023 19:54:11 +0000 Subject: [PATCH 10/16] GitHub Actions: Update requirements.txt --- requirements.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index eda3f645ff..185d7301f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ attrs==23.1.0 Automat==22.10.0 cachetools==5.3.2 certifi==2023.7.22 -charset-normalizer==3.3.1 +charset-normalizer==3.3.2 click==8.1.7 cloudpickle==3.0.0 constantly==23.10.4 @@ -14,13 +14,13 @@ decorator==5.1.1 dm-tree==0.1.8 exceptiongroup==1.1.3 execnet==2.0.2 -filelock==3.13.0 +filelock==3.13.1 flatbuffers==23.5.26 frozenlist==1.4.0 fsspec==2023.10.0 future==0.18.3 gast==0.4.0 -google-auth==2.23.3 +google-auth==2.23.4 google-auth-oauthlib==1.0.0 google-pasta==0.2.0 grpcio==1.51.3 @@ -41,7 +41,7 @@ keras==2.13.1 lazy_loader==0.3 libclang==16.0.6 lz4==4.3.2 -Markdown==3.5 +Markdown==3.5.1 markdown-it-py==3.0.0 MarkupSafe==2.1.3 mdurl==0.1.2 @@ -77,7 +77,7 @@ protobuf==4.24.4 psutil==5.9.6 py==1.11.0 py-cpuinfo==9.0.0 -pyarrow==13.0.0 +pyarrow==14.0.0 pyasn1==0.5.0 pyasn1-modules==0.3.0 pybullet==3.2.5 @@ -116,14 +116,14 @@ tifffile==2023.7.10 tomli==2.0.1 torch==2.1.0 torchvision==0.16.0 -trimesh==4.0.1 +trimesh==4.0.2 triton==2.1.0 -Twisted==23.8.0 +Twisted==23.10.0 typer==0.9.0 typing_extensions==4.5.0 tzdata==2023.3 urllib3==2.0.7 -wcwidth==0.2.8 +wcwidth==0.2.9 Werkzeug==3.0.1 wrapt==1.15.0 yattag==1.15.2 From 0f4a739d9ae2350cc53acbbbfac06f7c2dc58b75 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Mon, 6 Nov 2023 23:09:31 +0000 Subject: [PATCH 11/16] GitHub Actions: Update mac_requirements.txt --- utils/setup/mac_requirements.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/utils/setup/mac_requirements.txt b/utils/setup/mac_requirements.txt index 60207aae66..6d1aec02ac 100644 --- a/utils/setup/mac_requirements.txt +++ b/utils/setup/mac_requirements.txt @@ -5,7 +5,7 @@ attrs==23.1.0 Automat==22.10.0 cachetools==5.3.2 certifi==2023.7.22 -charset-normalizer==3.3.1 +charset-normalizer==3.3.2 click==8.1.7 cloudpickle==3.0.0 constantly==23.10.4 @@ -20,7 +20,7 @@ frozenlist==1.4.0 fsspec==2023.10.0 future==0.18.3 gast==0.4.0 -google-auth==2.23.3 +google-auth==2.23.4 google-auth-oauthlib==1.0.0 google-pasta==0.2.0 grpcio==1.49.1 @@ -29,7 +29,7 @@ gymnasium-notices==0.0.1 h5py==3.10.0 hyperlink==21.0.0 idna==3.4 -imageio==2.31.6 +imageio==2.32.0 importlib-metadata==6.8.0 importlib-resources==6.1.0 incremental==22.10.0 @@ -41,7 +41,7 @@ keras==2.13.1 lazy_loader==0.3 libclang==16.0.6 lz4==4.3.2 -Markdown==3.5 +Markdown==3.5.1 markdown-it-py==3.0.0 MarkupSafe==2.1.3 mdurl==0.1.2 @@ -61,11 +61,11 @@ pandas==2.0.3 Pillow==10.0.1 pkgutil_resolve_name==1.3.10 pluggy==1.3.0 -protobuf==4.24.4 +protobuf==4.25.0 psutil==5.9.6 py==1.11.0 py-cpuinfo==9.0.0 -pyarrow==13.0.0 +pyarrow==14.0.0 pyasn1==0.5.0 pyasn1-modules==0.3.0 pybullet==3.2.5 @@ -84,7 +84,7 @@ referencing==0.30.2 requests==2.31.0 requests-oauthlib==1.3.1 rich==13.6.0 -rpds-py==0.10.6 +rpds-py==0.12.0 rsa==4.9 scikit-image==0.21.0 scipy==1.10.1 @@ -104,8 +104,8 @@ tifffile==2023.7.10 tomli==2.0.1 torch==2.1.0 torchvision==0.16.0 -trimesh==4.0.1 -Twisted==23.8.0 +trimesh==4.0.2 +Twisted==23.10.0 typer==0.9.0 typing_extensions==4.5.0 tzdata==2023.3 From e3a1a7650a9cc3633cf6891a03cfd1c3180b7e88 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Tue, 7 Nov 2023 08:10:55 -0500 Subject: [PATCH 12/16] Prevent user warning configuration from being overwritten. (#2105) * Prevent user warning configuration from being overwritten. * Update changelog. --- CHANGELOG.md | 2 ++ envision/server.py | 3 --- examples/e2_single_agent.py | 6 ++++++ examples/replay/replay_klws_agent.py | 3 +-- smarts/__init__.py | 11 ++++++++--- smarts/core/agent.py | 2 -- smarts/zoo/agent_spec.py | 2 -- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8720e3399f..d8586468fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ Copy and pasting the git commit messages is __NOT__ enough. - Fixed issue where `SumoTrafficSimulation` could get locked up on reset if a scenario had only 1 map but multiple scenario variations. - Fixed an issue where an out-of-scope method reference caused a pickling error. - Fixed an issue where the `EnvisionDataFormatterArgs` default would use a locally defined lambda and cause a serialization failure. +- Fixed an issue where user configuration was being overridden. +- Fixed a `pkg_resources` deprecation warning in `python3.10` and up. ### Removed ### Security diff --git a/envision/server.py b/envision/server.py index 8069a6177f..065b898940 100644 --- a/envision/server.py +++ b/envision/server.py @@ -50,9 +50,6 @@ from envision.web import dist as web_dist from smarts.core.utils.file import path2hash -logging.basicConfig(level=logging.WARNING) - - # Mapping of simulation IDs to a set of web client run loops WEB_CLIENT_RUN_LOOPS = {} diff --git a/examples/e2_single_agent.py b/examples/e2_single_agent.py index 07d34570c1..da3d223761 100644 --- a/examples/e2_single_agent.py +++ b/examples/e2_single_agent.py @@ -1,11 +1,17 @@ """This example shows how you might run a SMARTS environment for single-agent work. SMARTS is natively multi-agent so a single-agent wrapper is used.""" import argparse +import logging import random import sys +import warnings from pathlib import Path from typing import Final +logging.basicConfig(level=logging.ERROR) +warnings.filterwarnings("ignore") + + import gymnasium as gym SMARTS_REPO_PATH = Path(__file__).parents[1].absolute() diff --git a/examples/replay/replay_klws_agent.py b/examples/replay/replay_klws_agent.py index b94c92c459..ae2abfeb34 100644 --- a/examples/replay/replay_klws_agent.py +++ b/examples/replay/replay_klws_agent.py @@ -14,8 +14,6 @@ from smarts.env.utils.observation_conversion import ObservationOptions from smarts.zoo.registry import make as zoo_make -logging.basicConfig(level=logging.INFO) - AGENT_ID = "Agent-007" @@ -116,6 +114,7 @@ def main(scenarios, sim_name, headless, seed, speed, max_steps, save_dir, write) if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) parser = default_argument_parser("klws-agent-example") parser.add_argument( "--speed", diff --git a/smarts/__init__.py b/smarts/__init__.py index 607d6c6631..23907bd163 100644 --- a/smarts/__init__.py +++ b/smarts/__init__.py @@ -18,8 +18,13 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +try: + from importlib.metadata import version -import pkg_resources + VERSION = version("smarts") +except: + # This is now deprecated `https://setuptools.pypa.io/en/latest/pkg_resources.html` + import pkg_resources -# The full version, including alpha/beta/rc tags -VERSION = pkg_resources.get_distribution("smarts").version + # The full version, including alpha/beta/rc tags + VERSION = pkg_resources.get_distribution("smarts").version diff --git a/smarts/core/agent.py b/smarts/core/agent.py index 0116125067..9b0b3bee37 100644 --- a/smarts/core/agent.py +++ b/smarts/core/agent.py @@ -21,8 +21,6 @@ import warnings from typing import Any, Callable -warnings.simplefilter("once") - logger = logging.getLogger(__name__) diff --git a/smarts/zoo/agent_spec.py b/smarts/zoo/agent_spec.py index b44f23e4f6..70a0505fe5 100644 --- a/smarts/zoo/agent_spec.py +++ b/smarts/zoo/agent_spec.py @@ -27,8 +27,6 @@ from smarts.core.agent import Agent from smarts.core.agent_interface import AgentInterface -warnings.simplefilter("once") - @dataclass class AgentSpec(object): From d629e0aa40149f8f4c26065996d5936f0532ce57 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Tue, 7 Nov 2023 13:15:39 +0000 Subject: [PATCH 13/16] GitHub Actions: Update requirements.txt --- requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 185d7301f1..cc95d1b7d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,9 +29,9 @@ gymnasium-notices==0.0.1 h5py==3.10.0 hyperlink==21.0.0 idna==3.4 -imageio==2.31.6 +imageio==2.32.0 importlib-metadata==6.8.0 -importlib-resources==6.1.0 +importlib-resources==6.1.1 incremental==22.10.0 iniconfig==2.0.0 Jinja2==3.1.2 @@ -73,7 +73,7 @@ pandas==2.0.3 Pillow==10.0.1 pkgutil_resolve_name==1.3.10 pluggy==1.3.0 -protobuf==4.24.4 +protobuf==4.25.0 psutil==5.9.6 py==1.11.0 py-cpuinfo==9.0.0 @@ -96,7 +96,7 @@ referencing==0.30.2 requests==2.31.0 requests-oauthlib==1.3.1 rich==13.6.0 -rpds-py==0.10.6 +rpds-py==0.12.0 rsa==4.9 scikit-image==0.21.0 scipy==1.10.1 From 7cd8c4c4bd902527710e783febcebf562a2341c3 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Thu, 9 Nov 2023 16:27:14 -0500 Subject: [PATCH 14/16] Fix likely cause of `smarts.__del__` call in `ros_driver`. (#2106) * Fix likely cause of smarts.__del__ call. * Update with fix. --- CHANGELOG.md | 1 + smarts/ros/src/smarts_ros/scripts/ros_driver.py | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8586468fa..a499bdfb5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Copy and pasting the git commit messages is __NOT__ enough. ### Changed ### Deprecated ### Fixed +- Fixed an issue where `SMARTS` might not be explicitly destroyed in the `ros_driver`. - Fixed issue where `SumoTrafficSimulation` could get locked up on reset if a scenario had only 1 map but multiple scenario variations. - Fixed an issue where an out-of-scope method reference caused a pickling error. - Fixed an issue where the `EnvisionDataFormatterArgs` default would use a locally defined lambda and cause a serialization failure. diff --git a/smarts/ros/src/smarts_ros/scripts/ros_driver.py b/smarts/ros/src/smarts_ros/scripts/ros_driver.py index 1a06e461e4..5ab09ef319 100755 --- a/smarts/ros/src/smarts_ros/scripts/ros_driver.py +++ b/smarts/ros/src/smarts_ros/scripts/ros_driver.py @@ -684,15 +684,15 @@ def run_forever(self): self._publish_state() self._publish_agents(observations, dones) - except Exception as e: - if isinstance(e, rospy.ROSInterruptException): - raise e + except Exception as ex: + if isinstance(ex, rospy.ROSInterruptException): + raise ex batch_mode = rospy.get_param("~batch_mode", False) if not batch_mode: - raise e + raise ex import traceback - rospy.logerr(f"SMARTS raised exception: {e}") + rospy.logerr(f"SMARTS raised exception: {ex}") rospy.logerr(traceback.format_exc()) rospy.logerr("Will wait for next reset...") self._smarts = None @@ -712,8 +712,8 @@ def run_forever(self): except rospy.ROSInterruptException: rospy.loginfo("ROS interrupted. exiting...") - - self._reset() # cleans up the SMARTS instance... + finally: + self._reset() # cleans up the SMARTS instance... if __name__ == "__main__": From bc4129f5e609af81f1b8df6c8daa6875c1277452 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Thu, 9 Nov 2023 21:33:03 +0000 Subject: [PATCH 15/16] GitHub Actions: Update requirements.txt --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index cc95d1b7d4..94e85ed919 100644 --- a/requirements.txt +++ b/requirements.txt @@ -77,7 +77,7 @@ protobuf==4.25.0 psutil==5.9.6 py==1.11.0 py-cpuinfo==9.0.0 -pyarrow==14.0.0 +pyarrow==14.0.1 pyasn1==0.5.0 pyasn1-modules==0.3.0 pybullet==3.2.5 @@ -116,7 +116,7 @@ tifffile==2023.7.10 tomli==2.0.1 torch==2.1.0 torchvision==0.16.0 -trimesh==4.0.2 +trimesh==4.0.3 triton==2.1.0 Twisted==23.10.0 typer==0.9.0 @@ -125,7 +125,7 @@ tzdata==2023.3 urllib3==2.0.7 wcwidth==0.2.9 Werkzeug==3.0.1 -wrapt==1.15.0 +wrapt==1.16.0 yattag==1.15.2 zipp==3.17.0 zope.interface==6.1 From c164c5cf04f4d361d149788ac57bace0e4720b13 Mon Sep 17 00:00:00 2001 From: Tucker Alban Date: Mon, 13 Nov 2023 23:09:39 +0000 Subject: [PATCH 16/16] GitHub Actions: Update mac_requirements.txt --- utils/setup/mac_requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/setup/mac_requirements.txt b/utils/setup/mac_requirements.txt index 6d1aec02ac..b301bfa7d0 100644 --- a/utils/setup/mac_requirements.txt +++ b/utils/setup/mac_requirements.txt @@ -31,7 +31,7 @@ hyperlink==21.0.0 idna==3.4 imageio==2.32.0 importlib-metadata==6.8.0 -importlib-resources==6.1.0 +importlib-resources==6.1.1 incremental==22.10.0 iniconfig==2.0.0 Jinja2==3.1.2 @@ -65,7 +65,7 @@ protobuf==4.25.0 psutil==5.9.6 py==1.11.0 py-cpuinfo==9.0.0 -pyarrow==14.0.0 +pyarrow==14.0.1 pyasn1==0.5.0 pyasn1-modules==0.3.0 pybullet==3.2.5 @@ -74,7 +74,7 @@ pytest==7.4.3 pytest-benchmark==4.0.0 pytest-cov==4.1.0 pytest-forked==1.6.0 -pytest-xdist==3.3.1 +pytest-xdist==3.4.0 python-dateutil==2.8.2 pytz==2023.3.post1 PyWavelets==1.4.1 @@ -104,15 +104,15 @@ tifffile==2023.7.10 tomli==2.0.1 torch==2.1.0 torchvision==0.16.0 -trimesh==4.0.2 +trimesh==4.0.4 Twisted==23.10.0 typer==0.9.0 typing_extensions==4.5.0 tzdata==2023.3 -urllib3==2.0.7 -wcwidth==0.2.9 +urllib3==2.1.0 +wcwidth==0.2.10 Werkzeug==3.0.1 -wrapt==1.15.0 +wrapt==1.16.0 yattag==1.15.2 zipp==3.17.0 zope.interface==6.1