diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fdb079..6e6a4cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,16 +16,32 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest] - python-version: [3.7, 3.8] + include: + - os: ubuntu-latest + python-version: '3.13' + numpy-version: '<3' + astropy-version: '<8' + - os: ubuntu-latest + python-version: '3.12' + numpy-version: '<2.3' + astropy-version: '<7.1' + - os: ubuntu-latest + python-version: '3.11' + numpy-version: '<2.1' + astropy-version: '<7' + # Similar to NERSC but with last NumPy < 2. + - os: ubuntu-latest + python-version: '3.10' + numpy-version: '<2' + astropy-version: '<6.1' steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install Python dependencies @@ -33,7 +49,41 @@ jobs: python -m pip install --upgrade pip wheel python -m pip install pytest pip install . - - name: Run the test + - name: Test run: pytest + coverage: + name: Test coverage + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + include: + # Similar to NERSC but with last NumPy < 2. + - os: ubuntu-latest + python-version: '3.10' + numpy-version: '<2' + astropy-version: '<6.1' + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip wheel + python -m pip install pytest coverage coveralls + pip install . + - name: Test + run: coverage run -m pytest + - name: Coveralls + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: coveralls --service=github + diff --git a/README.md b/README.md index 15065e7..e2b3b57 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # QuasarNP [![Documentation Status](https://readthedocs.org/projects/quasarnp/badge/?version=latest)](https://quasarnp.readthedocs.io/en/latest/?badge=latest) +[![Coverage Status](https://coveralls.io/repos/github/desihub/QuasarNP/badge.svg?branch=technical_debt)](https://coveralls.io/github/desihub/QuasarNP?branch=technical_debt) QuasarNP is a pure numpy implementation of [QuasarNet](https://github.com/ngbusca/QuasarNET) that is designed to work on the default DESI environment at NERSC without any additional dependencies. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..dd75822 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "quasarnp" +description = "Numpy Implementation of QuasarNet" +dynamic = ["version"] +authors = [{name = "Dylan Green", email = "dylangreen@lbl.gov"}] +license = "MIT" +dependencies = ["numpy", + "fitsio", + "h5py"] +readme = "README.md" \ No newline at end of file diff --git a/quasarnp/layers.py b/quasarnp/layers.py index 51ad192..7c91729 100644 --- a/quasarnp/layers.py +++ b/quasarnp/layers.py @@ -65,7 +65,7 @@ def dense(x, w, b, phi): # This has same behavior as: # https://www.tensorflow.org/api_docs/python/tf/nn/batch_normalization def batch_normalization(x, mean, var, beta, gamma, epsilon): - """Computes the batch normalized version of the input. + r"""Computes the batch normalized version of the input. This function implements a batch normalization layer. Batch normalization renormalizes the input to the layer to a more parsable data range. diff --git a/setup.py b/setup.py index 1515c37..b4d779f 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -import os, sys, glob, re +import re from setuptools import setup, find_packages def _get_version(): @@ -13,16 +13,8 @@ def _get_version(): return version setup_keywords = dict( - name='quasarnp', version=_get_version(), - description='Numpy Implementation of QuasarNet', - url='https://github.com/dylanagreen/QuasarNP', - author='Dylan Green', - author_email='dylanag@uci.edu', - license='MIT', packages=find_packages(), - install_requires=['numpy', 'fitsio', 'h5py'], - zip_safe=False, ) setup(**setup_keywords) \ No newline at end of file