Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/pillow-9.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ivh authored Dec 15, 2023
2 parents db30ea4 + 0bad5f7 commit b7a0126
Show file tree
Hide file tree
Showing 169 changed files with 24,395 additions and 6,810 deletions.
13 changes: 13 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[run]
source = pyreduce
omit =
pyreduce/_version.py
examples/*
versioneer.py
setup.py

[report]
show_missing = True

[xml]
output = cov.xml
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
max-line-length = 88
max-complexity = 18
# select = B,C,E,F,W,T4,B9
ignore = E203, E266, E501, W503, F403, F401
select = E9,F63,F7,F82
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyreduce/_version.py export-subst
99 changes: 99 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

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

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: pytest

deploy:
runs-on: ubuntu-latest
needs: [build]
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2

- name: GitHub Tag
id: tag_release
uses: mathieudutour/github-tag-action@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v2
with:
ref: ${{ steps.tag_release.outputs.new_tag }}
clean: true

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Build Wheel
run: pip install wheel && python setup.py sdist

- name: Zip data
id: zip_data
run: |
zip -r dist dist &&
echo "::set-output name=filename::dist.zip"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.tag_release.outputs.new_tag }}
release_name: Release ${{ steps.tag_release.outputs.new_tag }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dist.zip
asset_name: dist.zip
asset_content_type: application/zip

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
39 changes: 0 additions & 39 deletions .gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions .jsbeautifyrc

This file was deleted.

43 changes: 43 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
# Identify invalid files
- id: check-ast
- id: check-yaml
- id: check-json
- id: check-toml
# git checks
- id: check-merge-conflict
- id: check-added-large-files
- id: detect-private-key
- id: check-case-conflict
# Python checks
- id: check-docstring-first
- id: debug-statements
- id: requirements-txt-fixer
- id: fix-encoding-pragma
- id: fix-byte-order-marker
# General checks
- id: mixed-line-ending
exclude: ".fits"
- id: trailing-whitespace
exclude: ".fits"
# - id: check-executables-have-shebangs
- id: end-of-file-fixer
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
hooks:
- id: pyupgrade
- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion .pyup.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# autogenerated pyup.io config file
# autogenerated pyup.io config file
# see https://pyup.io/docs/configuration/ for all available options

schedule: every month
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: "3"
install:
- requirements: docs/requirements.txt
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

9 changes: 7 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ include pyreduce/clib/slit_func_2d_xi_zeta_bd.h

include pyreduce/instruments/*.json
include pyreduce/settings/*.json
include examples/*.json
include test/settings/*.json

include pyreduce/masks/*.gz

include pyreduce/wavecal/*npz
include pyreduce/wavecal/*npz

include setup.cfg
include versioneer.py
include pyreduce/_version.py

include codemeta.json
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[![Build Status](https://travis-ci.org/AWehrhahn/PyReduce.svg?branch=master)](https://travis-ci.org/AWehrhahn/PyReduce)
![Python application](https://github.com/AWehrhahn/PyReduce/workflows/Python%20application/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/pyreduce-astro/badge/?version=latest)](https://pyreduce-astro.readthedocs.io/en/latest/?badge=latest)
[![Updates](https://pyup.io/repos/github/AWehrhahn/PyReduce/shield.svg)](https://pyup.io/repos/github/AWehrhahn/PyReduce/)

# PyReduce is not currently under development and is provided as is. If you want to take over the project, please contact me.

# PyREDUCE

PyReduce is a port of the [REDUCE](http://www.astro.uu.se/~piskunov/RESEARCH/REDUCE/) package to Python3.
Expand All @@ -13,6 +15,15 @@ Installation
------------
PyReduce can be installed using pip using the following command: ``pip install pyreduce-astro``

The most up-to-date version can be installed using ``pip install git+https://github.com/AWehrhahn/PyReduce`` instead. However this may be more buggy than the stable version.

PyReduce uses CFFI to link to the C code, on non-linux platforms you might have to install libffi.
See also https://cffi.readthedocs.io/en/latest/installation.html#platform-specific-instructions for details.

Output Format
-------------
PyReduce will create ``.ech`` files when run. Despite the name those are just regular ``.fits`` files and can be opened with any programm that can read ``.fits``. The data is contained in a table extension. The header contains all the keywords of the input science file, plus some extra PyReduce specific keyword, all of which start with ``e_``.

How To
------
PyReduce is designed to be easy to use, but still be flexible.
Expand All @@ -27,4 +38,4 @@ Papers
------
The original REDUCE paper: [doi:10.1051/0004-6361:20020175](https://doi.org/10.1051/0004-6361:20020175)

A paper describing the changes and updates of PyReduce is in preperation.
A paper describing the changes and updates of PyReduce can be found here: [https://ui.adsabs.harvard.edu/abs/2021A%26A...646A..32P/abstract](https://ui.adsabs.harvard.edu/abs/2021A%26A...646A..32P/abstract)
53 changes: 53 additions & 0 deletions codemeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"@context": [
"https://doi.org/10.5063/schema/codemeta-2.0",
"http://schema.org",
{
"entryPoints": {
"@reverse": "schema:actionApplication"
},
"interfaceType": {
"@id": "codemeta:interfaceType"
},
"specification": {
"@id": "codemeta:specification",
"@type": "@id"
},
"mediatorApplication": {
"@id": "codemeta:mediatorApplication",
"@type": "@id"
}
}
],
"@type": "SoftwareSourceCode",
"identifier": "pyreduce-astro",
"name": "pyreduce-astro",
"version": "0.4b2+0.gffea46e.dirty",
"description": "A data reduction package for echelle spectrographs",
"license": "UNKNOWN, OSI Approved :: GNU General Public License v3 (GPLv3)",
"author": [{
"@type": "Person",
"givenName": "Ansgar",
"familyName": "Wehrhahn",
"email": "[email protected]"
},
{
"@type": "Person",
"givenName": "Nikolai",
"familyName": "Piskunov",
"email": "[email protected]"
}
],
"provider": {
"@id": "https://pypi.org",
"@type": "Organization",
"name": "The Python Package Index",
"url": "https://pypi.org"
},
"runtimePlatform": "Python 3",
"url": "https://github.com/AWehrhahn/PyReduce",
"programmingLanguage": "Python 3",
"operatingSystem": "POSIX :: Linux",
"interfaceType": "LIB",
"contIntegration": "https://travis-ci.org/AWehrhahn/PyReduce"
}
1 change: 0 additions & 1 deletion dev-requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@


# -- Project information -----------------------------------------------------
from pyreduce import __version__

project = "PyReduce"
copyright = "2019, Ansgar Wehrhahn"
author = "Ansgar Wehrhahn"

# The short X.Y version
version = ""
version = __version__.split("+")[0]
# The full version, including alpha/beta/rc tags
release = "0.1"
release = __version__


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -82,7 +83,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "alabaster"
# html_theme = "alabaster"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
Loading

0 comments on commit b7a0126

Please sign in to comment.