Skip to content

Commit

Permalink
Full API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kboone committed May 28, 2019
1 parent e7a03cb commit 56a7d91
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 13 deletions.
17 changes: 11 additions & 6 deletions avocado/augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
class Augmentor():
"""Class used to augment a dataset.
This class takes :class:`AstronomicalObject`s as input and generates new
:class:`AstronomicalObject`s with the following transformations applied:
This class takes :class:`AstronomicalObject` instances as input and
generates new :class:`AstronomicalObject` instances with the following
transformations applied:
- Drop random observations.
- Drop large blocks of observations.
- For galactic observations, adjust the brightness (= distance).
Expand All @@ -31,10 +33,12 @@ class Augmentor():
This class needs to be subclassed to implement survey specific methods.
These methods are:
- `_augment_metadata`
- Either `_choose_sampling_times` or `_choose_target_observation_count`
- `_simulate_light_curve_uncertainties`
- `_simulate_detection`
- :func:`Augmentor._augment_metadata`
- Either :func:`Augmentor._choose_sampling_times` or
:func:`Augmentor._choose_target_observation_count`
- :func:`Augmentor._simulate_light_curve_uncertainties`
- :func:`Augmentor._simulate_detection`
Parameters
----------
Expand Down Expand Up @@ -136,6 +140,7 @@ def _choose_sampling_times(self, reference_object, augmented_metadata,
=======
sampling_times : pandas Dataframe
A pandas Dataframe that has the following columns:
- time : the times of the simulated observations.
- band : the bands of the simulated observations.
- reference_time : the times in the reference light curve that
Expand Down
136 changes: 129 additions & 7 deletions docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,162 @@ Reference / API

.. currentmodule:: avocado

Dataset
=======

Datasets
========

*Loading/saving a dataset*

.. autosummary::
:toctree: api

Dataset
Dataset.load
Dataset.from_objects
Dataset.get_object

Dataset.path
Dataset.write

*Retrieving objects from the dataset*

.. autosummary::
:toctree: api

Dataset.get_object

*Plotting lightcurves of objects in the dataset*

.. autosummary::
:toctree: api

Dataset.plot_light_curve
Dataset.plot_interactive

*Extracting features from objects in the dataset*

.. autosummary::
:toctree: api

Dataset.extract_raw_features
Dataset.get_raw_features_path
Dataset.write_raw_features
Dataset.load_raw_features
Dataset.select_features

Dataset.label_folds
*Classifying objects in the dataset*

.. autosummary::
:toctree: api

Dataset.predict
Dataset.get_predictions_path
Dataset.write_predictions
Dataset.load_predictions
Dataset.label_folds

AstronomicalObject
==================

Astronomical objects
====================

.. autosummary::
:toctree: api

AstronomicalObject
AstronomicalObject.bands
AstronomicalObject.subtract_background
AstronomicalObject.preprocess_observations
AstronomicalObject.fit_gaussian_process
AstronomicalObject.get_default_gaussian_process
AstronomicalObject.predict_gaussian_process
AstronomicalObject.plot_light_curve
AstronomicalObject.print_metadata


Dataset augmentation
====================

*Augmentor API*

.. autosummary::
:toctree: api

Augmentor
Augmentor.augment_object
Augmentor.augment_dataset

*Augmentor Implementations*

.. autosummary::
:toctree: api

plasticc.PlasticcAugmentor

*Augmentor methods to implement in subclasses*

.. autosummary::
:toctree: api

Augmentor._augment_metadata
Augmentor._choose_sampling_times
Augmentor._choose_target_observation_count
Augmentor._simulate_light_curve_uncertainties
Augmentor._simulate_detection


Classification
==============

*Classifier API*

.. autosummary::
:toctree: api

Classifier
Classifier.train
Classifier.predict
Classifier.path
Classifier.write
Classifier.load

*Classifier Implementations*

.. autosummary::
:toctree: api

LightGBMClassifier

*Weights and metrics*

.. autosummary::

evaluate_weights_flat
evaluate_weights_redshift
weighted_multi_logloss


Feature extraction
==================

*Featurizer API*

.. autosummary::
:toctree: api

Featurizer
Featurizer.extract_raw_features
Featurizer.select_features
Featurizer.extract_features

*Featurizer Implementations*

.. autosummary::
:toctree: api

plasticc.PlasticcFeaturizer

Exceptions
==========

.. autosummary::
:toctree: api

AvocadoException

0 comments on commit 56a7d91

Please sign in to comment.