Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed May 31, 2020
0 parents commit f94794c
Show file tree
Hide file tree
Showing 25 changed files with 1,265 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Compiled files
*.py[cod]
*.a
*.o
*.so
__pycache__

# Ignore .c files by default to avoid including generated code. If you want to
# add a non-generated .c extension, use `git add -f filename.c`.
*.c

# Other generated files
*/version.py
*/cython_version.py
htmlcov
.coverage
MANIFEST
.ipynb_checkpoints

# Sphinx
docs/api
docs/_build

# Eclipse editor project files
.project
.pydevproject
.settings

# Pycharm editor project files
.idea

# Floobits project files
.floo
.flooignore

# Packages/installer info
*.egg
*.egg-info
dist
build
eggs
.eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
distribute-*.tar.gz

# Other
.cache
.tox
.*.sw[op]
*~
.project
.pydevproject
.settings
pip-wheel-metadata/

# Mac OSX
.DS_Store
15 changes: 15 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2

build:
image: latest

python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs
- all

formats: []
161 changes: 161 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
language: python

# We need a full clone to make sure setuptools_scm works properly
git:
depth: false

os:
- linux

# The apt packages below are needed for sphinx builds. A full list of packages
# that can be included can be found here:
#
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise

addons:
apt:
packages:
- graphviz


stages:
# Do the style check and a single test job, don't proceed if it fails
- name: Initial tests
# Test docs, astropy dev, and without optional dependencies
- name: Comprehensive tests
# These will only run when cron is opted in
- name: Cron tests
if: type = cron


env:
global:

# The following versions are the 'default' for tests, unless
# overridden underneath. They are defined here in order to save having
# to repeat them for all configurations.

# The following three variables are for tox. TOXENV is a standard
# variable that tox uses to determine the environment to run,
# TOXARGS are arguments passed to tox, and TOXPOSARGS are arguments
# that tox passes through to the {posargs} indicator in tox.ini.
# The latter can be used for example to pass arguments to pytest.
- TOXENV='test'
- TOXARGS='-v'
- TOXPOSARGS=''

# The following is needed to avoid issues if e.g. Matplotlib tries
# to open a GUI window.
- SETUP_XVFB=True

matrix:

# Don't wait for allowed failures
fast_finish: true

include:

# Try MacOS X, usually enough only to run from cron as hardly there are
# issues that are not picked up by a linux worker. We set language to
# 'c' since 'python' doesn't work on non-Linux platforms.
- os: osx
language: c
name: Python 3.7 with required dependencies
stage: Cron tests
env: PYTHON_VERSION=3.7 TOXENV=py37-test

# Do a regular build on Linux with Python 3.8, with cov
# For Linux we use language: python to avoid using conda.
- os: linux
python: 3.8
name: Python 3.8 with required dependencies and measure coverage
stage: Initial tests
env: TOXENV=py38-test-cov

# Check for sphinx doc build warnings
- os: linux
python: 3.8
name: Documentation build
stage: Comprehensive tests
env: TOXENV=build_docs

# Now try Astropy dev with the latest Python
- os: linux
python: 3.8
name: Python 3.8 with developer version of astropy
stage: Comprehensive tests
env: TOXENV=py38-test-devdeps

# And with an older Python, Astropy LTS, and the oldest supported Numpy
- os: linux
python: 3.6
name: Python 3.6 astropy LTS and Numpy 1.16
stage: Comprehensive tests
env: TOXENV=py36-test-astropylts-numpy116

# Add a job that runs from cron only and tests against astropy dev and
# numpy dev to give a change for early discovery of issues and feedback
# for both developer teams.
- os: linux
python: 3.8
name: Python 3.8 latest developer version of key dependencies
stage: Cron tests
env: TOXENV=py38-test-devdeps

# Try on Windows.
- os: windows
language: c
name: Python 3.8 with required dependencies
stage: Comprehensive tests
env: PYTHON_VERSION=3.8 TOXENV=py38-test

# Try other python versions and Numpy versions. Since we can assume that
# the Numpy developers have taken care of testing Numpy with different
# versions of Python, we can vary Python and Numpy versions at the same
# time.

- os: linux
python: 3.7
name: Python 3.7 with astropy 3.0 and Numpy 1.17
stage: Comprehensive tests
env: TOXENV=py37-test-astropy30-numpy117

# Do a code style check
- os: linux
python: 3.8
name: Code style checks
stage: Initial tests
env: TOXENV=codestyle

allow_failures:
# Do a PEP8 test with flake8
# (do allow to fail unless your code completely compliant)
# - os: linux
# python: 3.8
# name: Code style checks
# stage: Initial tests
# env: TOXENV=codestyle

install:

# We now use the ci-helpers package to set up our Python environment
# on Windows and MacOS X but we don't set up any other dependencies,
# instead using tox to do this. See https://github.com/astropy/ci-helpers
# for more information about ci-helpers.

- if [[ $TRAVIS_OS_NAME != linux ]]; then
git clone --depth 1 git://github.com/astropy/ci-helpers.git;
source ci-helpers/travis/setup_conda.sh;
fi

script:
- pip install tox
- tox $TOXARGS -- $TOXPOSARGS

after_success:
# If coveralls.io is set up for this package, uncomment the two lines below.
# pip install coveralls
# coveralls
# If codecov is set up for this package, uncomment the two lines below
# pip install codecov
# codecov
16 changes: 16 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
include README.rst
include CHANGES.rst
include setup.cfg
include LICENSE.rst
include pyproject.toml

recursive-include chia *.pyx *.c *.pxd
recursive-include docs *
recursive-include licenses *
recursive-include scripts *

prune build
prune docs/_build
prune docs/api

global-exclude *.pyc *.o
49 changes: 49 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Chromospheric activity via spectroscopy
---------------------------------------

.. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: http://www.astropy.org
:alt: Powered by Astropy Badge


License
-------

This project is Copyright (c) Brett M. Morris, Andrea Guzman Mesa and licensed under
the terms of the BSD 3-Clause license. This package is based upon
the `Astropy package template <https://github.com/astropy/package-template>`_
which is licensed under the BSD 3-clause license. See the licenses folder for
more information.


Contributing
------------

We love contributions! chia is open source,
built on open source, and we'd love to have you hang out in our community.

**Imposter syndrome disclaimer**: We want your help. No, really.

There may be a little voice inside your head that is telling you that you're not
ready to be an open source contributor; that your skills aren't nearly good
enough to contribute. What could you possibly offer a project like this one?

We assure you - the little voice in your head is wrong. If you can write code at
all, you can contribute code to open source. Contributing to open source
projects is a fantastic way to advance one's coding skills. Writing perfect code
isn't the measure of a good developer (that would disqualify all of us!); it's
trying to create something, making mistakes, and learning from those
mistakes. That's how we all improve, and we are happy to help others learn.

Being an open source contributor doesn't just mean writing code, either. You can
help out by writing documentation, tests, or even giving feedback about the
project (and yes - that includes giving feedback about the contribution
process). Some of these contributions may be the most valuable to the project as
a whole, because you're coming to the project with fresh eyes, so you can see
the errors and assumptions that seasoned contributors have glossed over.

Note: This disclaimer was originally written by
`Adrienne Lowe <https://github.com/adriennefriend>`_ for a
`PyCon talk <https://www.youtube.com/watch?v=6Uj746j9Heo>`_, and was adapted by
chia based on its use in the README file for the
`MetPy project <https://github.com/Unidata/MetPy>`_.
9 changes: 9 additions & 0 deletions chia/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

# Packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import * # noqa
# ----------------------------------------------------------------------------

__all__ = []
52 changes: 52 additions & 0 deletions chia/_astropy_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

__all__ = ['__version__']

# this indicates whether or not we are in the package's setup.py
try:
_ASTROPY_SETUP_
except NameError:
import builtins
builtins._ASTROPY_SETUP_ = False

try:
from .version import version as __version__
except ImportError:
__version__ = ''


if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
test = TestRunner.make_test_runner_in(os.path.dirname(__file__))
test.__test__ = False
__all__ += ['test']

# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0] +
" Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error

0 comments on commit f94794c

Please sign in to comment.