Skip to content

Commit

Permalink
Merge pull request #18 from AstarVienna/fh/rtd
Browse files Browse the repository at this point in the history
Update docs for RTD
  • Loading branch information
teutoburg committed Jan 21, 2024
2 parents b74b277 + c42904f commit ad0e7ae
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 66 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
![dev version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FAstarVienna%2FspeXtra%2Fmaster%2Fpyproject.toml&query=%24.tool.poetry.version&label=dev%20version&color=teal)

[![Documentation Status](https://readthedocs.org/projects/speXtra/badge/?version=latest)](https://speXtra.readthedocs.io/en/latest)
[![Documentation Status](https://readthedocs.org/projects/spextra/badge/?version=latest)](https://speXtra.readthedocs.io/en/latest)
[![codecov](https://codecov.io/gh/AstarVienna/speXtra/graph/badge.svg)](https://codecov.io/gh/AstarVienna/speXtra)
[![PyPI - Version](https://img.shields.io/pypi/v/speXtra)](https://pypi.org/project/speXtra/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/speXtra)
Expand Down
2 changes: 0 additions & 2 deletions docs/authors.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.. _changes:
.. include:: ../CHANGELOG.rst
.. include:: ../CHANGELOG.md
12 changes: 3 additions & 9 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ This can be done by using the following commands

.. code-block:: python
from spextra.utils import Conf
conf = Conf(datadir="path/to/new/datadir")
print(conf.get_data_dir())
# To set it back to the default
Conf(datadir=conf.default_data_dir)
from spextra.configuration import config
config.cache_dir = "path/to/new/datadir"
print(config)
19 changes: 6 additions & 13 deletions docs/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,19 @@ programately

.. jupyter-execute::

from spextra.database import Database
db = Database()
db.libraries
from spextra import spextra_database
spextra_database["libraries"]

it will list the spectral libraries available


.. jupyter-execute::

db.extinction_curves
spextra_database["extinction_curves"]

.. jupyter-execute::

db.filter_systems
spextra_database["filter_systems"]

will print the extinction curves and filter systems available

Expand All @@ -59,9 +58,9 @@ of each spectral library. To use it, simply call it like this

.. jupyter-execute::

from spextra.database import SpecLibrary
from spextra import SpecLibrary
lib = SpecLibrary("kc96")
lib.templates
list(lib)

and it will list all templates available for that library.

Expand All @@ -80,9 +79,3 @@ Database contents

.. literalinclude:: ../database/index.yml
:language: yaml






6 changes: 2 additions & 4 deletions docs/extinction_curves.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ To list the names of the extinction curves included in the database

.. jupyter-execute::

from spextra import Database
db = Database()
db.extinction_curves
from spextra import spextra_database
spextra_database["extinction_curves"]

--------------------------------------------------------------------

Expand Down Expand Up @@ -43,4 +42,3 @@ Calzetti

.. literalinclude:: ../database/extinction_curves/calzetti/index.yml
:language: yaml

10 changes: 4 additions & 6 deletions docs/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ To list the filter systems included in the database

.. jupyter-execute::

from spextra import Database
db = Database()
db.filter_systems
from spextra import spextra_database
spextra_database["filter_systems"]

The ::class::`Pasband` holds the information of an astronomical filter and can be called simply using:

Expand All @@ -31,8 +30,8 @@ Here is a list.

.. jupyter-execute::

from spextra import DEFAULT_FILTERS
DEFAULT_FILTERS
from spextra import DEFAULT_DATA
DEFAULT_DATA.filters


These filters can be used simply using the shortcut
Expand Down Expand Up @@ -86,4 +85,3 @@ ETC

.. literalinclude:: ../database/filter_systems/etc/index.yml
:language: yaml

8 changes: 0 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ speXtra
*******


.. image:: https://travis-ci.org/miguelverdugo/speXtra.svg?branch=master
:target: https://travis-ci.org/github/miguelverdugo/speXtra
:alt: Tests Status

.. image:: https://readthedocs.org/projects/spextra/badge/?version=latest
:target: https://spextra.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

speXtra
=======

Expand Down
5 changes: 1 addition & 4 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
Installation
************

``speXtra`` is written in Python 3.7 and should work with newer versions

The preferred method to install ``spextra`` is using ``pip``

.. code-block:: bash
Expand All @@ -18,7 +16,7 @@ To install the development version, just clone the repository

.. code-block:: bash
git clone https://github.com/miguelverdugo/speXtra
git clone https://github.com/AstarVienna/speXtra.git
cd speXtra
pip install -e .
Expand All @@ -40,4 +38,3 @@ Additionally, you may need the following libraries for specific purposes.

- `matplotlib <http://www.matplotlib.org/>`_ for plotting
- `specutils <specutils.readthedocs.io/>`_ optional for loading external spectra in other formats

37 changes: 26 additions & 11 deletions docs/package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,37 @@ speXtra Package
:nosignatures:
:toctree: generated/

spextra.database.Database
spextra.database.SpecLibrary
spextra.database.ExtCurvesLibrary
spextra.database.FilterSystem
spextra.database.SpectrumContainer
spextra.database.ExtCurveContainer
spextra.database.FilterContainer
spextra.database.spextra_database
spextra.database.DEFAULT_DATA


``spextra.utils module``
``spextra.libraries module``
=========================

.. autosummary::
:nosignatures:
:toctree: generated/

spextra.utils.Config
spextra.utils.download_file
spextra.utils.download_svo_filter
spextra.libraries.SpecLibrary
spextra.libraries.FilterSystem
spextra.libraries.ExtCurvesLibrary


``spextra.configuration module``
=========================

.. autosummary::
:nosignatures:
:toctree: generated/

spextra.configuration.config


``spextra.exceptions module``
=========================

.. autosummary::
:nosignatures:
:toctree: generated/

spextra.exceptions.SpextraError
12 changes: 5 additions & 7 deletions docs/spectral_libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ To list the names of the libraries included in the database

.. jupyter-execute::

from spextra import Database
db = Database()
db.libraries
from spextra import spextra_database
spextra_database["libraries"]


To see which templates are available in each library

.. jupyter-execute::

from spextra.database import SpecLibrary
name = "kc96"
lib = SpecLibrary(name)
lib.templates
from spextra import SpecLibrary
lib = SpecLibrary("kc96")
list(lib)


Below you can find a detailed description of each library.
Expand Down

0 comments on commit ad0e7ae

Please sign in to comment.