Skip to content

Commit b76c9f1

Browse files
authored
Add proper configuration for building (#47)
* create pyproject.toml from setup and requirements * exclude python >3.10 * update readme * pin specific jax version * add python 3.9 * 3.10 variant to datagen extra * pin torch versions for datagen extra (for compatibility reasons with JAX)
1 parent cacd7fd commit b76c9f1

File tree

5 files changed

+86
-85
lines changed

5 files changed

+86
-85
lines changed

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,40 @@ DOIs
2929

3030
## Installation
3131

32-
pip install .
33-
34-
## Requirements
35-
3632
### Using pip
33+
34+
Locally:
3735
```bash
38-
python3 -m venv ./venv --prompt pde_benchmark --system-site-packages
39-
. ./venv/bin/activate
4036
pip install --upgrade pip wheel
41-
pip install -r requirements.txt
37+
pip install .
4238
```
4339

44-
The minimum required packages to train and run the baseline ML models are listed in [requirements.txt](./requirements.txt).
40+
From PyPI:
41+
```bash
42+
pip install pdebench
43+
```
44+
45+
To include dependencies for data generation:
46+
```bash
47+
pip install "pdebench[datagen310]"
48+
pip install ".[datagen310]" # locally
49+
```
50+
or
51+
```bash
52+
pip install "pdebench[datagen39]"
53+
pip install ".[datagen39]" # locally
54+
```
4555

46-
To run the data generation scripts, the complete package requirements are listed in [requirements_datagen.txt](./requirements_datagen.txt)
56+
### GPU Support
4757

4858
For GPU support there are additional platform-specific instructions:
4959

5060
For PyTorch, [see here](https://pytorch.org/get-started/locally/).
5161

5262
For JAX, which is approximately 6 times faster for simulations than PyTorch in our tests, [see here](https://github.com/google/jax#installation)
5363

54-
### Using conda:
64+
65+
## Installation using conda:
5566

5667
If you like you can also install dependencies using anaconda. We suggest using [miniforge](https://github.com/conda-forge/miniforge) (and possibly mamba) as distribution. Otherwise you may have to __enable the conda-forge__ channel for the following commands.
5768

@@ -79,11 +90,6 @@ Optional dependencies for data generation:
7990
conda install clawpack jax jaxlib python-dotenv
8091
```
8192

82-
Optional dependencies for data downloading:
83-
```
84-
pip install pyDarus~=1.0.5
85-
```
86-
8793
## Configuring DeepXDE
8894
In our tests we used PyTorch as backend for DeepXDE. Please [follow the documentation](https://deepxde.readthedocs.io/en/latest/user/installation.html#working-with-different-backends) to enable this.
8995

pyproject.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
requires-python = ">=3.9,<3.11"
7+
dynamic = ["readme"]
8+
name = "pdebench"
9+
version = "0.1.0"
10+
description = "PDEBench: An Extensive Benchmark for Scientific Machine Learning"
11+
authors = [
12+
{name = "Makoto Takamoto", email = "Makoto.Takamoto@neclab.eu"},
13+
{name = "Timothy Praditia", email = "timothy.praditia@iws.uni-stuttgart.de"},
14+
{name = "Raphael Leiteritz", email = "raphael.leiteritz@ipvs.uni-stuttgart.de"},
15+
{name = "Dan MacKinlay"},
16+
{name = "Francesco Alesiani"},
17+
{name = "Dirk Pflüger"},
18+
{name = "Mathias Niepert"},
19+
]
20+
license = {file = "LICENSE.txt"}
21+
dependencies = [
22+
"scipy",
23+
"matplotlib",
24+
"h5py",
25+
"pandas",
26+
"python-dotenv",
27+
"hydra-core",
28+
"torch~=1.13.0",
29+
"torchvision~=0.14.1",
30+
"deepxde~=1.1.3",
31+
"pyro-ppl",
32+
"tqdm",
33+
]
34+
35+
[project.urls]
36+
Homepage = "https://github.com/pdebench/PDEBenchm"
37+
Documentation = "https://github.com/pdebench/PDEBench"
38+
Repository = "https://github.com/pdebench/PDEBench"
39+
40+
[project.optional-dependencies]
41+
datagen310 = [
42+
"clawpack@git+https://github.com/clawpack/clawpack.git@d619d6835ce128a0421aa52d70d2a6c9d9d1ce93",
43+
"dash",
44+
"phiflow",
45+
"imageio",
46+
"einops",
47+
"torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-linux_x86_64.whl",
48+
"torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp310-cp310-linux_x86_64.whl",
49+
"jax==0.4.11",
50+
"jaxlib @ https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.4.11+cuda11.cudnn86-cp310-cp310-manylinux2014_x86_64.whl",
51+
]
52+
datagen39 = [
53+
"clawpack@git+https://github.com/clawpack/clawpack.git@d619d6835ce128a0421aa52d70d2a6c9d9d1ce93",
54+
"dash",
55+
"phiflow",
56+
"imageio",
57+
"einops",
58+
"torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp39-cp39-linux_x86_64.whl",
59+
"torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp39-cp39-linux_x86_64.whl",
60+
"jax==0.4.11",
61+
"jaxlib @ https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.4.11+cuda11.cudnn86-cp39-cp39-manylinux2014_x86_64.whl"
62+
]
63+
64+
[tool.setuptools.dynamic]
65+
readme = {file = ["README.md"], content-type = "text/markdown"}

requirements.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

requirements_datagen.txt

Lines changed: 0 additions & 29 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)