-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,075 additions
and
748 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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
|
||
.mypy_cache/ | ||
.pytest_cache/ | ||
monkeytype.sqlite3 | ||
|
||
# pycharm | ||
.idea/ | ||
|
||
|
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,7 @@ | ||
[settings] | ||
known_third_party = PyAstronomy,astropy,hypothesis,matplotlib,numpy,pkg_resources,pytest,scipy,setuptools,sphinx_rtd_theme | ||
multi_line_output=3 | ||
include_trailing_comma=True | ||
force_grid_wrap=0 | ||
combine_as_imports=True | ||
line_length=88 |
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,39 @@ | ||
exclude: '^$' | ||
fail_fast: false | ||
repos: | ||
- repo: https://github.com/asottile/seed-isort-config | ||
rev: v1.2.0 | ||
hooks: | ||
- id: seed-isort-config | ||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v4.3.4 | ||
hooks: | ||
- id: isort | ||
|
||
- repo: https://github.com/ambv/black | ||
rev: 18.6b4 | ||
hooks: | ||
- id: black | ||
language_version: python3.6 | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v1.4.0 # Use the ref you want to point at | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-docstring-first | ||
# - id: check-executables-have-shebangs # Doesn't work on windows | ||
- id: check-merge-conflict | ||
- id: check-json | ||
- id: check-added-large-files | ||
- id: check-yaml | ||
# - id: double-quote-string-fixer | ||
- id: debug-statements | ||
- id: name-tests-test | ||
args: ['--django'] | ||
- id: requirements-txt-fixer | ||
# - id: flake8 | ||
- id: pretty-format-json | ||
- id: sort-simple-yaml |
File renamed without changes.
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 |
---|---|---|
@@ -1,27 +1,53 @@ | ||
# Spectrum Overload | ||
# Spectrum Overload | ||
## Changelog | ||
|
||
Upcoming release: | ||
|
||
|
||
### 0.3.0 | ||
- Simplified overload operator function. | ||
- Add instrument broadening | ||
- Add indexing/slicing spectrum with [], (Returns new spectrum) | ||
- Add more Type hints | ||
- Handle all warnings as errors in testing. | ||
- Fix test parameters to avoid invalid values. | ||
- Move test fixtures | ||
- Test on python 3.7. | ||
- Add makefile | ||
- Add Appveyor and shippable configuration. | ||
- Some general cleanup | ||
- Update requirements to latest versions. | ||
- Add pre-commits | ||
|
||
##### Depreciations: | ||
- Drop support for python 2.7 | ||
- Due xaxis and flux keywords required with "*,". | ||
- Drop testing of python 3.4. | ||
- Remove tox.ini | ||
|
||
|
||
### 0.2.2 28/8/2018 | ||
- Add styling for markdown in long description. | ||
- Testing on python 3.7 | ||
|
||
## 0.2.1 14/01/2018 | ||
- Patch try resolve pypi styling | ||
|
||
|
||
### October 2017 | ||
For next version | ||
## 0.2.0 14/01/2018 | ||
- Add hypothesis profiles for different test environments. | ||
- Change header initialization from None to and empty dict | ||
- Add normalization e.g. | ||
- Spectrum.normalize("poly", degree=3) | ||
- Add spectrum plot method. | ||
- Standardize operations using a operator wrapper. | ||
- Update documetation. | ||
- Updated documetation. | ||
|
||
|
||
Version 0.. | ||
## Version <0.2.0 | ||
Before october 2017 | ||
Many changes that were unrecorded in this change log... | ||
Spectrum object with interpolation and overloaded operators. | ||
- Many changes that were unrecorded in this change log... | ||
- Spectrum object with interpolation and overloaded operators. | ||
|
||
|
||
Started September 2016 | ||
Project started: September 2016 |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
include README.md | ||
recursive-include spectrum_overload/data * | ||
recursive-include Notebooks * | ||
recursive-include docs * | ||
|
||
recursive-include Notebooks * | ||
recursive-include docs * |
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,63 @@ | ||
# Python makefile https://krzysztofzuraw.com/blog/2016/makefiles-in-python-projects.html | ||
# Delcare all non-file targets as phony | ||
.PHONY: clean clean-build clean-data data isort lint test | ||
TEST_PATH=./ | ||
|
||
help: | ||
@echo " clean-pyc" | ||
@echo " Remove python artifacts." | ||
@echo " clean-build" | ||
@echo " Remove build artifacts." | ||
@echo " isort" | ||
@echo " Sort import statements." | ||
@echo " lint" | ||
@echo " Check style with flake8." | ||
@echo " test" | ||
@echo " Run py.test" | ||
@echo " test-warn" | ||
@echo " Run py.test with warnings errored" | ||
@echo " init" | ||
@echo " Initalize by installing requirements" | ||
@echo " init-dev" | ||
@echo " Initalize by installing normal and dev requirements" | ||
@echo " cov" | ||
@echo " Produce coverage report" | ||
@echo " mypy" | ||
@echo " Run type checking with mypy" | ||
|
||
clean-pyc: | ||
find . -name '*.pyc' -exec rm --force {} + | ||
find . -name '*.pyo' -exec rm --force {} + | ||
find . -name '*~' -exec rm --force {} + | ||
|
||
clean-build: | ||
rm --force --recursive build/ | ||
rm --force --recursive dist/ | ||
rm --force --recursive *.egg-info | ||
|
||
isort: | ||
sh -c "isort --recursive . " | ||
|
||
lint: | ||
flake8 --exclude=.tox | ||
|
||
test: clean-pyc | ||
pytest --verbose --color=yes $(TEST_PATH) | ||
|
||
test-warn: clean-pyc | ||
pytest --verbose --color=yes $(TEST_PATH) -o "filterwarnings=error" | ||
|
||
init: | ||
pip install -r requirements.txt | ||
|
||
init-dev: | ||
pip install -r requirements.txt | ||
pip install -r requirements_dev.txt | ||
|
||
cov: $(module)/* | ||
py.test --cov=$(module) | ||
coverage html | ||
|
||
mypy: | ||
# py.test --mypy | ||
mypy --ignore-missing-imports . |
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 |
---|---|---|
@@ -1,7 +1,35 @@ | ||
import os | ||
from hypothesis import settings, Verbosity | ||
|
||
import numpy as np | ||
import pytest | ||
from astropy.io import fits | ||
from hypothesis import Verbosity, settings | ||
from pkg_resources import resource_filename | ||
|
||
from spectrum_overload import Spectrum | ||
|
||
settings.register_profile("ci", settings(max_examples=1000)) | ||
settings.register_profile("rpi", settings(max_examples=2)) | ||
settings.register_profile("dev", settings(max_examples=10)) | ||
settings.register_profile("debug", settings(max_examples=10, verbosity=Verbosity.verbose)) | ||
settings.load_profile(os.getenv(u'HYPOTHESIS_PROFILE', 'default')) | ||
settings.register_profile( | ||
"debug", settings(max_examples=10, verbosity=Verbosity.verbose) | ||
) | ||
settings.load_profile(os.getenv(u"HYPOTHESIS_PROFILE", "default")) | ||
|
||
|
||
@pytest.fixture | ||
def phoenix_spectrum(): | ||
# Get a phoenix spectrum in test | ||
spec_1 = resource_filename("spectrum_overload", "data/spec_1.fits") | ||
flux = fits.getdata(spec_1) | ||
wave = np.arange(len(flux)) | ||
header = fits.getheader(spec_1) | ||
return Spectrum(xaxis=wave, flux=flux, header=header) | ||
|
||
|
||
@pytest.fixture | ||
def ones_spectrum(): | ||
x = np.linspace(2000, 2200, 1000) | ||
y = np.ones_like(x) | ||
spec = Spectrum(xaxis=x, flux=y) | ||
return spec |
Oops, something went wrong.