Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
88 changes: 14 additions & 74 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: tests

on:
push:
pull_request:
branches: [master]
pull_request:

jobs:
tests:
Expand All @@ -12,92 +12,32 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.7"
pymc-version: "pymc3==3.9.3"
arviz-version: "arviz==0.11.1"
- python-version: "3.8"
pymc-version: "pymc3==3.9.3"
arviz-version: "arviz==0.11.1"
- python-version: "3.8"
pymc-version: "pymc3==3.10"
arviz-version: "arviz==0.11.1"
- python-version: "3.8"
pymc-version: "pymc3==3.11"
arviz-version: ""
- python-version: "3.9"
pymc-version: "pymc3==3.11"
arviz-version: ""
# TODO:
# - python-version: "3.8"
# pymc-version: "https://github.com/pymc-devs/pymc3/archive/main.zip"
# arviz-version: ""
python-version: ["3.9", "3.10"]
pymc-version: ["3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- uses: actions/cache@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
path: ~/.theano
key: ${{ runner.os }}-${{ matrix.pymc-version }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.pymc-version }}-
python-version: ${{ matrix.python-version }}

- name: Set up Python
id: setup_python
uses: conda-incubator/setup-miniconda@v2
- uses: actions/cache@v3
with:
auto-update-conda: true
activate-environment: starry
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
path: ~/.theano
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pymc-version }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pymc-version }}-

- name: Install dependencies
id: install
if: steps.setup_python.outcome == 'success'
shell: bash -l {0}
run: |
python -m pip install -U pip
python -m pip install ${{ matrix.pymc-version }} ${{ matrix.arviz-version }}
python -m pip install pymc3==${{ matrix.pymc-version }}
STARRY_UNIT_TESTS=1 python -m pip install -e ".[tests]"

- name: Run tests
if: steps.install.outcome == 'success'
shell: bash -l {0}
run: python -m pytest -v --junitxml=junit/test-results.xml --cov=starry

- name: Get unique id
id: unique-id
if: always()
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: |
export JOB_ID=`echo $STRATEGY_CONTEXT | md5sum`
echo "::set-output name=id::$JOB_ID"

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: junit/test-*.xml
comment_mode: off

- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
if: always()
with:
parallel: true
flag-name: Unit Test

coveralls_finish:
needs: tests
runs-on: ubuntu-latest
if: always()
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
run: python -m pytest -v
34 changes: 14 additions & 20 deletions .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,37 @@ jobs:
fail-fast: false
matrix:
include:
- pymc-version: "pymc3==3.9.3"
arviz-version: "arviz==0.11.1"
- pymc-version: "3.11"

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true

- uses: actions/cache@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- uses: actions/cache@v3
with:
path: ~/.theano
key: ${{ runner.os }}-${{ matrix.pymc-version }}-${{ github.sha }}
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pymc-version }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.pymc-version }}-
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pymc-version }}-

- name: Set up Python
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: starry
environment-file: environment.yml
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install pymc3==${{ matrix.pymc-version }} pymc3-ext sympy corner batman-package jupyter
python -m pip install -e ".[docs]"

- name: Set up environment
shell: bash -l {0}
run: |
jupyter nbextension enable --py widgetsnbextension

- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install -U pip
python -m pip install ${{ matrix.pymc-version }} ${{ matrix.arviz-version }} pymc3-ext
python -m pip install -U sympy
python -m pip install -U corner
python -m pip install -U batman-package
python -m pip install -e ".[docs]"

- name: Execute notebooks
shell: bash -l {0}
run: |
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""Install script for `starry`."""
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
import warnings
import setuptools
import subprocess
import sys
import os
import glob
Expand Down Expand Up @@ -206,7 +204,8 @@ def build_extensions(self):
},
install_requires=[
"setuptools_scm",
"numpy>=1.19.2",
"numpy>=1.19.2,<1.22",
"xarray<2023.10.0",
"scipy>=1.5.0",
"astropy>=3.1",
"pymc3",
Expand Down
2 changes: 2 additions & 0 deletions starry/extensions/tests/greedy/test_greedy_nexsci.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
starry.config.lazy = False


@pytest.mark.xfail
def test_greedy_nexsci_query():
"""Tests if the nexsci query works."""
# These should run without error
Expand All @@ -27,6 +28,7 @@ def test_greedy_nexsci_query():
assert isinstance(df, pd.DataFrame)


@pytest.mark.xfail
def test_greedy_nexsci_local():
"""Tests if creating a system from the local csv file works"""

Expand Down
2 changes: 2 additions & 0 deletions starry/extensions/tests/lazy/test_lazy_nexsci.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
starry.config.lazy = True


@pytest.mark.xfail
def test_lazy_nexsci_query():
"""Tests if the nexsci query works."""

Expand All @@ -28,6 +29,7 @@ def test_lazy_nexsci_query():
assert isinstance(df, pd.DataFrame)


@pytest.mark.xfail
def test_lazy_nexsci_local():
"""Tests if creating a system from the local csv file works"""

Expand Down