Skip to content

Commit

Permalink
Run pre-commit tests on all files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-neal committed Aug 28, 2018
1 parent 7e8b325 commit 38a77f8
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ repos:
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
# - id: check-executables-have-shebangs # Doesn't work on windows
# - 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: double-quote-string-fixer
- id: debug-statements
- id: name-tests-test
args: ['--django']
- id: requirements-txt-fixer
# - id: flake8
# - id: flake8
- id: pretty-format-json
- id: sort-simple-yaml
1 change: 0 additions & 1 deletion .shippable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ build:
# Run test and code coverage and output results to the right folder
- pytest --junitxml=shippable/testresults/nosetests.xml
- pytest --cov=spectrum_overload --cov-report=xml:shippable/codecoverage/coverage.xml --durations=10

5 changes: 2 additions & 3 deletions MANIFEST.in
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 *
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![PyPI version](https://badge.fury.io/py/spectrum-overload.svg)](https://badge.fury.io/py/spectrum-overload)[![Updates](https://pyup.io/repos/github/jason-neal/spectrum_overload/shield.svg)](https://pyup.io/repos/github/jason-neal/spectrum_overload/)[![Python 3](https://pyup.io/repos/github/jason-neal/spectrum_overload/python-3-shield.svg)](https://pyup.io/repos/github/jason-neal/spectrum_overload/)

[![Documentation Status](https://readthedocs.org/projects/spectrum-overload/badge/?version=latest)](http://spectrum-overload.readthedocs.io/en/latest/?badge=latest) [![Build Status](https://travis-ci.org/jason-neal/spectrum_overload.svg?branch=master)](https://travis-ci.org/jason-neal/spectrum_overload) [![Coverage Status](https://coveralls.io/repos/github/jason-neal/spectrum_overload/badge.svg?branch=master)](https://coveralls.io/github/jason-neal/spectrum_overload?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3e9a2cf4ad914e0ebc24b6b2b83059db)](https://www.codacy.com/app/jason-neal/spectrum_overload?utm_source=github.com&utm_medium=referral&utm_content=jason-neal/spectrum_overload&utm_campaign=badger)[![Test Coverage](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/coverage.svg)](https://codeclimate.com/github/jason-neal/spectrum_overload/coverage) [![Code Climate](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/gpa.svg)](https://codeclimate.com/github/jason-neal/spectrum_overload)[![Issue Count](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/issue_count.svg)](https://codeclimate.com/github/jason-neal/spectrum_overload)


## Overview
The purpose of this was project was to learn how to use and create Classes, and to create a Spectrum object to use within my Phd work.
Expand All @@ -22,10 +22,10 @@ Further documentation can be found on [read the docs](https://spectrum-overload.

## Installation
### Pip

pip install spectrum-overload

### git / manual
### git / manual
Currently to install and use Spectrum class for your own projects.

clone the git repository where you want it then type:
Expand All @@ -52,7 +52,7 @@ or :

or how ever else you would like to import it.

A tutorial is provided [here](Notebooks/Tutorial.ipynb) to show an example of how to use this class.
A tutorial is provided [here](Notebooks/Tutorial.ipynb) to show an example of how to use this class.


## Contributions
Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import numpy as np
import pytest
from astropy.io import fits
from hypothesis import Verbosity, settings
from pkg_resources import resource_filename

from hypothesis import Verbosity, settings
from spectrum_overload import Spectrum

settings.register_profile("ci", settings(max_examples=1000))
Expand Down
4 changes: 2 additions & 2 deletions pre-commit.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh
# pre-commit.sh
# GitHook for running tests before commiting
# To use link it to
# To use link it to
# ln -s pre-commit.sh .git/hooks/pre-commit

git stash -q --keep-index
bash run_tests.sh
RESULT=$?
git stash pop -q
[ $RESULT -ne 0 ] && exit 1
exit 0
exit 0
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
numpy==1.15.0
matplotlib==2.2.3
astropy==3.0.4
scipy==1.1.0
matplotlib==2.2.3
numpy==1.15.0
pyastronomy==0.13.0

scipy==1.1.0
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

# Run pytest on codebase.
py.test
py.test
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ addopts = --verbose

[metadata]
description-file = README.md

4 changes: 2 additions & 2 deletions spectrum_overload/spectrum.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Spectrum class to represent and manipulate astronomical spectra."""


from __future__ import division, print_function

Expand All @@ -16,8 +18,6 @@

import spectrum_overload.norm as norm

"""Spectrum Class."""


class Spectrum(object):
"""Spectrum class to represent and manipulate astronomical spectra.
Expand Down
2 changes: 1 addition & 1 deletion spectrum_overload/test/install_and_test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!\bin\bash
# automatic install and then test script for Spectrum
# install package
# install package
python setup.py install
# Test package
py.test
6 changes: 2 additions & 4 deletions spectrum_overload/test/test_Spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@
"""
from __future__ import division, print_function

import hypothesis.strategies as st
import numpy as np
import pytest
from astropy.io import fits
from hypothesis import example, given
from pkg_resources import resource_filename
from PyAstronomy import pyasl

import hypothesis.strategies as st

# Test using hypothesis
from hypothesis import example, given
from spectrum_overload import Spectrum, SpectrumError


Expand Down
4 changes: 2 additions & 2 deletions spectrum_overload/test/test_overloaded_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import types

import hypothesis.strategies as st
import numpy as np
import pytest

import hypothesis.strategies as st
from hypothesis import given

from spectrum_overload import Spectrum, SpectrumError


Expand Down

0 comments on commit 38a77f8

Please sign in to comment.