Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert - to _ in options.extras_require #1756

Merged
merged 2 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-auto-commit-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python3.7 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip wheel
pip install .[camera-obs,rllib,test,torch,train]
pip install .[camera_obs,rllib,test,torch,train]
- name: Update requirements
run: |
. ${{env.venv_dir}}/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-auto-commit-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
python3.8 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip wheel
pip install .[camera-obs,rllib,test,torch,train]
pip install .[camera_obs,rllib,test,torch,train]
pip freeze | grep -v 'smarts' | grep -v 'pkg-resources==0.0.0' > utils/setup/mac_requirements.txt
- name: Commit changes
uses: EndBug/add-and-commit@v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-base-tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install --upgrade wheel
pip install -e .[camera-obs,opendrive,rllib,test,test-notebook,torch,train,gym]
pip install -e .[camera_obs,opendrive,rllib,test,test_notebook,torch,train,gym]
- name: Run smoke tests
run: |
. ${{env.venv_dir}}/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-base-tests-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
pip install --upgrade pip
pip install --upgrade wheel
pip install -r utils/setup/mac_requirements.txt
pip install -e .[camera-obs,opendrive,rllib,test,test-notebook,torch,train]
pip install -e .[camera_obs,opendrive,rllib,test,test_notebook,torch,train]
- name: Run smoke tests
run: |
. ${{env.venv_dir}}/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
python3.7 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip wheel
pip install -e .[dev,camera-obs,train,test]
pip install -e .[dev,camera_obs,train,test]
- name: Get changed files on branch since branching
id: changed-files
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install --upgrade wheel
pip install .[camera-obs,rllib,test,torch,train]
pip install .[camera_obs,rllib,test,torch,train]
- name: SMARTS benchmark
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -32,6 +32,6 @@ jobs:
scl scenario build-all --clean ./scenarios
pytest --benchmark-save=previous --benchmark-min-rounds=10 --benchmark-timer=time.process_time ./smarts/env/tests/test_benchmark.py
git checkout -
pip install .[camera-obs,rllib,test,torch,train]
pip install .[camera_obs,rllib,test,torch,train]
scl scenario build-all --clean ./scenarios
pytest --benchmark-compare=0001_previous --benchmark-compare-fail=mean:10% --benchmark-min-rounds=10 --benchmark-timer=time.process_time ./smarts/env/tests/test_benchmark.py
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-learning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install wheel
pip install .[camera-obs,rllib,test,torch,train]
pip install .[camera_obs,rllib,test,torch,train]
- name: Verify learning
run: |
cd $GITHUB_WORKSPACE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-long-determinism.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
python3.7 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install .[camera-obs,rllib,test,torch,train]
pip install .[camera_obs,rllib,test,torch,train]
- name: Verify long determinism
run: |
cd $GITHUB_WORKSPACE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-memory-growth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
pip install --upgrade pip
pip install wheel
pip install pympler
pip install .[camera-obs,rllib,test,torch,train]
pip install .[camera_obs,rllib,test,torch,train]
- name: Test memory growth
run: |
cd $GITHUB_WORKSPACE
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ source .venv/bin/activate
pip install --upgrade pip

# Install smarts with extras as needed. Extras include the following:
# `camera-obs` - needed for rendering camera sensor observations, and for testing.
# `camera_obs` - needed for rendering camera sensor observations, and for testing.
# `test` - needed for testing.
# `train` - needed for RL training and testing.
pip install -e '.[camera-obs,test,train]'
pip install -e '.[camera_obs,test,train]'

# Run sanity-test and verify they are passing.
# If tests fail, check './sanity_test_result.xml' for test report.
Expand Down
4 changes: 2 additions & 2 deletions docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ To setup the simulator, which is called SMARTS, run the following commands,
# install [train] version of python package with the rllib dependencies
pip install -e .[train]

# OPTIONAL: install [camera-obs] version of python package with the panda3D dependencies if you want to render camera sensor observations in your simulations
pip install -e .[camera-obs]
# OPTIONAL: install [camera_obs] version of python package with the panda3D dependencies if you want to render camera sensor observations in your simulations
pip install -e .[camera_obs]

# OPTIONAL: install [opendrive] version of python package with the OpenDRIVE related dependencies if you are using the any OpenDRIVE related scenarios
pip install -e .[opendrive]
Expand Down
2 changes: 1 addition & 1 deletion docs/sim/observations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ See implementation in :class:`smarts.core.sensors`


Then, you can choose the observations needed through :class:`smarts.core.agent_interface.AgentInterface` and process these raw observations through :class:`smarts.core.observation_adapter`.
Note: Some observations like `occupancy_grid_map`, `drivable_area_grid_map` and `top_down_rgb` requires the use of Panda3D package to render agent camera observations during simulations. So you need to install the required dependencies first using the command `pip install -e .[camera-obs]`
Note: Some observations like `occupancy_grid_map`, `drivable_area_grid_map` and `top_down_rgb` requires the use of Panda3D package to render agent camera observations during simulations. So you need to install the required dependencies first using the command `pip install -e .[camera_obs]`

=======
Rewards
Expand Down
10 changes: 6 additions & 4 deletions examples/env/create_run_visualize.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"outputs": [],
"source": [
"!git clone https://github.com/huawei-noah/SMARTS 2> /dev/null\n",
"!cd SMARTS && ls && git checkout develop && pip install .[camera-obs]"
"!cd SMARTS && ls && git checkout develop && pip install .[camera_obs]"
]
},
{
Expand Down Expand Up @@ -129,9 +129,6 @@
"name": "mock_demo.ipynb",
"provenance": []
},
"interpreter": {
"hash": "11a534571de20c647cd170207b7bb5d28d7f55463a5594e721a86394d5987d81"
},
"kernelspec": {
"display_name": "Python 3.8.10 ('.venv': venv)",
"language": "python",
Expand All @@ -148,6 +145,11 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
},
"vscode": {
"interpreter": {
"hash": "94261e0756b8490ed1a668b85ed1da8c98261f1072b842b18d4e3da7517b644d"
}
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions examples/multi_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"source": [
"# Install SMARTS\n",
"!git clone https://github.com/huawei-noah/SMARTS /content/SMARTS\n",
"!cd SMARTS && ls && git checkout ipynb-test-deps && pip install .[camera-obs]"
"!cd SMARTS && ls && git checkout ipynb-test-deps && pip install .[camera_obs]"
]
},
{
Expand Down Expand Up @@ -166,7 +166,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
"version": "3.7.13"
},
"orig_nbformat": 4
},
Expand Down
2 changes: 1 addition & 1 deletion examples/single_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"source": [
"# Install SMARTS\n",
"!git clone https://github.com/huawei-noah/SMARTS /content/SMARTS\n",
"!cd SMARTS && ls && git checkout ipynb-test-deps && pip install .[camera-obs]"
"!cd SMARTS && ls && git checkout ipynb-test-deps && pip install .[camera_obs]"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ console_scripts =
[options.extras_require]
benchmark = py-cpuinfo==9.0.0
mdutils==1.4.0
camera-obs = Panda3D==1.10.9
camera_obs = Panda3D==1.10.9
panda3d-gltf==0.13
dev = black[jupyter]==22.6.0
grpcio-tools==1.32.0
Expand All @@ -91,7 +91,7 @@ test = # The following are for testing
pytest-cov>=3.0.0
pytest-xdist>=2.4.0
pytest-forked>=1.4.0
test-notebook = ipykernel>=4.10.1
test_notebook = ipykernel>=4.10.1
jupyter-client>=7.1.2
pytest-notebook>=0.7.0
torch = torch==1.4.0
Expand Down
2 changes: 1 addition & 1 deletion smarts/core/utils/custom_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RendererException(Exception):
def required_to(cls, thing: str) -> "RendererException":
"""Generate a `RenderException` requiring a render to do `thing`."""
return cls(
f"""A renderer is required to {thing}. You may not have installed the [camera-obs] dependencies required to render the camera sensor observations. Install them first using the command `pip install -e .[camera-obs]` at the source directory."""
f"""A renderer is required to {thing}. You may not have installed the [camera_obs] dependencies required to render the camera sensor observations. Install them first using the command `pip install -e .[camera_obs]` at the source directory."""
)


Expand Down
2 changes: 1 addition & 1 deletion smarts/zoo/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
except ImportError:
if mod == "panda3d":
print(
"You need to install the panda3d dependency using pip install -e .[camera-obs] first"
"You need to install the panda3d dependency using pip install -e .[camera_obs] first"
)
pass

Expand Down
2 changes: 1 addition & 1 deletion utils/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt
# Copy source files and install.
COPY . /src
WORKDIR /src
RUN pip install --no-cache-dir -e .[camera-obs,dev,rllib,test,torch,train] && \
RUN pip install --no-cache-dir -e .[camera_obs,dev,rllib,test,torch,train] && \
cp -r /src/smarts.egg-info /media/smarts.egg-info

# For Envision.
Expand Down
2 changes: 1 addition & 1 deletion utils/singularity/smarts.def
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ From: ubuntu:bionic

# Copy source files and install SMARTS
cd /src
pip install --no-cache-dir -e .[train,test,dev,camera-obs]
pip install --no-cache-dir -e .[train,test,dev,camera_obs]
cp -r /src/smarts.egg-info /media/smarts.egg-info

%environment
Expand Down