Commit 08647119 authored by Boris Bonev's avatar Boris Bonev
Browse files

Added unit testing to github workflow

parent 02283d63
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
# - name: Install torch-harmonics
# run: |
# CWD=`pwd`
# echo 'Cloning repos in ${CWD}'
# mkdir git_repos
# cd git_repos
# git clone git@github.com:NVIDIA/torch-harmonics.git
# cd torch-harmonics
# python -m pip install -e .
# cd ../..
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel
- name: Install package
run: |
python -m pip install -e .
- name: Test with pytest
run: |
pip install pytest pytest-cov
pytest ./torch_harmonics/tests.py
\ No newline at end of file
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
## Versioning ## Versioning
### v0.6.2
* Adding github CI
### v0.6.1 ### v0.6.1
* Minor bugfixes to export SFNO code * Minor bugfixes to export SFNO code
......
...@@ -32,7 +32,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ...@@ -32,7 +32,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<img src="https://raw.githubusercontent.com/NVIDIA/torch-harmonics/main/images/logo/logo.png" width="568"> <img src="https://raw.githubusercontent.com/NVIDIA/torch-harmonics/main/images/logo/logo.png" width="568">
<br> <br>
<a href="https://pypi.org/project/torch_harmonics/"><img src="https://img.shields.io/pypi/v/torch_harmonics"></a> <a href="https://pypi.org/project/torch_harmonics/"><img src="https://img.shields.io/pypi/v/torch_harmonics"></a>
</p> </p>
<!-- <!--
...@@ -43,11 +42,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ...@@ -43,11 +42,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<!-- ## What is torch-harmonics? --> <!-- ## What is torch-harmonics? -->
`torch_harmonics` is a differentiable implementation of the Spherical Harmonic transform in PyTorch. It was originally implemented to enable Spherical Fourier Neural Operators (SFNO). It uses quadrature rules to compute the projection onto the associated Legendre polynomials and FFTs for the projection onto the harmonic basis. This algorithm tends to outperform others with better asymptotic scaling for most practical purposes. `torch-harmonics` is a differentiable implementation of the Spherical Harmonic transform in PyTorch. It was originally implemented to enable Spherical Fourier Neural Operators (SFNO). It uses quadrature rules to compute the projection onto the associated Legendre polynomials and FFTs for the projection onto the harmonic basis. This algorithm tends to outperform others with better asymptotic scaling for most practical purposes.
`torch_harmonics` uses PyTorch primitives to implement these operations, making it fully differentiable. Moreover, the quadrature can be distributed onto multiple ranks making it spatially distributed. `torch-harmonics` uses PyTorch primitives to implement these operations, making it fully differentiable. Moreover, the quadrature can be distributed onto multiple ranks making it spatially distributed.
`torch_harmonics` has been used to implement a variety of differentiable PDE solvers which generated the animations below. Moreover, it has enabled the development of Spherical Fourier Neural Operators (SFNOs) [1]. `torch-harmonics` has been used to implement a variety of differentiable PDE solvers which generated the animations below. Moreover, it has enabled the development of Spherical Fourier Neural Operators (SFNOs) [1].
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
...@@ -75,14 +74,15 @@ Build in your environment using the Python package: ...@@ -75,14 +74,15 @@ Build in your environment using the Python package:
``` ```
git clone git@github.com:NVIDIA/torch-harmonics.git git clone git@github.com:NVIDIA/torch-harmonics.git
pip install ./torch_harmonics cd torch-harmonics
pip install -e .
``` ```
Alternatively, use the Dockerfile to build your custom container after cloning: Alternatively, use the Dockerfile to build your custom container after cloning:
``` ```
git clone git@github.com:NVIDIA/torch-harmonics.git git clone git@github.com:NVIDIA/torch-harmonics.git
cd torch_harmonics cd torch-harmonics
docker build . -t torch_harmonics docker build . -t torch_harmonics
docker run --gpus all -it --rm --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 torch_harmonics docker run --gpus all -it --rm --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 torch_harmonics
``` ```
......
...@@ -87,7 +87,7 @@ config = { ...@@ -87,7 +87,7 @@ config = {
{'name': "Boris Bonev", 'email': "bbonev@nvidia.com"}, {'name': "Boris Bonev", 'email': "bbonev@nvidia.com"},
], ],
'version': VERSION, 'version': VERSION,
'install_requires': ['torch','numpy'], 'install_requires': ['torch', 'numpy'],
'extras_require': { 'extras_require': {
'sfno': ['tensorly', 'tensorly-torch'], 'sfno': ['tensorly', 'tensorly-torch'],
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment