Skip to content
Merged
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
60 changes: 55 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,74 @@ 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
run: |
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


1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to change the branch to main after this is merged.


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.

Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion quasarnp/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 1 addition & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, sys, glob, re
import re
from setuptools import setup, find_packages

def _get_version():
Expand All @@ -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)