Skip to content

Commit

Permalink
run CI on both types of Mac (#174)
Browse files Browse the repository at this point in the history
* run CI on both types of Mac

* install hdf on ARM

* == > np.isclose

needed because different Mac architectures give slightly different numerical values.

* distinguish datatypes in test assertions

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
alessandrofelder and pre-commit-ci[bot] committed Apr 29, 2024
1 parent d46749a commit 8cd8391
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:
include:
- os: ubuntu-latest
python-version: "3.11"
- os: macos-latest
- os: macos-13 # Intel Mac
python-version: "3.10"
- os: macos-latest # ARM Mac
python-version: "3.10"
- os: windows-latest
python-version: "3.9"
Expand All @@ -43,6 +45,9 @@ jobs:
with:
path: ~/.brainglobe
key: bg-atlases
- name: install HDF5 libs on ARM Mac
if: matrix.os == 'macos-latest'
run: brew install hdf5
# Setup pyqt libraries
- uses: tlambert03/setup-qt-libs@v1
# Helps set up VTK with a headless display
Expand Down
10 changes: 8 additions & 2 deletions tests/tests/test_unit/test_regions/test_region_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ def test_summarise_brain_regions_all_not_empty(
df = pd.read_csv(filename)
assert df.shape == (3, 11)
for key, value in previous_world_space_values.items():
assert df[key].iloc[0] == value
if isinstance(value, (int, float)):
assert np.isclose(df[key].iloc[0], value)
else:
assert df[key].iloc[0] == value


def test_summarise_brain_regions_some_empty(
Expand All @@ -124,7 +127,10 @@ def test_summarise_brain_regions_some_empty(
df = pd.read_csv(filename)
assert df.shape == (1, 11)
for key, value in previous_world_space_values.items():
assert df[key].iloc[0] == value
if isinstance(value, (int, float)):
assert np.isclose(df[key].iloc[0], value)
else:
assert df[key].iloc[0] == value


def test_summarise_brain_regions_all_empty(
Expand Down

0 comments on commit 8cd8391

Please sign in to comment.