Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceyron committed Oct 23, 2024
2 parents 6f362f9 + 8959079 commit 3441bc4
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 20 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Publish Python Package

on:
release:
types: [created]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r ./tests/requirements.txt
- name: Run tests
run: |
python -m pip install .
python -m pytest tests/
build:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
pip install setuptools wheel build
- name: Build
run: |
python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-packages
path: dist/
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
environment: release
permissions:
id-token: write
steps:
- name: Download distribution packages
uses: actions/download-artifact@v4
with:
name: python-packages
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run tests

on: [push, pull_request]

permissions:
contents: read

jobs:
run-test:
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12" ]
os: [ ubuntu-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r ./tests/requirements.txt
- name: Test with pytest
run: |
python -m pip install .
python -m pytest tests/
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@

<h1 align="center">
<img src="docs/imgs/exponax_logo.png" width="200">
<br>
Exponax
<br>
</h1>
⚠️ ⚠️ ⚠️ This is a pre-release version of the package to test the PyPI workflow. Proper release **with breaking API changes** will be by end of October. ⚠️ ⚠️ ⚠️

<h4 align="center">Efficient Differentiable PDE solvers built on top of <a href="https://github.com/google/jax" target="_blank">JAX</a> & <a href="https://github.com/patrick-kidger/equinox" target="_blank">Equinox</a>.</h4>

Expand All @@ -15,7 +9,7 @@
<a href="#documentation">Documentation</a> •
<a href="#background">Background</a> •
<a href="#related">Related</a> •
<a href="#license">License</a>
<a href="#acknowledgements">Acknowledgements</a>
</p>

<p align="center">
Expand All @@ -25,10 +19,10 @@
## Installation

```bash
pip install git+ssh://[email protected]/Ceyron/exponax@main
pip install exponax
```

Requires Python 3.10+ and JAX 0.4.13+ (and Equinox & Matplotlib). 👉 [JAX install guide](https://jax.readthedocs.io/en/latest/installation.html).
Requires Python 3.10+ and JAX 0.4.13+. 👉 [JAX install guide](https://jax.readthedocs.io/en/latest/installation.html).

## Quickstart

Expand Down Expand Up @@ -90,13 +84,7 @@ For a next step, check out the [simple_advection_example_1d.ipynb](examples/simp

## Documentation

The following Jupyter notebooks showcase the usage of the package:

1. [Simple Advection Example in 1d](docs/examples/simple_advection_example_1d.ipynb)
2. ...

The documentation is still in progress. For now, the best way to get started is
to look at the examples and the docstrings in the code.
Documentation is available at [fkoehler.site/exponax](https://fkoehler.site/exponax/).

## Background

Expand Down Expand Up @@ -168,12 +156,23 @@ This package also took much inspiration from the
integral method of [2] and how to handle (de)aliasing.


## License
## Acknowledgements

### Citation

This package was developed as part of the `APEBench paper` (accepted at Neurips 2024), we will soon add the citation here.

### Funding

The main author (Felix Koehler) is a PhD student in the group of [Prof. Thuerey at TUM](https://ge.in.tum.de/) and his research is funded by the [Munich Center for Machine Learning](https://mcml.ai/).

### License

MIT, see [here](LICENSE.txt)
MIT, see [here](https://github.com/Ceyron/exponax/blob/main/LICENSE.txt)

---

> [fkoehler.site](https://fkoehler.site/) &nbsp;&middot;&nbsp;
> GitHub [@ceyron](https://github.com/ceyron) &nbsp;&middot;&nbsp;
> X [@felix_m_koehler](https://twitter.com/felix_m_koehler)
> X [@felix_m_koehler](https://twitter.com/felix_m_koehler) &nbsp;&middot;&nbsp;
> LinkedIn [Felix Köhler](www.linkedin.com/in/felix-koehler)

0 comments on commit 3441bc4

Please sign in to comment.