From f31dbf379f0ed76ddd81305d089fdf9c7801cfba Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Tue, 2 Apr 2024 15:27:33 -0400 Subject: [PATCH 1/4] Drop support for Python 3.6 and 3.7 --- .github/workflows/testing.yml | 37 +++++++++++++------------------- .readthedocs.yml | 7 ++++-- pymare/__init__.py | 1 + pymare/datasets/__init__.py | 1 + pymare/datasets/metadat.py | 1 + pymare/effectsize/__init__.py | 1 + pymare/effectsize/base.py | 2 +- pymare/effectsize/expressions.py | 1 + pymare/estimators/__init__.py | 1 + pymare/estimators/combination.py | 1 + pymare/utils.py | 1 + setup.cfg | 2 +- 12 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 050df84..37cb382 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -6,10 +6,10 @@ on: - "master" pull_request: branches: - - '*' + - "*" schedule: # Run tests every Sunday at 12am - - cron: '0 0 * * 0' + - cron: "0 0 * * 0" concurrency: group: environment-${{ github.ref }} @@ -28,46 +28,39 @@ jobs: - id: result_step uses: mstachniuk/ci-skip@master with: - commit-filter: '[skip ci];[ci skip];[skip github]' - commit-filter-separator: ';' + commit-filter: "[skip ci];[ci skip];[skip github]" + commit-filter-separator: ";" run_tests: needs: check_skip if: ${{ needs.check_skip.outputs.skip == 'false' }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest", "macos-latest"] - python-version: ["3.6", "3.7", "3.8", "3.9"] - include: - # ubuntu-20.04 is used only to test python 3.6 - - os: "ubuntu-20.04" - python-version: "3.6" - exclude: - # ubuntu-latest does not support python 3.6 - - os: "ubuntu-latest" - python-version: "3.6" + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest"] + python-version: ["3.8", "3.9"] + name: ${{ matrix.os }} with Python ${{ matrix.python-version }} defaults: run: shell: bash steps: - uses: actions/checkout@v2 - - name: 'Set up python' + - name: "Set up python" uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-version }} - - name: 'Display Python version' + python-version: ${{ matrix.python-version }} + - name: "Display Python version" shell: bash {0} run: python -c "import sys; print(sys.version)" - - name: 'Install PyMARE' + - name: "Install PyMARE" shell: bash {0} run: pip install -e .[tests,stan] - - name: 'Run tests' + - name: "Run tests" shell: bash {0} run: python -m pytest --pyargs pymare --cov=pymare - - name: 'Upload coverage to CodeCov' + - name: "Upload coverage to CodeCov" uses: codecov/codecov-action@v1 if: success() diff --git a/.readthedocs.yml b/.readthedocs.yml index f994a7e..1d35214 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,15 +5,18 @@ # Required version: 2 +build: + os: "ubuntu-22.04" + tools: + python: "3.9" + # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/conf.py python: - version: 3.7 install: - method: pip path: . extra_requirements: - doc - system_packages: true diff --git a/pymare/__init__.py b/pymare/__init__.py index 6f112e9..8127a73 100644 --- a/pymare/__init__.py +++ b/pymare/__init__.py @@ -1,4 +1,5 @@ """PyMARE: Python Meta-Analysis & Regression Engine.""" + import sys import warnings diff --git a/pymare/datasets/__init__.py b/pymare/datasets/__init__.py index d4c0a6e..01d3f4d 100644 --- a/pymare/datasets/__init__.py +++ b/pymare/datasets/__init__.py @@ -1,4 +1,5 @@ """Open meta-analytic datasets.""" + from .metadat import michael2013 __all__ = [ diff --git a/pymare/datasets/metadat.py b/pymare/datasets/metadat.py index f3fcfd5..4592520 100644 --- a/pymare/datasets/metadat.py +++ b/pymare/datasets/metadat.py @@ -1,4 +1,5 @@ """Datasets from metadat.""" + import json import os.path as op diff --git a/pymare/effectsize/__init__.py b/pymare/effectsize/__init__.py index d0a5424..7dbfd8e 100644 --- a/pymare/effectsize/__init__.py +++ b/pymare/effectsize/__init__.py @@ -1,4 +1,5 @@ """Tools for converting between effect-size measures.""" + from .base import ( OneSampleEffectSizeConverter, TwoSampleEffectSizeConverter, diff --git a/pymare/effectsize/base.py b/pymare/effectsize/base.py index ac15b9a..68d8642 100644 --- a/pymare/effectsize/base.py +++ b/pymare/effectsize/base.py @@ -68,7 +68,7 @@ def solve_system(system, known_vars=None): # solver will return a dict if there's only one non-dummy expression if isinstance(solutions, dict): - solutions = [list(solutions.values())] + solutions = [[solutions[s] for s in symbols]] # Prepare the dummy list and data args in a fixed order dummy_list = list(dummies) diff --git a/pymare/effectsize/expressions.py b/pymare/effectsize/expressions.py index 2a56a61..6cc1eeb 100644 --- a/pymare/effectsize/expressions.py +++ b/pymare/effectsize/expressions.py @@ -1,4 +1,5 @@ """Statistical expressions.""" + import json from collections import defaultdict from itertools import chain diff --git a/pymare/estimators/__init__.py b/pymare/estimators/__init__.py index c964654..5b48193 100644 --- a/pymare/estimators/__init__.py +++ b/pymare/estimators/__init__.py @@ -1,4 +1,5 @@ """Estimators for meta-analyses and meta-regressions.""" + from .combination import FisherCombinationTest, StoufferCombinationTest from .estimators import ( DerSimonianLaird, diff --git a/pymare/estimators/combination.py b/pymare/estimators/combination.py index f2ffabc..9bad45b 100644 --- a/pymare/estimators/combination.py +++ b/pymare/estimators/combination.py @@ -1,4 +1,5 @@ """Estimators for combination (p/z) tests.""" + import warnings from abc import abstractmethod diff --git a/pymare/utils.py b/pymare/utils.py index b159a48..d03ea9a 100644 --- a/pymare/utils.py +++ b/pymare/utils.py @@ -1,4 +1,5 @@ """Miscellaneous utility functions.""" + import os.path as op import numpy as np diff --git a/setup.cfg b/setup.cfg index 17959f6..a74a38a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -57,7 +57,7 @@ doc = sphinx>=3.5 sphinx-argparse sphinx-copybutton - sphinx_gallery==0.10.1 + sphinx_gallery sphinx_rtd_theme sphinxcontrib-bibtex tests = From 8f42983c93fc107dc6f71793a08d63b0e4536709 Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Tue, 2 Apr 2024 15:30:05 -0400 Subject: [PATCH 2/4] Run black --- pymare/tests/conftest.py | 1 + pymare/tests/test_combination_tests.py | 1 + pymare/tests/test_core.py | 1 + pymare/tests/test_datasets.py | 1 + pymare/tests/test_effectsize_base.py | 1 + pymare/tests/test_effectsize_expressions.py | 1 + pymare/tests/test_estimators.py | 1 + pymare/tests/test_results.py | 1 + pymare/tests/test_stan_estimators.py | 1 + pymare/tests/test_stats.py | 1 + pymare/tests/test_utils.py | 1 + 11 files changed, 11 insertions(+) diff --git a/pymare/tests/conftest.py b/pymare/tests/conftest.py index 6a3e988..cce93c8 100644 --- a/pymare/tests/conftest.py +++ b/pymare/tests/conftest.py @@ -1,4 +1,5 @@ """Data for tests.""" + import numpy as np import pytest diff --git a/pymare/tests/test_combination_tests.py b/pymare/tests/test_combination_tests.py index feacbc9..36e2918 100644 --- a/pymare/tests/test_combination_tests.py +++ b/pymare/tests/test_combination_tests.py @@ -1,4 +1,5 @@ """Tests for pymare.estimators.combination.""" + import numpy as np import pytest import scipy.stats as ss diff --git a/pymare/tests/test_core.py b/pymare/tests/test_core.py index 8ce58b1..12fd1b4 100644 --- a/pymare/tests/test_core.py +++ b/pymare/tests/test_core.py @@ -1,4 +1,5 @@ """Tests for pymare.core.""" + import numpy as np import pandas as pd import pytest diff --git a/pymare/tests/test_datasets.py b/pymare/tests/test_datasets.py index fcf312f..26859e1 100644 --- a/pymare/tests/test_datasets.py +++ b/pymare/tests/test_datasets.py @@ -1,4 +1,5 @@ """Tests for the pymare.datasets module.""" + import pandas as pd from pymare import datasets diff --git a/pymare/tests/test_effectsize_base.py b/pymare/tests/test_effectsize_base.py index 0616fa8..515b8cb 100644 --- a/pymare/tests/test_effectsize_base.py +++ b/pymare/tests/test_effectsize_base.py @@ -1,4 +1,5 @@ """Tests for pymare.effectsize.base.""" + import numpy as np import pandas as pd import pytest diff --git a/pymare/tests/test_effectsize_expressions.py b/pymare/tests/test_effectsize_expressions.py index b28a675..9c33c9d 100644 --- a/pymare/tests/test_effectsize_expressions.py +++ b/pymare/tests/test_effectsize_expressions.py @@ -1,4 +1,5 @@ """Tests for pymare.effectsize.expressions.""" + import pytest from sympy import Symbol from sympy.core.sympify import SympifyError diff --git a/pymare/tests/test_estimators.py b/pymare/tests/test_estimators.py index 339e163..8b6fece 100644 --- a/pymare/tests/test_estimators.py +++ b/pymare/tests/test_estimators.py @@ -1,4 +1,5 @@ """Tests for pymare.estimators.estimators.""" + import numpy as np import pytest diff --git a/pymare/tests/test_results.py b/pymare/tests/test_results.py index 2baf3bd..5b00742 100644 --- a/pymare/tests/test_results.py +++ b/pymare/tests/test_results.py @@ -1,4 +1,5 @@ """Tests for pymare.results.""" + import numpy as np import pytest diff --git a/pymare/tests/test_stan_estimators.py b/pymare/tests/test_stan_estimators.py index c685ecd..71efc28 100644 --- a/pymare/tests/test_stan_estimators.py +++ b/pymare/tests/test_stan_estimators.py @@ -1,4 +1,5 @@ """Tests for estimators that use stan.""" + import pytest from pymare.estimators import StanMetaRegression diff --git a/pymare/tests/test_stats.py b/pymare/tests/test_stats.py index c350f3f..f01d434 100644 --- a/pymare/tests/test_stats.py +++ b/pymare/tests/test_stats.py @@ -1,4 +1,5 @@ """Tests for pymare.stats.""" + from pymare import stats diff --git a/pymare/tests/test_utils.py b/pymare/tests/test_utils.py index 474b8f8..7ff794c 100644 --- a/pymare/tests/test_utils.py +++ b/pymare/tests/test_utils.py @@ -1,4 +1,5 @@ """Tests for pymare.utils.""" + import os.path as op import numpy as np From 4a93dc553aa56aac5fb37876fc2f14f1f97eea5b Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Tue, 2 Apr 2024 15:31:58 -0400 Subject: [PATCH 3/4] Update results.py --- pymare/results.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pymare/results.py b/pymare/results.py index b84b1f6..31c7d3e 100644 --- a/pymare/results.py +++ b/pymare/results.py @@ -1,4 +1,5 @@ """Tools for representing and manipulating meta-regression results.""" + import itertools from functools import lru_cache from inspect import getfullargspec From 3cfb86b5caf2b21cc3c920812a23967f67b3e9b5 Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Tue, 2 Apr 2024 21:28:57 -0400 Subject: [PATCH 4/4] Update setup.cfg --- setup.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index a74a38a..1d476e4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,14 +28,12 @@ classifiers = Intended Audience :: Science/Research License :: OSI Approved :: MIT License Operating System :: OS Independent - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Topic :: Scientific/Engineering [options] -python_requires = >= 3.6 +python_requires = >= 3.8 install_requires = numpy>=1.8.0 pandas