Skip to content

Switch to using pyproject.toml #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
python-version: ${{matrix.python-version}}
- name: Install dependencies
run: |
pip install black
pip install isort
pip install codespell
pip install --upgrade pip
pip install black isort codespell

- name: Formatting and sorting import
run: |
source .github/linters/formatting.sh
Expand All @@ -63,8 +63,8 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .
pip install pytest
pip install .[test,post]

- name: Test preprocess
run: |
pytest tests/preprocess
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade pip
pip install nrel-bird
pip install nrel-bird[post]
pip install pytest
- name: Test
run: pytest .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx_rtd_theme
pip install sphinx sphinx-rtd-theme

- name: Build documentation
run: |
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ conda create --name bird python=3.10
conda activate bird
git clone https://github.com/NREL/BioReactorDesign.git
cd BioReactorDesign
pip install -e .
pip install -e .[all]
```

## Installation of python package for users

```bash
conda create --name bird python=3.10
conda activate bird
pip install nrel-bird[post]
```

If you do not need the post processing tools, please replace the last line with

```bash
pip install nrel-bird
```

Expand Down
Empty file added bird/calibration/__init__.py
Empty file.
Empty file added bird/meshing/__init__.py
Empty file.
34 changes: 17 additions & 17 deletions bird/meshing/stirred_tank_mesh_templates/base_tank/tank_par.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
geometry:
Dt: 0.26 # Tank diameter [m]
Da: 0.0866667 # Impleller tip Diameter [m]
H: 0.39 # Height of the reactor [m]
nimpellers: 1
C: [0.0866667] # height of the center of impellers [m]
W: 0.026 # impeller blade width [m]
L: 0.013 # impeller blade length (beyond the hub) [m]
Lin: 0.013 # impeller blade length (inside the hub)
J: 0.026 # Baffle width
Wh: 0.0026 # Hub height (Width)
polyrad: 0.00866667 # Stem radius (R_shaft)
Z0: 0.0 # bottom of reactor
nbaffles: 6 # number of baffles and impeller fins
Dt: 0.26 # Tank diameter [m]
Da: 0.0866667 # Impleller tip Diameter [m]
H: 0.39 # Height of the reactor [m]
nimpellers: 1
C: [0.0866667] # height of the center of impellers [m]
W: 0.026 # impeller blade width [m]
L: 0.013 # impeller blade length (beyond the hub) [m]
Lin: 0.013 # impeller blade length (inside the hub)
J: 0.026 # Baffle width
Wh: 0.0026 # Hub height (Width)
polyrad: 0.00866667 # Stem radius (R_shaft)
Z0: 0.0 # bottom of reactor
nbaffles: 6 # number of baffles and impeller fins

mesh:
nr: 120 # mesh points per unit radial length
nz: 240 # mesh points per unit axial length
Npoly: 4 # mesh points in the polygon at the axis
Na: 6 # mesh points in the azimuthal direction
nr: 120 # mesh points per unit radial length
nz: 240 # mesh points per unit axial length
Npoly: 4 # mesh points in the polygon at the axis
Na: 6 # mesh points in the azimuthal direction



Empty file added bird/postprocess/__init__.py
Empty file.
Empty file added bird/preprocess/__init__.py
Empty file.
8 changes: 0 additions & 8 deletions bird/requirements.txt

This file was deleted.

Empty file added bird/utilities/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion bird/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Bio reactor design version"""

__version__ = "0.0.15"
__version__ = "0.0.16"
2 changes: 1 addition & 1 deletion docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Installation of python package for developers
conda activate bird
git clone https://github.com/NREL/BioReactorDesign.git
cd BioReactorDesign
pip install -e .
pip install -e .[all]

.. _installation_users:

Expand Down
83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[build-system]
requires = ["setuptools >= 64", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "nrel-bird"
version = "0.0.16"
description = "Bio Reactor Design (BiRD): a toolbox to simulate and analyze different designs of bioreactors in OpenFOAM"
readme = {file = "README.md", content-type = "text/markdown"}
authors = [
{name = "Malik Hassanaly", email = "[email protected]"},
{name = "Federico Municchi", email = "[email protected]"},
{name = "Hariswaran Sitaraman", email = "[email protected]"},
{name = "Mohammad Rahimi", email = "[email protected]"},
]
license = {text = "BSD-3-Clause"}
requires-python = ">= 3.9"
classifiers=[
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"numpy",
"prettyPlot",
"ruamel_yaml",
"numpy-stl",
"scipy",
]


[project.optional-dependencies]
post = [
"corner",
"jax",
"numpyro>=0.16.1"
]
format = [
"black",
"isort",
"codespell"
]
docs = [
"sphinx",
"sphinx_rtd_theme"
]
test = [
"pytest"
]
all = [
"corner",
"jax",
"numpyro>=0.16.1",
"black",
"isort",
"codespell",
"sphinx",
"sphinx_rtd_theme",
"pytest",
]


[project.urls]
homepage = "https://github.com/NREL/BioReactorDesign"
documentation = "https://nrel.github.io/BioReactorDesign/"
repository = "https://github.com/NREL/BioReactorDesign"

[tool.setuptools]
packages = ["bird", "bird.meshing", "bird.preprocess", "bird.postprocess", "bird.calibration", "bird.utilities"]
include-package-data = true

[tool.setuptools.package-data]
bird = [
"*.json",
"*.yaml",
"*.csv",
"data_conditional_mean",
]

52 changes: 0 additions & 52 deletions setup.py

This file was deleted.

24 changes: 19 additions & 5 deletions tests/preprocess/test_stl_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
from bird import BIRD_PRE_PATCH_TEMP_DIR
from bird.meshing._mesh_tools import parseJsonFile
from bird.preprocess.stl_patch.stl_bc import write_boundaries
from bird.utilities.stl_plotting import plotSTL, pretty_labels
from bird.utilities.stl_plotting import plotSTL, plt, pretty_labels


def test_spider_sparger():
def test_spider_sparger(verbose=False):
input_dict = parseJsonFile(
os.path.join(BIRD_PRE_PATCH_TEMP_DIR, "spider_spg/inlets_outlets.json")
)
write_boundaries(input_dict)
# plot
axes = plotSTL("inlets.stl")
pretty_labels("x", "y", zlabel="z", fontsize=14, ax=axes)
if verbose:
plt.show()


def test_loop_reactor():
def test_loop_reactor(verbose=False):
input_dict = parseJsonFile(
os.path.join(
BIRD_PRE_PATCH_TEMP_DIR, "loop_reactor_expl/inlets_outlets.json"
Expand All @@ -28,9 +30,14 @@ def test_loop_reactor():
# plot
axes = plotSTL("inlets.stl")
pretty_labels("x", "y", zlabel="z", fontsize=14, ax=axes)
# plot
axes = plotSTL("outlets.stl")
pretty_labels("x", "y", zlabel="z", fontsize=14, ax=axes)
if verbose:
plt.show()


def test_loop_reactor_branch():
def test_loop_reactor_branch(verbose=False):
input_dict = parseJsonFile(
os.path.join(
BIRD_PRE_PATCH_TEMP_DIR, "loop_reactor_branch/inlets_outlets.json"
Expand All @@ -40,7 +47,14 @@ def test_loop_reactor_branch():
# plot
axes = plotSTL("inlets.stl")
pretty_labels("x", "y", zlabel="z", fontsize=14, ax=axes)
# plot
axes = plotSTL("outlets.stl")
pretty_labels("x", "y", zlabel="z", fontsize=14, ax=axes)
if verbose:
plt.show()


if __name__ == "__main__":
test_spider_sparger()
test_spider_sparger(verbose=True)
test_loop_reactor(verbose=True)
test_loop_reactor_branch(verbose=True)
Loading