Skip to content

Commit

Permalink
Packaging (#57)
Browse files Browse the repository at this point in the history
pyproject.toml added, setup.py removed.
  • Loading branch information
jakharkaran authored Mar 27, 2024
2 parents dcda0e5 + 1a19190 commit e15e9ba
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 26 deletions.
20 changes: 7 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Py2D leverages JAX, a high-performance numerical computing library, allowing for

- python 3.10
- [jax](https://pypi.org/project/jax/)
- [scipy](https://pypi.org/project/scipy/)
- [jaxlib](https://pypi.org/project/jaxlib/)
- [numpy](https://pypi.org/project/numpy/)

## Installation
Expand All @@ -44,20 +44,14 @@ Then install py2d locally on your system
cd py2d
pip install -e ./
```
Install basic scientific libraries
```
pip install numpy scipy
```
### Install JAX
JAX can be installed for either CPU-only or GPU-supported environments. Follow the instructions below based on your requirements:

#### For CPU-only usage
> This installation will allow you to use JAX with CPU support but without GPU acceleration.
```
pip install jax
```
### A note on JAX
JAX can be installed for either CPU-only or GPU-supported environments.

The default installation above will install JAX with CPU support but without GPU acceleration.

#### For GPU support
[Installing JAX](https://jax.readthedocs.io/en/latest/installation.html)
For instructions on installing with GPU support see [Installing JAX](https://jax.readthedocs.io/en/latest/installation.html).
> Note: Note: GPU support requires a compatible NVIDIA GPU and the correct CUDA and CuDNN versions installed on your system. If you're unsure about your CUDA and CuDNN versions, consult the documentation for your GPU and the JAX installation guide for further guidance.
### If using JAX with Pytorch:
Expand Down
11 changes: 5 additions & 6 deletions py2d/Py2D_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

# Import os module
import os
# os.chdir('../../py2d/')
from pathlib import Path

# Import Python Libraries
Expand All @@ -24,10 +23,10 @@
print(jax.devices())

# Import Custom Module
from py2d.convection_conserved import convection_conserved, convection_conserved_dealias
from py2d.convert import Omega2Psi_2DFHIT_spectral, Psi2UV_2DFHIT_spectral
from py2d.aposteriori_analysis import eddyTurnoverTime_2DFHIT
from py2d.SGSModel import *
from .convection_conserved import convection_conserved
from .convert import Omega2Psi_2DFHIT_spectral, Psi2UV_2DFHIT_spectral
from .aposteriori_analysis import eddyTurnoverTime_2DFHIT
from .SGSModel import *
# from py2d.uv2tau_CNN import *

from py2d.initialize import gridgen, initialize_wavenumbers_2DFHIT, initialize_perturbation
Expand Down Expand Up @@ -479,4 +478,4 @@ def Py2D_solver(Re, fkx, fky, alpha, beta, NX, SGSModel_string, eddyViscosityCoe
readTrue=False,
ICnum=1, # Initial condition number: Choose between 1 to 20
resumeSim=False, # tart new simulation (False) or resume simulation (True)
)
)
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[build-system]
requires = ["setuptools >= 61"]
build-backend = "setuptools.build_meta"

[project]
name = "Py2D"
version = "0.1"
description = "Python solver for incompressible 2D Navier-Stokes equations."
authors = [
{ name="Karan Jakhar", email="[email protected]" },
]
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.10"
classifiers = [
"License :: OSI Approved :: MIT License",
"Development Status :: 3 - Alpha",
"Natural Language :: English",
"Programming Language :: Python :: 3",
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
"Operating System :: OS Independent",
]
dependencies = [
"numpy",
"jax",
"jaxlib",
]

[project.urls]
"Homepage" = "https://github.com/envfluids/py2d"
"Bug Tracker" = "https://github.com/envfluids/py2d/issues"

[tool.setuptools]
packages = ["py2d"]
include-package-data = true
7 changes: 0 additions & 7 deletions setup.py

This file was deleted.

0 comments on commit e15e9ba

Please sign in to comment.