Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoNeureiter committed May 25, 2023
2 parents 4a99811 + bbb200a commit fd58a1f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 26 deletions.
80 changes: 56 additions & 24 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,63 @@ jobs:
build:

runs-on: ubuntu-latest

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

strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y libproj-dev proj-data proj-bin libgeos-dev
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install cython numpy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest

- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: bioconda, conda-forge, defaults
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
auto-update-conda: true
auto-activate-base: true

- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y libproj-dev proj-data proj-bin libgeos-dev
- name: Create conda environment
run: |
conda init bash
conda create -n myenv python=${{ matrix.python-version }}
- name: Activate conda environment
run: |
conda activate myenv
conda config --set always_yes yes --set changeps1 no
- name: Update conda environment
run: |
conda update --name base -q conda
- name: Install Python dependencies with Conda
run: |
conda install cartopy
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install cython numpy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ scipy
Shapely
seaborn
setuptools
cartopy<0.20.0
cartopy
typing_extensions
tables
pydantic
Expand Down
2 changes: 1 addition & 1 deletion test/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_minimal_example(self):
p_global = np.full(shape=(1, n_features, n_states), fill_value=0.5)
source = np.zeros((n_objects, n_features, 2), dtype=bool)
sample = Sample.from_numpy_arrays(
clusters=np.ones((1, n_objects), dtype=np.bool),
clusters=np.ones((1, n_objects), dtype=bool),
weights=broadcast_weights([0.5, 0.5], n_features),
cluster_effect=p_cluster,
confounding_effects={"universal": p_global},
Expand Down

0 comments on commit fd58a1f

Please sign in to comment.