-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into inspections
- Loading branch information
Showing
39 changed files
with
321 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Test Package | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
push: | ||
|
||
jobs: | ||
run-tests: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.8", "3.9", "3.10", "3.11" ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
run: | | ||
pip install poetry | ||
poetry env use python${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: poetry install --with tests | ||
|
||
- name: Run tests with coverage | ||
run: | | ||
poetry run coverage run -m unittest discover | ||
poetry run coverage report --omit="tests/*" | ||
poetry run coverage xml --omit="tests/*" -o coverage.xml | ||
# Use this job for branch protection rules | ||
report-test-status: | ||
name: Report Test Status | ||
if: always() | ||
needs: run-tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check build status | ||
if: ${{ contains(needs.*.result, 'failure') }} | ||
run: exit 1 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry] | ||
name = "sndata" | ||
version = "0.0.0" # Version is set dynamically by the CI tool on publication | ||
authors = ["Daniel Perrefort"] | ||
readme = "README.md" | ||
description = "A Python interface for data published by various supernova surveys." | ||
homepage = "http://sndata.readthedocs.io/" | ||
repository = "https://github.com/sncosmo/SNData/" | ||
documentation = "http://sndata.readthedocs.io/" | ||
keywords = ["astronomy", "supernova", "data"] | ||
packages = [{ include = "sndata" }] | ||
include = [ | ||
"sndata/sdss/Spectra_txt.zip", | ||
"sndata/loss/sndb_meta.csv" | ||
] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Scientific/Engineering :: Astronomy", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
"Typing :: Typed" | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.8" | ||
beautifulsoup4 = "*" | ||
astropy = "*" | ||
cython = "*" | ||
numpy = ">=1.17.0" | ||
pandas = "*" | ||
pyyaml = "*" | ||
requests = "*" | ||
tqdm = "*" | ||
sncosmo = "*" | ||
pytz = "*" | ||
|
||
[tool.poetry.group.tests] | ||
optional = true | ||
|
||
[tool.poetry.group.tests.dependencies] | ||
coverage = "*" | ||
|
||
[tool.poetry.group.docs] | ||
optional = true | ||
|
||
[tool.poetry.group.docs.dependencies] | ||
sphinx = "*" | ||
sphinx-copybutton = "*" | ||
sphinx_rtd_theme = "*" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""This module defines reusable setup and testing logic for streamlining the | ||
creation of downstream tests. | ||
""" | ||
|
||
from unittest import SkipTest | ||
|
||
import requests | ||
|
||
from .data_parsing_tests import * | ||
from .ui_tests import * | ||
|
||
|
||
def download_data_or_skip(release): | ||
"""Download data for the given data release. Skip any further tests if the download fails""" | ||
|
||
try: | ||
release.download_module_data() | ||
|
||
except requests.exceptions.ConnectionError: | ||
raise SkipTest('Could not connect to one or more remote servers.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
tests/standard_ui_template_tests.py → tests/common_tests/ui_tests.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Tests for the ``csp.DR1`` class.""" | ||
|
||
from unittest import TestCase | ||
|
||
from sndata.csp import DR1 | ||
from ..common_tests import SpectroscopicDataParsing, SpectroscopicDataUI, download_data_or_skip | ||
|
||
download_data_or_skip(DR1()) | ||
|
||
|
||
class DR1Parsing(TestCase, SpectroscopicDataParsing): | ||
"""Data parsing tests for the DR1 release""" | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.test_class = DR1() | ||
|
||
|
||
class DR1UI(TestCase, SpectroscopicDataUI): | ||
"""UI tests for the DR1 release""" | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.test_class = DR1() |
Oops, something went wrong.