Skip to content

Commit

Permalink
move tests over to Python3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Dec 13, 2020
1 parent 5a351d2 commit 22d49eb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment-dev-py36.yml has not changed
# Increase this value to reset cache if environment-dev-py37.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-dev-py36.yml') }}
hashFiles('conda-envs/environment-dev-py37.yml') }}
- name: Cache multiple paths
uses: actions/cache@v2
env:
Expand All @@ -90,18 +90,18 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py36
activate-environment: pymc3-dev-py37
channel-priority: strict
environment-file: conda-envs/environment-dev-py36.yml
environment-file: conda-envs/environment-dev-py37.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc3
run: |
conda activate pymc3-dev-py36
conda activate pymc3-dev-py37
pip install -e .
python --version
- name: Run tests
run: |
conda activate pymc3-dev-py36
conda activate pymc3-dev-py37
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ repos:
additional_dependencies: [isort==5.6.4]
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade==2.7.4]
args: [--py37-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.6.4
hooks:
Expand All @@ -31,7 +32,7 @@ repos:
rev: v2.7.4
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
Expand Down
4 changes: 2 additions & 2 deletions pymc3/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,12 @@ def sample(
random_seed = None
if chains == 1 and isinstance(random_seed, int):
random_seed = [random_seed]
if random_seed is not None and not isinstance(random_seed, (int, abc.Iterable)):
raise TypeError("Invalid value for `random_seed`. Must be tuple, list or int")
if random_seed is None or isinstance(random_seed, int):
if random_seed is not None:
np.random.seed(random_seed)
random_seed = [np.random.randint(2 ** 30) for _ in range(chains)]
if not isinstance(random_seed, abc.Iterable):
raise TypeError("Invalid value for `random_seed`. Must be tuple, list or int")

if not discard_tuned_samples and not return_inferencedata:
warnings.warn(
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ exclude_lines = [
isort = 1
black = 1
pyupgrade = 1

[tool.nbqa.addopts]
pyupgrade = ["--py36-plus"]

0 comments on commit 22d49eb

Please sign in to comment.