Skip to content

Commit 5fb9e9a

Browse files
authored
[FIX] switch from np.math to math (#131)
* switch from np.math to math * fix numpy version for python 3.9 * checkout pr branch code for testing * fix isort
1 parent d0c18bb commit 5fb9e9a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/testing.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- "master"
7-
pull_request_target:
7+
pull_request:
88
branches:
99
- "*"
1010
schedule:
@@ -27,7 +27,7 @@ jobs:
2727
outputs:
2828
skip: ${{ steps.result_step.outputs.ci-skip }}
2929
steps:
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
3131
with:
3232
fetch-depth: 0
3333
- id: result_step
@@ -51,7 +51,7 @@ jobs:
5151
run:
5252
shell: bash
5353
steps:
54-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v3
5555
- name: "Set up python"
5656
uses: actions/setup-python@v2
5757
with:
@@ -74,7 +74,7 @@ jobs:
7474
name: Lint with flake8
7575
steps:
7676
- name: Check out source repository
77-
uses: actions/checkout@v2
77+
uses: actions/checkout@v3
7878

7979
- name: Set up Python environment
8080
uses: actions/setup-python@v2

pymare/results.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Tools for representing and manipulating meta-regression results."""
22

33
import itertools
4+
import math
45
from functools import lru_cache
56
from inspect import getfullargspec
67
from warnings import warn
@@ -322,7 +323,7 @@ def permutation_test(self, n_perm=1000):
322323

323324
# Calculate # of permutations and determine whether to use exact test
324325
if has_mods:
325-
n_exact = np.math.factorial(n_obs)
326+
n_exact = math.factorial(n_obs)
326327
else:
327328
n_exact = 2**n_obs
328329
if n_exact < n_perm:

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ classifiers =
2424
[options]
2525
python_requires = >= 3.8
2626
install_requires =
27-
numpy>=1.8.0
27+
numpy>=1.8.0,<2.0; python_version == "3.9" and extra == 'stan'
28+
numpy>=1.8.0; python_version != "3.9" or extra != 'stan'
2829
pandas
2930
scipy
3031
sympy

0 commit comments

Comments
 (0)