Skip to content
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

Add pyproject.toml #84

Merged
merged 15 commits into from
May 16, 2024
Merged
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
8 changes: 6 additions & 2 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ jobs:
with:
path: micro-manager

- name: Install Micro Manager and uninstall pyprecice
working-directory: micro-manager
- name: Install dependencies
run: |
apt-get -qq update
apt-get -qq install python3-dev python3-pip git python-is-python3 pkg-config
pip3 install --upgrade pip

- name: Install Micro Manager and uninstall pyprecice
working-directory: micro-manager
run: |
pip3 install --user .
pip3 uninstall -y pyprecice

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## latest

- Use `pyproject.toml` instead of `setup.py` to configure the build. Package name is now `micro_manager_precice` https://github.com/precice/micro-manager/pull/84
- Add handling of crashing micro simulations https://github.com/precice/micro-manager/pull/85
- Add switch to turn adaptivity on and off in configuration https://github.com/precice/micro-manager/pull/93

Expand Down
16 changes: 3 additions & 13 deletions docs/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,11 @@ summary: Run the Micro Manager from the terminal with a configuration file as in
The Micro Manager is run directly from the terminal by providing the path to the configuration file as an input argument in the following way

```bash
micro_manager micro-manager-config.json
micro-manager-precice micro-manager-config.json
```

Alternatively the Manager can also be run by creating a Python script which imports the Micro Manager package and calls its run function. For example a run script `run-micro-manager.py` would look like

```python
from micro_manager import MicroManager

manager = MicroManager("micro-manager-config.json")

manager.solve()
```

The Micro Manager can also be run in parallel, using the same script as stated above
The Micro Manager can also be run in parallel

```bash
mpirun -n <number-of-procs> python3 run-micro-manager.py
mpiexec -n micro-manager-precice micro-manager-config.json
```
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[build-system]
requires = ["setuptools>=41", "wheel", "setuptools-git-versioning"]
build-backend = "setuptools.build_meta"

[project]
name="micro-manager-precice"
dynamic = [ "version" ]
dependencies = [
"pyprecice>=3.0.0.0", "numpy", "mpi4py", "scikit-learn"
IshaanDesai marked this conversation as resolved.
Show resolved Hide resolved
]
requires-python = ">=3.8"
authors = [
{ name = "The preCICE Developers", email="[email protected]"}
]
maintainers = [
{ name = "Ishaan Desai", email="[email protected]"}
]
description="A tool which facilitates two-scale macro-micro coupled simulations using preCICE."
readme = "README.md"
license={ text = "GPLv3" }
keywords = [ "preCICE", "multiscale", "coupling" ]
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Topic :: Scientific/Engineering",
]

[project.urls]
Homepage = "https://precice.org"
Documentation = "https://precice.org/tooling-micro-manager-overview.html"
Repository = "https://github.com/precice/micro-manager"
"Bug Tracker" = "https://github.com/precice/micro-manager/issues"

[project.scripts]
micro-manager-precice = "micro_manager.micro_manager:main"

[tool.setuptools]
packages=["micro_manager", "micro_manager.adaptivity"]

[tool.setuptools-git-versioning]
enabled = true
36 changes: 2 additions & 34 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
import os
from setuptools import setup

# from https://stackoverflow.com/a/9079062
import sys

from setuptools import find_packages, setup

if sys.version_info[0] < 3:
raise Exception(
"micromanager only supports Python3. Did you run $python setup.py <option>.? "
"Try running $python3 setup.py <option>."
)

this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()

setup(
name="micro-manager-precice",
version="v0.4.0",
description="micro-manager-precice is a package which facilitates two-scale macro-micro coupled simulations using preCICE",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://precice.org/tooling-micro-manager-overview.html",
entry_points={
"console_scripts": ["micro_manager=micro_manager.micro_manager:main"]
},
author="Ishaan Desai",
author_email="[email protected]",
license="LGPL-3.0",
packages=find_packages(exclude=["examples"]),
install_requires=["pyprecice>=3.0.0.0", "numpy>=1.13.3", "scikit-learn", "mpi4py"],
test_suite="tests",
zip_safe=False,
)
setup()