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

13 clarifying environment setup in readme #16

Draft
wants to merge 44 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
df5ba48
adding a toml file
LevanBokeria Jan 23, 2025
983c167
fixing the toml file
LevanBokeria Jan 23, 2025
140f0f6
delete setup.py
LevanBokeria Jan 23, 2025
5bdfb9d
delete requirements.txt
LevanBokeria Jan 23, 2025
c05138c
Update README.md
LevanBokeria Jan 23, 2025
38ce770
updating the ci to run tests with both venv and conda
LevanBokeria Jan 23, 2025
0667235
Update pyproject.toml
LevanBokeria Jan 23, 2025
23a1f1d
Update ci.yml
LevanBokeria Jan 24, 2025
cc4cb2d
Update ci.yml
LevanBokeria Jan 24, 2025
2d39792
Update ci.yml
LevanBokeria Jan 29, 2025
bcc669f
Update ci.yml
LevanBokeria Jan 29, 2025
2f84105
Update ci.yml
LevanBokeria Jan 29, 2025
8fe773d
Update ci.yml
LevanBokeria Jan 29, 2025
6a84a02
back
LevanBokeria Jan 29, 2025
c7fd4ed
fixing conda errors
LevanBokeria Jan 29, 2025
9d9aac6
source bashrc
LevanBokeria Jan 29, 2025
19c552d
Update ci.yml
LevanBokeria Jan 29, 2025
680cc64
Update ci.yml
LevanBokeria Jan 29, 2025
5de4252
new way
LevanBokeria Jan 29, 2025
17a9751
init
LevanBokeria Jan 29, 2025
923da01
updates
LevanBokeria Jan 29, 2025
3f4a388
updates
LevanBokeria Jan 29, 2025
53d587a
updates
LevanBokeria Jan 29, 2025
e80c3df
updates
LevanBokeria Jan 29, 2025
b389c6f
updates
LevanBokeria Jan 29, 2025
a30c80a
updates
LevanBokeria Jan 29, 2025
44d9c20
using eval
LevanBokeria Jan 29, 2025
5b68d52
Update ci.yml
LevanBokeria Jan 29, 2025
159b548
trying with envir yml file
LevanBokeria Jan 29, 2025
b0b3429
trying an online example
LevanBokeria Jan 29, 2025
884039e
trying an online example
LevanBokeria Jan 29, 2025
fe1b214
trying an online example
LevanBokeria Jan 29, 2025
4bdd693
trying an online example
LevanBokeria Jan 29, 2025
762dd11
trying an online example
LevanBokeria Jan 29, 2025
f08af1b
trying an online example
LevanBokeria Jan 29, 2025
f055048
trying an online example
LevanBokeria Jan 29, 2025
b38515e
trying an online example
LevanBokeria Jan 29, 2025
7788e8b
trying an online example
LevanBokeria Jan 29, 2025
523c0eb
trying an online example
LevanBokeria Jan 29, 2025
0f42b7a
adding back the venv tests and fixing some values
LevanBokeria Jan 29, 2025
eac10b4
fixing the shell
LevanBokeria Jan 29, 2025
3857944
trying with old code
LevanBokeria Jan 29, 2025
51a0391
uncommenting the working code
LevanBokeria Jan 29, 2025
46d3f9a
uncommenting venv code
LevanBokeria Jan 29, 2025
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
72 changes: 64 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,87 @@ on:
push:
branches:
- main
- tests_ci
- dev
pull_request:
branches:
- main
- tests_ci
- dev

jobs:
build:

# build-conda:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v3

# - name: Set up Conda
# uses: conda-incubator/setup-miniconda@v2
# with:
# python-version: '3.10'

# - name: Create Conda environment
# run: |
# conda create --name myenv python=3.10 -y
# - name: Install dependencies
# run: |
# conda init
# conda activate myenv
# python -m pip install --upgrade pip
# pip install ./
# - name: Run tests
# run: |
# python -m unittest discover -s tests

build-conda:
name: Conda environment
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: myenv
environment-file: environment.yml
python-version: '3.10'
auto-activate-base: false
- run: |
python -m pip install --upgrade pip
pip install setuptools --upgrade
pip install ./

- name: Run tests
run: |
python -m unittest discover -s tests

build-venv:
name: Python virtual environment
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.10'

- name: Set up environment
run: |
python -m venv venv
source venv/bin/activate

- name: Install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ./

- name: Run tests
run: |
python -m unittest discover -s tests

source venv/bin/activate
python -m unittest discover -s tests
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,50 @@ The scope of this package is to provide a framework for building **0D models** a
2. **Valves**
3. **Vessels**

## Clone the ModularCirc GitHub repo locally

Run:

```
git clone https://github.com/alan-turing-institute/ModularCirc
cd ModularCirc
```

## Setup Conda or python virtual environment

Before installation of the ModularCirc package, please setup a virtual environment using either Conda or python virtual environment.

### Conda setup

Install Conda from https://docs.conda.io/projects/conda/en/stable/user-guide/install/index.html

Run:

```
conda create --name <yourenvname>
conda activate <yourenvname>
```

Proceed to installing the ModularCirc package.

### Python virtual environment setup

Run `python3 -m venv venv`. This creates a virtual environment called `venv` in your base directory.

Activate the python environment: `source venv/bin/activate`

Proceed to installing the ModularCirc package.

## Installation

From the repo directory, run:

```bash
pip install git+https://github.com/alan-turing-institute/ModularCirc.git
pip install ./
```

This will install the package based on the `pyproject.toml` file specifications.

## Steps for running basic models
1. Load the classes for the model of interest and the parameter object used to paramterise the said model:
```python
Expand Down Expand Up @@ -76,4 +115,4 @@ You can run locally the tests by running the following command:
```bash
python -m unittest discover -s tests
```
there is also a autamtated test pipeline that runs the tests on every push to the repository (see [here](.github/workflows/ci.yml)).
there is also a autamtated test pipeline that runs the tests on every push to the repository (see [here](.github/workflows/ci.yml)).
7 changes: 7 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: myenv
channels:
- conda-forge
- defaults

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

[project]
name = "ModularCirc"
version = "0.1.1"
description = "A python package for creating and running 0D models of the cardiovascular system"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT" }
authors = [
{name = "Maximilian Balmus", email = "[email protected]"}
]

dependencies = [
"matplotlib",
"numba",
"numpy",
"pandas",
"scipy",
"joblib",
"pandera",
"tdqm"
]

[project.optional-dependencies]
notebooks = ["ipykernel"]

[project.urls]
"Homepage" = "https://github.com/alan-turing-institute/ModularCirc"
"Source Code" = "https://github.com/alan-turing-institute/ModularCirc"
"Bug Tracker" = "https://github.com/alan-turing-institute/ModularCirc/issues"

[tool.setuptools]
packages = ["ModularCirc"]
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

50 changes: 0 additions & 50 deletions setup.py

This file was deleted.