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

IGNORE - PR to test CI #798

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
64c3ecb
removed conda from ci pipeline
kmilo9999 Jun 12, 2024
e58c42f
MAINT: Switching to ubuntu 22.04
kmilo9999 Jun 12, 2024
45173b2
MAINT: Added conditionals to install openmpi according to matrix.os
kmilo9999 Jun 12, 2024
c51d95b
MAINT: moving macos MPI_LIB_NRN_PATH env variable assigment
kmilo9999 Jun 12, 2024
8a79759
MAINT: Removing comments and additional test in unit_test.yml
kmilo9999 Jun 13, 2024
927905c
MAINT: Moving linux CI to a separate workflow
kmilo9999 Jun 14, 2024
862fb41
STY: fixed flake8 errors
kmilo9999 Jun 14, 2024
0fb984e
STY: fixed flake8 errors in gui.py
kmilo9999 Jun 14, 2024
4c91250
MAINT: Removing linux commands from macos CI workflow
kmilo9999 Jun 14, 2024
9b8ea30
TST: Adding python 3.10 and 3.11 to the tests
kmilo9999 Jun 16, 2024
3735a39
TST: Adding quotes to python version 3.10
kmilo9999 Jun 16, 2024
d4a1150
TST: Adding double quotes for macos python 3.10 build
kmilo9999 Jun 16, 2024
19b8d5e
added python and mpi version verification. removing openmpi installat…
kmilo9999 Jun 17, 2024
fb5db28
removing python 3.10 and 3.11 from the test
kmilo9999 Jun 17, 2024
c840408
removing python 3.10 and 3.11 from the test in Linux
kmilo9999 Jun 17, 2024
6c8824a
Only testing test_parallel_backends.py in 3.9.10
kmilo9999 Jun 17, 2024
b2abdfb
testing python 3.9.10 and ubuntu-20.04
kmilo9999 Jun 17, 2024
be91556
testing again only python 3.9.10 and ubuntu-20.04
kmilo9999 Jun 17, 2024
21f0f75
added mpi_test.py
kmilo9999 Jun 17, 2024
cdb7bbe
fix linux worflow file
kmilo9999 Jun 17, 2024
7d14640
adding parameter in pytest to print in stdout
kmilo9999 Jun 17, 2024
541f517
added pip freeze and test viz
kmilo9999 Jun 17, 2024
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
78 changes: 78 additions & 0 deletions .github/workflows/linux_unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Unit tests

on:
push:
branches: ['**']
pull_request:
branches: ['**']

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.9.10']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.9.10'
- name: Install ubuntu dependencies
shell: bash -el {0}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libopenmpi-dev openmpi-bin
- name: Check MPI version
shell: bash -el {0}
run: |
mpiexec --version
- name: Check Python version
shell: bash -el {0}
run: |
python --version

- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
python -m pip install mpi4py
- name: Install HNN-core
shell: bash -el {0}
run: |
python -m pip install --verbose '.[opt, parallel, test, gui]'
- name: Run MPI application
shell: bash -el {0}
run: |
mpiexec -np 2 python ./hnn_core/mpi_test.py
- name: Verify NEURON installation
shell: bash -el {0}
run: |
nrniv -python -nobanner -mpi python "from neuron import h; print(h)"
- name: Run MPI application with NEURON
shell: bash -el {0}
run: |
mpiexec -np 2 -verbose nrniv -python -mpi -nobanner python ./hnn_core/mpi_test.py

# - name: Lint with flake8
# shell: bash -el {0}
# run: |
# flake8 --count hnn_core
- name: Freeze package versions
shell: bash -el {0}
run: |
python -m pip freeze

- name: Test with pytest
shell: bash -el {0}
run: |
python -m pytest ./hnn_core/tests/test_viz.py --cov=hnn_core --cov-report=xml -s

# - name: Upload coverage to Codecov
# shell: bash -el {0}
# run: |
# bash <(curl -s https://codecov.io/bash) -f ./coverage.xml
45 changes: 45 additions & 0 deletions .github/workflows/macos_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Unit tests

on:
push:
branches: ['**']
pull_request:
branches: ['**']

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
python-version: [3.8, 3.9, "3.10", 3.11]

steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
python-version: ${{ matrix.python-version }}
fetch-depth: 2
- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
conda install --yes -c conda-forge mpi4py openmpi
# - name: Install HNN-core
# shell: bash -el {0}
# run: |
# pip install --verbose '.[opt, parallel, test, gui]'
# - name: Lint with flake8
# shell: bash -el {0}
# run: |
# flake8 --count hnn_core
# - name: Test with pytest
# shell: bash -el {0}
# run: |
# python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml
# - name: Upload coverage to Codecov
# shell: bash -el {0}
# run: |
# bash <(curl -s https://codecov.io/bash) -f ./coverage.xml
53 changes: 0 additions & 53 deletions .github/workflows/unit_tests.yml

This file was deleted.

18 changes: 9 additions & 9 deletions .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
python -c "import neuron"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies and HNN
shell: cmd
run: |
python -m pip install --upgrade pip
pip install --verbose .[opt,parallel,test,gui]
- name: Test with pytest
shell: cmd
run: |
python -m pytest ./hnn_core/tests/
# - name: Install dependencies and HNN
# shell: cmd
# run: |
# python -m pip install --upgrade pip
# pip install --verbose .[opt,parallel,test,gui]
# - name: Test with pytest
# shell: cmd
# run: |
# python -m pytest ./hnn_core/tests/
15 changes: 9 additions & 6 deletions hnn_core/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
from hnn_core.gui._logging import logger
from hnn_core.gui._viz_manager import _VizManager, _idx2figname
from hnn_core.network import pick_connection
from hnn_core.params import (_extract_drive_specs_from_hnn_params, _read_json,
_read_legacy_params)
from hnn_core.params import (_extract_drive_specs_from_hnn_params)
from hnn_core.dipole import _read_dipole_txt

import base64
Expand Down Expand Up @@ -1227,7 +1226,8 @@ def add_connectivity_tab(params, connectivity_out,
return net


def add_drive_tab(params, log_out, drives_out, drive_widgets, drive_boxes, tstop,
def add_drive_tab(params, log_out, drives_out, drive_widgets,
drive_boxes, tstop,
layout):
net = jones_2009_model(params)

Expand Down Expand Up @@ -1275,9 +1275,11 @@ def load_drive_and_connectivity(params, log_out, drives_out,
"""Add drive and connectivity ipywidgets from params."""
with log_out:
# Add connectivity
add_connectivity_tab(params, connectivity_out, connectivity_textfields)
add_connectivity_tab(params, connectivity_out,
connectivity_textfields)
# Add drives
add_drive_tab(params, log_out, drives_out, drive_widgets, drive_boxes, tstop,
add_drive_tab(params, log_out, drives_out, drive_widgets,
drive_boxes, tstop,
layout)


Expand Down Expand Up @@ -1339,7 +1341,8 @@ def on_upload_params_change(change, tstop, dt, log_out, drive_boxes,
add_connectivity_tab(params, connectivity_out, connectivity_textfields)
elif load_type == 'drives':
with log_out:
add_drive_tab(params, log_out, drives_out, drive_widgets, drive_boxes, tstop,
add_drive_tab(params, log_out, drives_out,
drive_widgets, drive_boxes, tstop,
layout)
else:
raise ValueError
Expand Down
27 changes: 27 additions & 0 deletions hnn_core/mpi_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from mpi4py import MPI
import logging
from neuron import h
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()

comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()

logger.info(f"Process {rank} out of {size} processors")
# Initialize NEURON with MPI support
h('''
objref pc
pc = new ParallelContext()
''')

# Check if NEURON MPI is enabled
is_mpi_enabled = int(h.pc.nhost() > 1)

if is_mpi_enabled:
logger.info(f"NEURON MPI is enabled. Running on {int(h.pc.nhost())} processes")
else:
logger.info("NEURON MPI is not enabled.")

if rank == 0:
print("NEURON MPI test completed")
4 changes: 3 additions & 1 deletion hnn_core/tests/test_parallel_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ def test_mpi_failure(run_hnn_core_fixture):
assert "MPI processes are unable to reach each other" in stdout

expected_string = "Child process failed unexpectedly"
assert len(record) == 1
print(record[0].message.args[0])
assert record[0].message.args[0] == expected_string
assert len(record) == 1


del environ["OMPI_MCA_btl"]
Loading