Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work in progress: upgrade to astropy ecosystem structure #3

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fc6e9db
Style tweaks to all files
bmorris3 Nov 7, 2019
87b1605
Building CI environment
bmorris3 Nov 7, 2019
d8e4844
Adding hela module
bmorris3 Nov 7, 2019
90ad594
Adding sphinx documentation
bmorris3 Nov 7, 2019
1c52785
First self-building docs with plots
bmorris3 Nov 7, 2019
9c546b0
Putting in 'fitting a line' header
bmorris3 Nov 7, 2019
17e5d04
Adding logo to docs page
bmorris3 Nov 7, 2019
28ab4e0
Adding upstream changes to the hela package
bmorris3 Nov 8, 2019
eff1066
Updating docstrings
bmorris3 Nov 8, 2019
5499ec9
Removing accidentally committed version.py
bmorris3 Nov 8, 2019
9378719
API updates to docs, docstrings
bmorris3 Nov 8, 2019
e33a088
Better docstrings, patching tutorial for Pablo's update
bmorris3 Nov 8, 2019
4b4576a
More docstrings, explicit class definitions rather than namedtuples
bmorris3 Nov 8, 2019
2a13bd6
Defining Posterior class
bmorris3 Nov 8, 2019
0bdc590
Better code formatting
bmorris3 Nov 8, 2019
1b0e2c7
updating Posterior API
bmorris3 Nov 8, 2019
83d72fb
Removing redundant train step, removing empty notebook
bmorris3 Nov 8, 2019
6cf54dc
Updating readme, moving old code to legacy dir
bmorris3 Nov 8, 2019
ce1801e
readme tweaks
bmorris3 Nov 8, 2019
a4d4103
readme tweaks
bmorris3 Nov 8, 2019
bed2882
Moving final file into legacy dir
bmorris3 Nov 8, 2019
102f303
Fixing legacy README, adding developer docs
bmorris3 Nov 8, 2019
df9d6b0
tweaking docs build
bmorris3 Nov 8, 2019
9cb3d80
Fixing up package-template structure
bmorris3 Nov 8, 2019
afce4ff
Adding logo back into docs/conf.py
bmorris3 Nov 8, 2019
652179f
Adding first end-to-end test which checks against linear docs example
bmorris3 Nov 8, 2019
c01c96b
Fixing astropy helpers version
bmorris3 Nov 8, 2019
5cfa38a
changing url for ah submodule
bmorris3 Nov 8, 2019
4d4de14
Formatting fixes
bmorris3 Nov 8, 2019
7f11aef
flake8 improvements
bmorris3 Nov 8, 2019
bee11bb
Adding missing testing matrix dependencies
bmorris3 Nov 8, 2019
7001cdc
Editting end-to-end test to improve reliability
bmorris3 Nov 8, 2019
50bc2c6
Splitting out plotting functions from the calculation functions
bmorris3 Nov 8, 2019
c9bcdc3
Updating file/object names with @pmneila's help
bmorris3 Nov 8, 2019
8a6c4ed
Fixing tutorial with new object names
bmorris3 Nov 8, 2019
f2b7b47
flake8 fix
bmorris3 Nov 8, 2019
739d065
Fixing important typo in test
bmorris3 Nov 8, 2019
296d476
Fixing typos in docs
bmorris3 Nov 11, 2019
c5e62d2
Renaming Model -> Retrieval
bmorris3 Nov 11, 2019
8223dab
Reordering returned values from generate_example_data
bmorris3 Nov 11, 2019
f98e83c
Naming tweaks from @pmneila
bmorris3 Nov 12, 2019
cc7168b
API, example data tweaks
bmorris3 Nov 12, 2019
6268e84
Adding missing training line from docs build
bmorris3 Nov 12, 2019
5140253
Fix broken test due to update to generate_example_data
bmorris3 Nov 12, 2019
1b5267c
Object-oriented refactor, but a bit more explicit
bmorris3 Dec 1, 2019
8b51404
minor flake8 (formatting) fixes
bmorris3 Dec 1, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
saved
output
example_dataset
hela/version.py

# Created by https://www.gitignore.io/api/osx,linux,python

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "astropy_helpers"]
path = astropy_helpers
url = git://github.com/astropy/astropy-helpers
12 changes: 12 additions & 0 deletions .rtd-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: hela

channels:
- astropy

dependencies:
- astropy
- numpy
- scikit-learn
- pip:
- sphinx-automodapi
- numpydoc
133 changes: 133 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# We set the language to c because python isn't supported on the MacOS X nodes
# on Travis. However, the language ends up being irrelevant anyway, since we
# install Python ourselves using conda.
language: c

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


stage: Comprehensive tests

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
# Slow tests that should only run if comprehensive ones passed
- name: Slow 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.
- PYTHON_VERSION=3.7
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- MAIN_CMD='python setup.py'
- SETUP_CMD='test'
- EVENT_TYPE='pull_request push'


# List runtime dependencies for the package that are available as conda
# packages here.
- CONDA_DEPENDENCIES='scikit-learn'
- CONDA_DEPENDENCIES_DOC='sphinx-astropy'

# List other runtime dependencies for the package that are available as
# pip packages here.
- PIP_DEPENDENCIES='scipy matplotlib tqdm joblib'

# Conda packages for affiliated packages are hosted in channel
# "astropy" while builds for astropy LTS with recent numpy versions
# are in astropy-ci-extras. If your package uses either of these,
# add the channels to CONDA_CHANNELS along with any other channels
# you want to use.
- CONDA_CHANNELS='astropy'

# If there are matplotlib or other GUI tests, uncomment the following
# line to use the X virtual framebuffer.
# - SETUP_XVFB=True

- FLAKE8_OPT='--ignore=E501,W504'

matrix:

# Don't wait for allowed failures
fast_finish: true

include:
# Make sure that egg_info works without dependencies
- stage: Initial tests
env: PYTHON_VERSION=3.7 SETUP_CMD='egg_info'

# Try MacOS X, usually enough only to run from cron as hardly there are
# issues that are not picked up by a linux worker
- os: osx
stage: Cron tests
env: SETUP_CMD='test' EVENT_TYPE='cron'

# Do a coverage test.
- os: linux
stage: Initial tests
env: SETUP_CMD='test --coverage'

# Do a PEP8 test with flake8
- os: linux
stage: Initial tests
env: MAIN_CMD='flake8 hela --count --show-source --statistics $FLAKE8_OPT' SETUP_CMD=''

allow_failures:
# Do a PEP8 test with flake8
# (do allow to fail unless your code completely compliant)
# - os: linux
# stage: Initial tests
# env: MAIN_CMD='flake8 hela --count --show-source --statistics $FLAKE8_OPT' SETUP_CMD=''

install:

# We now use the ci-helpers package to set up our testing environment.
# This is done by using Miniconda and then using conda and pip to install
# dependencies. Which dependencies are installed using conda and pip is
# determined by the CONDA_DEPENDENCIES and PIP_DEPENDENCIES variables,
# which should be space-delimited lists of package names. See the README
# in https://github.com/astropy/ci-helpers for information about the full
# list of environment variables that can be used to customize your
# environment. In some cases, ci-helpers may not offer enough flexibility
# in how to install a package, in which case you can have additional
# commands in the install: section below.

- git clone --depth 1 git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh

# As described above, using ci-helpers, you should be able to set up an
# environment with dependencies installed using conda and pip, but in some
# cases this may not provide enough flexibility in how to install a
# specific dependency (and it will not be able to install non-Python
# dependencies). Therefore, you can also include commands below (as
# well as at the start of the install section or in the before_install
# section if they are needed before setting up conda) to install any
# other dependencies.

script:
- $MAIN_CMD $SETUP_CMD

after_success:
# If coveralls.io is set up for this package, uncomment the line below.
# The coveragerc file may be customized as needed for your package.
# - if [[ $SETUP_CMD == *coverage* ]]; then coveralls --rcfile='hipparchus/tests/coveragerc'; fi
39 changes: 39 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
include README.rst
include CHANGES.rst

include ah_bootstrap.py
include setup.cfg
include hela/tests/coveragerc

recursive-include hela *.pyx *.c *.pxd
recursive-include docs *
recursive-include licenses *
recursive-include cextern *
recursive-include scripts *

prune build
prune docs/_build
prune docs/api


# the next few stanzas are for astropy_helpers. It's derived from the
# astropy_helpers/MANIFEST.in, but requires additional includes for the actual
# package directory and egg-info.

include astropy_helpers/README.rst
include astropy_helpers/CHANGES.rst
include astropy_helpers/LICENSE.rst
recursive-include astropy_helpers/licenses *

include astropy_helpers/ah_bootstrap.py

recursive-include astropy_helpers/astropy_helpers *.py *.pyx *.c *.h *.rst
recursive-include astropy_helpers/astropy_helpers.egg-info *
# include the sphinx stuff with "*" because there are css/html/rst/etc.
recursive-include astropy_helpers/astropy_helpers/sphinx *

prune astropy_helpers/build
prune astropy_helpers/astropy_helpers/tests


global-exclude *.pyc *.o
44 changes: 44 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.. image:: img/HELA_logo1.png

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

.. image:: http://img.shields.io/badge/arXiv-1806.03944-red.svg?style=flat
:target: https://arxiv.org/abs/1806.03944
:alt: arXiv paper

A Random Forest retrieval algorithm, here used to perform atmospheric retrieval
on exoplanet atmospheres.

Legacy API
++++++++++

If you used HELA previous to the most recent major update and want to recover
the old behavior of HELA, visit the `legacy <legacy>`_ directory for a
legacy branch of the package.

Citation
++++++++

If you use HELA in your work, please cite
`Marquez-Neila et al. 2018 <https://ui.adsabs.harvard.edu/abs/2018NatAs...2..719M/abstract>`_:

.. code-block::

@ARTICLE{2018NatAs...2..719M,
author = {{M{\'a}rquez-Neila}, Pablo and {Fisher}, Chloe and {Sznitman}, Raphael and
{Heng}, Kevin},
title = "{Supervised machine learning for analysing spectra of exoplanetary atmospheres}",
journal = {Nature Astronomy},
keywords = {Astrophysics - Earth and Planetary Astrophysics, Physics - Atmospheric and Oceanic Physics, Physics - Data Analysis, Statistics and Probability},
year = "2018",
month = "Jun",
volume = {2},
pages = {719-724},
doi = {10.1038/s41550-018-0504-2},
archivePrefix = {arXiv},
eprint = {1806.03944},
primaryClass = {astro-ph.EP},
adsurl = {https://ui.adsabs.harvard.edu/abs/2018NatAs...2..719M},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
Loading