Skip to content

Commit

Permalink
Support Python 3.6, 3.7; add publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Jan 7, 2021
1 parent afe8528 commit b74643e
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9"]
python-version: ["3.6", "3.7", "3.8", "3.9"]

steps:
- uses: actions/checkout@v2
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![codecov](https://codecov.io/gh/brentyi/jaxlie/branch/master/graph/badge.svg)](https://codecov.io/gh/brentyi/jaxlie)

**[ [API reference](https://brentyi.github.io/jaxlie) ]**
**[ [PyPI](https://pypi.org/project/jaxlie/) ]**

`jaxlie` is a Lie theory library for rigid body transformations and optimization
in JAX.
Expand All @@ -22,6 +23,13 @@ Current functionality:

---

##### Install (Python >=3.7)
```bash
pip install jaxlie
```

---

##### Example usage

```python
Expand Down
2 changes: 1 addition & 1 deletion jaxlie/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MatrixLieGroup(abc.ABC):
space_dim: int = 0
"""Dimension of coordinates that can be transformed."""

def __init__(self, parameters: jnp.ndarray, /):
def __init__(self, parameters: jnp.ndarray):
"""Construct a group object from its underlying parameters."""

# Note that this method is implicitly overriden by the dataclass decorator and
Expand Down
8 changes: 4 additions & 4 deletions jaxlie/_so3.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __repr__(self):
return f"{self.__class__.__name__}(wxyz={wxyz})"

@staticmethod
def from_x_radians(theta) -> "SO3":
def from_x_radians(theta: float) -> "SO3":
"""Generates a x-axis rotation.
Args:
Expand All @@ -41,7 +41,7 @@ def from_x_radians(theta) -> "SO3":
return SO3.exp(jnp.array([theta, 0.0, 0.0]))

@staticmethod
def from_y_radians(theta) -> "SO3":
def from_y_radians(theta: float) -> "SO3":
"""Generates a y-axis rotation.
Args:
Expand All @@ -53,7 +53,7 @@ def from_y_radians(theta) -> "SO3":
return SO3.exp(jnp.array([0.0, theta, 0.0]))

@staticmethod
def from_z_radians(theta) -> "SO3":
def from_z_radians(theta: float) -> "SO3":
"""Generates a z-axis rotation.
Args:
Expand All @@ -65,7 +65,7 @@ def from_z_radians(theta) -> "SO3":
return SO3.exp(jnp.array([0.0, 0.0, theta]))

@staticmethod
def from_rpy_radians(roll, pitch, yaw) -> "SO3":
def from_rpy_radians(roll: float, pitch: float, yaw: float) -> "SO3":
"""Generates a transform from a set of Euler angles.
Uses the ZYX mobile robot convention.
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="jaxlie",
version="0.0.0",
version="0.0.1",
description="Matrix Lie groups in Jax",
long_description=long_description,
long_description_content_type="text/markdown",
Expand All @@ -15,16 +15,19 @@
license="MIT",
packages=find_packages(exclude=["examples", "tests"]),
package_data={"liejax": ["py.typed"]},
python_requires=">=3.7",
python_requires=">=3.6",
install_requires=[
"jax",
"jaxlib",
"numpy",
"overrides",
"dataclasses; python_version < '3.7.0'",
],
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
Expand Down

0 comments on commit b74643e

Please sign in to comment.