Skip to content

Commit

Permalink
[misc] Various minor fixes and improvements. (#227)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexis Duburcq <[email protected]>
  • Loading branch information
duburcqa and Alexis Duburcq authored Nov 12, 2020
1 parent 648c0ec commit 22173cf
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
cd "$RootDir/build"
cmake . -DCOMPONENT=pypi -P ./cmake_install.cmake
auditwheel repair -w "$RootDir/build/wheelhouse" "$RootDir"/build/pypi/jiminy_py/dist/*.whl
auditwheel repair -w "$RootDir/build/wheelhouse" "$RootDir"/build/pypi/dist/jiminy_py/*.whl
"${PYTHON_EXECUTABLE}" -m pip install --force-reinstall --no-deps "$RootDir"/build/wheelhouse/*.whl
- name: Upload the wheel for Linux of Jiminy_py
if: success() && github.repository == 'Wandercraft/jiminy'
Expand Down Expand Up @@ -112,11 +112,11 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_DEPLOY }}
packages_dir: build/wheelhouse/
packages_dir: build/wheelhouse
- name: Publish on PyPi the wheel of Gym Jiminy (Any platform / Any python3 version)
if: matrix.PYTHON_VERSION == '3.6' && success() && github.repository == 'Wandercraft/jiminy' && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_DEPLOY }}
packages_dir: build/pypi/gym_jiminy/
packages_dir: build/pypi/dist/gym_jiminy
2 changes: 1 addition & 1 deletion .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
python -m pip install pefile machomachomangler
Remove-Item -Recurse -Path "$RootDir/build/pypi" -Include *.tar.gz
Get-ChildItem -Recurse -Path "$RootDir/build/pypi" -Filter *.whl |
Get-ChildItem -Recurse -Path "$RootDir/build/pypi/dist/jiminy_py" -Filter *.whl |
Foreach-Object {
$wheel_path = ($_.FullName)
python "$RootDir/build_tools/wheel_repair.py" "$wheel_path" -d "$InstallDir/lib" -w "$RootDir/build/wheelhouse"
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.10)

# Set the build version
set(BUILD_VERSION 1.4.9)
set(BUILD_VERSION 1.4.10)

# Add definition of Jiminy version for C++ headers
add_definitions("-DJIMINY_VERSION=\"${BUILD_VERSION}\"")
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Beside a strong focus on performance to answer machine learning's need for runni
- Designed with machine learning in mind, with seemless wrapping of robots in `gym` environments using one-liners. Jiminy provides both the physical engine and the robot model (including sensors) required for learning.
- Easy to install: `pip` is all that is needed to [get you started](#getting-started) !
- Dedicated integration in jupyter notebook working out-of-the-box - including 3D rendering using [Meshcat](https://github.com/rdeits/MeshCat.jl). This facilitates working on remote headless environnement such as machine learning clusters.
- Rich simulation log output, easily customizable for recording, introspection and debugging. The simulation log is made available in RAM directly for fast access, and can be exported in raw binary, CSV or HDF5 format.
- Available for both Linux and Windows platform.
- Rich simulation log output, easily customizable for recording, introspection and debugging. The simulation log is made available in RAM directly for fast access, and can be exported in raw binary, CSV or [HDF5](https://portal.hdfgroup.org/display/HDF5/Introduction+to+HDF5) format.
- Available for both Linux and Windows platforms.

### Physics

Expand Down Expand Up @@ -56,7 +56,7 @@ Pre-configured environments for some well-known toys models and reference roboti

## Getting started

Jiminy is compatible with Linux and Windows and supports Python3.6+. Jiminy is distributed on PyPi for Python 3.6/3.7/3.8 on Linux and Windows, and can be installed using `pip`:
Jiminy is compatible with Linux and Windows and supports Python3.6+. Jiminy is distributed on PyPi for Python 3.6/3.7/3.8 on Linux and Windows 10, and can be installed using `pip`:

```bash
python -m pip install jiminy_py
Expand Down
8 changes: 5 additions & 3 deletions build_tools/cmake/base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ if(BUILD_PYTHON_INTERFACE)
OUTPUT_VARIABLE PYTHON_SYS_SITELIB)
message(STATUS "Python system site-packages: ${PYTHON_SYS_SITELIB}")
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -m site --user-site
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE PYTHON_USER_SITELIB)
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE PYTHON_USER_SITELIB)
message(STATUS "Python user site-package: ${PYTHON_USER_SITELIB}")

# Check write permissions on Python system site-package to
Expand All @@ -142,7 +142,7 @@ if(BUILD_PYTHON_INTERFACE)
set(HAS_NO_WRITE_PERMISSION_ON_PYTHON_SYS_SITELIB FALSE)
endif()

set(PYTHON_INSTALL_FLAGS "--upgrade --use-feature=2020-resolver ")
set(PYTHON_INSTALL_FLAGS "--use-feature=2020-resolver ")
if(${HAS_NO_WRITE_PERMISSION_ON_PYTHON_SYS_SITELIB})
set(PYTHON_INSTALL_FLAGS "${PYTHON_INSTALL_FLAGS} --user ")
set(PYTHON_SITELIB "${PYTHON_USER_SITELIB}")
Expand Down Expand Up @@ -208,6 +208,8 @@ if(BUILD_PYTHON_INTERFACE)
# The input arguments are [TARGET_NAME...]
foreach(TARGET_NAME IN LISTS ARGN)
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install ${PYTHON_INSTALL_FLAGS} .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/pypi/${TARGET_NAME})
execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install ${PYTHON_INSTALL_FLAGS} --upgrade --no-deps --force-reinstall .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/pypi/${TARGET_NAME})")
endforeach()
endfunction()
Expand Down
6 changes: 4 additions & 2 deletions build_tools/cmake/buildPythonWheel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ function(buildPythonWheel)
COMPONENT pypi
EXCLUDE_FROM_ALL
)
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py sdist bdist_wheel
--dist-dir \"${OUTPUT_DIR}\"
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py clean --all
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/pypi/${TARGET_NAME})
execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py sdist bdist_wheel
--dist-dir \"${OUTPUT_DIR}\"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/pypi/${TARGET_NAME})"
COMPONENT pypi
EXCLUDE_FROM_ALL
Expand Down
2 changes: 1 addition & 1 deletion examples/double_pendulum_py/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def internalDynamics(t, q, v, sensors_data, u):
trajectory_data_log = extract_viewer_data_from_log(log_data, robot)

# Save the log in CSV
engine.write_log(os.path.join(tempfile.gettempdir(), "log.csv"), False)
engine.write_log(os.path.join(tempfile.gettempdir(), "log.csv"))

# ############################ Display the results ######################################

Expand Down
4 changes: 2 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install(CODE "file(GLOB_RECURSE src_file_list FOLLOW_SYMLINKS

# Build Python wheels and archives
buildPythonWheel("python/${LIBRARY_NAME}_py"
"${CMAKE_BINARY_DIR}/pypi/${LIBRARY_NAME}_py/dist")
"${CMAKE_BINARY_DIR}/pypi/dist/${LIBRARY_NAME}_py")

# Install Python package jiminy_py
deployPythonPackage("${LIBRARY_NAME}_py")
Expand All @@ -34,7 +34,7 @@ deployPythonPackage("${LIBRARY_NAME}_py")
buildPythonWheel("python/gym_${LIBRARY_NAME}/common"
"python/gym_${LIBRARY_NAME}/envs"
"python/gym_${LIBRARY_NAME}/toolbox"
"${CMAKE_BINARY_DIR}/pypi/gym_${LIBRARY_NAME}")
"${CMAKE_BINARY_DIR}/pypi/dist/gym_${LIBRARY_NAME}")
deployPythonPackageDevelop("python/gym_${LIBRARY_NAME}/common"
"python/gym_${LIBRARY_NAME}/envs"
"python/gym_${LIBRARY_NAME}/toolbox")
4 changes: 3 additions & 1 deletion python/jiminy_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def finalize_options(self) -> None:
],
keywords="robotics physics simulator",
distclass=BinaryDistribution,
cmdclass={"install": InstallPlatlib},
cmdclass={
"install": InstallPlatlib
},
packages=find_packages("src"),
package_dir={"": "src"},
package_data={"jiminy_py": [
Expand Down
2 changes: 1 addition & 1 deletion python/jiminy_py/src/jiminy_py/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def run(self,
# Write log
if log_path is not None:
log_path = str(pathlib.Path(log_path).with_suffix('.data'))
self.engine.write_log(log_path, True)
self.engine.write_log(log_path)

def render(self,
return_rgb_array: bool = False,
Expand Down

0 comments on commit 22173cf

Please sign in to comment.