Skip to content

Commit

Permalink
installation instructions and non-code files handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kumiori committed Oct 7, 2024
1 parent 485fef8 commit 656a3c7
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
37 changes: 31 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,30 @@ https://docs.godotengine.org/en/3.1/community/contributing/pr_workflow.html

### Installation

Before installing `irrevolutions`, ensure you have `dolfinx` and other dependencies installed. You can install `dolfinx` using one of the following methods:
Before installing `irrevolutions`, ensure you have `dolfinx` and other dependencies installed.

DOLFINx (and some other libraries like MPI and PyVista) have complex dependencies, it may be best to install them using conda from the conda-forge channel. Conda handles the environment setup and dependency conflicts well for these low-level libraries. Otherwise, you install from source using Spack or us a pre-built docker image.

Then, install your Python package dependencies with Poetry. After installing system-level dependencies with Conda (or another method), you can use Poetry to manage the Python-specific packages and virtual environment for your project. Poetry will not attempt to reinstall DOLFINx or other system-level packages.

More specifically, you can install `dolfinx` using one of the following methods:

- Using conda
```
conda create -n fenicsx-env -c conda-forge fenics-dolfinx=0.7.2 mpich pyvista
conda create -n fenicsx-env -c conda-forge fenics-dolfinx=0.7.2 mpich pyvista sympy pandas pyyaml
conda activate fenicsx-env
```

- Using Spack
see https://github.com/FEniCS/dolfinx/blob/main/README.md#spack

- Using Apt (ubuntu)
- Using Apt (ubuntu 23.04 build)
```
apt-get install -y software-properties-common python3-pip git libgl1-mesa-glx xvfb libglu1 libxcursor1 libxinerama1
add-apt-repository ppa:fenics-packages/fenics
apt update
apt install fenicsx=1:0.7.3-3~ppa1~lunar1
apt-install fenicsx
```

For detailed instructions, see https://github.com/FEniCS/dolfinx/blob/main/README.md#installation
Expand All @@ -63,8 +71,26 @@ For a windows box:
docker run --rm -ti -v "C:/...":/home/numerix" -w /home/numerix kumiori3\numerix:stable-amd64
```

Finally, to install `irrevolutions` head to the package root directory and run

We recommend using Poetry to manage Python dependencies and the virtual environment for the project. Follow the instructions below to install Poetry and set up the environment.

```
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
```

Clone this repository:

```
git clone https://github.com/kumiori/irrevolutions.git
cd irrevolutions
```


Finally, to install `irrevolutions` with poetry run
```poetry install```

Alternatively, `irrevolutions` can be installed using setuptools from the root directory
```python3 -m pip install .```


Expand All @@ -77,7 +103,6 @@ This code was initially conceived as a support for the teaching course MEC647,

### Acknowledgements


To all the students for their effort, participation, and motivation.

This project contains code from the DOLFINy project (https://github.com/fenics-dolfiny/dolfiny), which is licensed under the LGPLv3 license. We acknowledge and thank the DOLFINy contributors for their work.
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,18 @@ dolfinx_support = []

[tool.poetry.scripts]
irrevolutions = 'irrevolutions:main'

# Ensure that non-code files (e.g., default_parameters.yml) are included in the package
[tool.poetry.include]
irrevolutions = ["src/irrevolutions/models/default_parameters.yml"]

# Additional files to include (e.g., readme, licenses, configs)
include = [
"README.md",
"LICENSE",
"src/irrevolutions/models/default_parameters.yml"
]

[tool.poetry.package]
# Map the source code to the correct directory structure
package = { "irrevolutions": "src/irrevolutions" }

0 comments on commit 656a3c7

Please sign in to comment.