Skip to content

Commit

Permalink
mac tests, flake8 linter, move docs to gh-pages branch
Browse files Browse the repository at this point in the history
  • Loading branch information
c-randall committed Jul 8, 2024
1 parent fdb083e commit f994866
Show file tree
Hide file tree
Showing 97 changed files with 62 additions and 16,157 deletions.
2 changes: 1 addition & 1 deletion .github/linters/.codespellrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[codespell]
skip = .git,docs,reports,images,__pycache__
skip = .*,__pycache__,build,docs,images,reports,sphinx
2 changes: 2 additions & 0 deletions .github/linters/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 80
57 changes: 47 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ on:
paths-ignore:
- '*.md'
- 'README*'
- 'LICENSE'
- 'docs/*'
- 'LICENSE*'
- 'images/*'

pull_request:
branches: [main]
paths-ignore:
- '*.md'
- 'README*'
- 'LICENSE'
- 'docs/*'
- 'LICENSE*'
- 'images/*'

jobs:
Expand Down Expand Up @@ -44,16 +42,20 @@ jobs:
run: |
pip install codespell
codespell --config .github/linters/.codespellrc
- name: Code format
run: |
pip install flake8
flake8 --config .github/linters/.flake8 src
tests:
win-lin-tests:
name: (Test ${{ matrix.python-version }}, ${{ matrix.os }})

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest'] # ['ubuntu-latest', 'macos-latest', 'windows-latest']
os: ['ubuntu-latest', 'windows-latest']
python-version: ['3.8', '3.11']

defaults:
Expand All @@ -64,17 +66,52 @@ jobs:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: 'rovi'
python-version: ${{ matrix.python-version }}
miniconda-version: 'latest'
use-only-tar-bz2: true
auto-update-conda: true
auto-activate-base: true
- name: Conda dependencies
run: conda install scikits.odes -c conda-forge
- name: Pip dependencies
run: pip install .
- name: List packages
run: conda list
- name: Pytest
run: |
pip install pytest
pytest
mac-tests:
name: (Test ${{ matrix.python-version }}, ${{ matrix.os }})

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: ['macos-latest']
python-version: ['3.8', '3.11']

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: 'rovi'
miniconda-version: 'latest'
use-only-tar-bz2: true
auto-update-conda: true
auto-activate-base: true
- name: Make environment
run: |
conda create -n rovi
conda activate rovi
- name: Conda dependencies
run: conda install -c conda-forge scikits.odes
conda info
conda config --env --set subdir osx-64
conda install python=${{ matrix.python-version }} scikits.odes -c conda-forge
- name: Pip dependencies
run: pip install .
- name: List packages
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__/
*.so

# Distribution / packaging
gh-pages/
sphinx/
.Python
build/
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The overall cell voltage is
where $R_0$ the lone series resistance (Ohm), as shown in Figure 1. Just like the other resistive elements, $R_0$ is a function of soc and $T_{\rm cell}$.

## Installation
We recommend using [Anaconda](https://anaconda.com) to install this package due to the [scikits.odes](https://scikits-odes.readthedocs.io) dependency, which is installed separately using ``conda install`` to avoid having to download and install C++ and Fortran compilers.
We recommend using [Anaconda](https://anaconda.com) to install this package due to the [scikits.odes](https://scikits-odes.readthedocs.io) dependency, which is installed separately using `conda install` to avoid having to download and install C++ and Fortran compilers. Please refer to the linked `scikits.odes` documentation if you'd prefer to install their software without using `conda`.

After cloning the repository, or downloading the files, use your terminal (MacOS/Linux) or Anaconda Prompt (Windows) to navigate into the folder with the `pyproject.toml` file. Once in the correct folder, execute the following commands:

Expand All @@ -65,6 +65,16 @@ conda activate rovi
pip install .
```

Note that if you are using a Mac with `arm-64` for `conda`, you will have to force your new environment to use packages built on `osx-64` because `scikits.odes` does not currently have any builds for `arm-64`. You can check if this is the case by running `conda info` and checking the platform value. To set up and force your new environment to `osx-64`, run the following:

```cmd
conda create -n rovi
conda activate rovi
conda config --env --set subdir osx-64
conda install python=3.10 scikits.odes -c conda-forge
pip install .
```

The first command will create a new Python environment named `rovi`. The environment will be set up using Python 3.10 and will install the `scikits.odes` dependency from the `conda-forge` channel. You can change the environment name as desired and specify any Python version >= 3.8 and < 3.12. Although the package supports multiple Python versions, development and testing is primarily done using 3.10. Therefore, if you have issues with another version, you should revert to using 3.10.

Before running the `pip install` command, which installs `thevenin`, you should activate your new `rovi` environment using the second command. If you plan to make changes to your local package, use the `-e` flag and add the optional developer dependencies during the `pip install` step, as shown below.
Expand Down
4 changes: 0 additions & 4 deletions docs/.buildinfo

This file was deleted.

Binary file removed docs/.doctrees/api/index.doctree
Binary file not shown.
Binary file removed docs/.doctrees/api/thevenin/index.doctree
Binary file not shown.
Binary file removed docs/.doctrees/environment.pickle
Binary file not shown.
Binary file removed docs/.doctrees/examples/example1.doctree
Binary file not shown.
Binary file removed docs/.doctrees/examples/example2.doctree
Binary file not shown.
Binary file removed docs/.doctrees/examples/index.doctree
Binary file not shown.
Binary file removed docs/.doctrees/index.doctree
Binary file not shown.
Empty file removed docs/.nojekyll
Empty file.
Binary file not shown.
Binary file not shown.
50 changes: 0 additions & 50 deletions docs/_images/api_reference.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
51 changes: 0 additions & 51 deletions docs/_images/examples.svg

This file was deleted.

Loading

0 comments on commit f994866

Please sign in to comment.