Skip to content

Commit

Permalink
Merge pull request #107 from aburrell/readthedocs_hotfix
Browse files Browse the repository at this point in the history
BUG: no fortran on readthedocs
  • Loading branch information
aburrell authored Dec 9, 2022
2 parents 063c5ad + 5ff7766 commit 08c1a37
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 78 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ docs/_build
*~
.*.sw[po]
.build
autoapi
.ve
.env
.cache
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = src/apexpy
SPHINXPROJ = apexpy
SOURCEDIR = .
BUILDDIR = .build

Expand Down
66 changes: 66 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Reference
=========

The :py:class:`apexpy.Apex` class is used for all the main functionality
(converting between coordinate systems, field line mapping, and calculating
base vectors). The :py:mod:`apexpy.helpers` sub-module includes additional
functions that may be useful, especially :py:func:`~apexpy.helpers.subsol`.
The :py:mod:`apexpy.fortranapex` module is the interface to the apex Fortran
library by Emmert et al. [2010] [1]_. The interface is not documented.
Use :class:`apexpy.Apex` for all conversions and calculations. You can find
some documentation of the actual Fortran library in the source file
`apexsh.f90 <https://github.com/aburrell/apexpy/blob/main/fortranapex/apexsh.f90>`_. These functions may also be accessed through the command-line interface.

.. _api:

API
---

.. toctree::
:maxdepth: 2

autoapi/generated/apexpy/index.rst


.. _cli:

Command-line interface
----------------------

.. highlight:: none

When you install this package you will get a command called ``apexpy``, which
is an interface to the :py:meth:`~apexpy.Apex.convert` method. See the
documentation for this method for a more thorough explanation of arguments and
behaviour.

You can get help on the command by running ``apexpy -h``.

.. code::
$ apexpy -h
usage: apexpy [-h] [--height HEIGHT] [--refh REFH] [-i FILE_IN]
[-o FILE_OUT] SOURCE DEST DATE
Converts between geodetic, modified apex, quasi-dipole and MLT
positional arguments:
SOURCE Convert from {geo, apex, qd, mlt}
DEST Convert to {geo, apex, qd, mlt}
DATE YYYY[MM[DD[HHMMSS]]] date/time for IGRF
coefficients, time part required for MLT
calculations
optional arguments:
-h, --help show this help message and exit
--height HEIGHT height for conversion
--refh REFH reference height for modified apex coordinates
-i FILE_IN, --input FILE_IN
input file (stdin if none specified)
-o FILE_OUT, --output FILE_OUT
output file (stdout if none specified)
.. [1] Emmert, J. T., A. D. Richmond, and D. P. Drob (2010),
A computationally compact representation of Magnetic-Apex
and Quasi-Dipole coordinates with smooth base vectors,
J. Geophys. Res., 115(A8), A08322, :doi:`10.1029/2010JA015326`.
11 changes: 10 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'sphinx.ext.extlinks']
'sphinx.ext.extlinks',
'autoapi.extension']

# Define common elements

Expand All @@ -28,6 +29,13 @@
match = re.findall(regex, text)
version = release = match[0].strip("'")

# Configure autoapi
autoapi_type = 'python'
autoapi_dirs = ['../apexpy']
autoapi_keep_files = True
autoapi_root = 'autoapi/generated'


# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
Expand All @@ -41,6 +49,7 @@
html_sidebars = {'**': ['searchbox.html', 'globaltoc.html', 'sourcelink.html']}
html_short_title = '-'.join([project, version])
autodoc_member_order = 'bysource'
autodoc_mock_imports = ['apexpy']
napoleon_use_ivar = True
napoleon_use_rtype = False
napoleon_use_param = False
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Contents
readme
installation
examples/index
reference/index
api
contributing
maintenance
authors
Expand Down
9 changes: 0 additions & 9 deletions docs/reference/Apex.rst

This file was deleted.

37 changes: 0 additions & 37 deletions docs/reference/cli.rst

This file was deleted.

13 changes: 0 additions & 13 deletions docs/reference/fortranapex.rst

This file was deleted.

5 changes: 0 additions & 5 deletions docs/reference/helpers.rst

This file was deleted.

10 changes: 0 additions & 10 deletions docs/reference/index.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx>=1.3
sphinx-autoapi
sphinx_rtd_theme
.

0 comments on commit 08c1a37

Please sign in to comment.