Skip to content

Commit 0d26448

Browse files
authored
Revamp docs and add page on IDL-fiasco comparisons (#259)
* use conda to get graphviz * switch to pydata theme * move api docs and bibliography into the same section * remove unused changelog page * reorganize docs into quick start, topic guides, and how-to guides * reorganize landing page * include secondary sidebar * fix link * separate gallery into subsections, with one for IDL comparisons * fix missing link * fix package name * add ioneq comparison * add gallery example comparing ioneq * make path to dbase a kwarg * fix link to reference page * fix example to include corrected computed rates * update continuum test data * add continuum comparison example * add contribution function comparison * move test file list to single external file * always make paths in config a pathlib * skip the doctests in quickstart for now * docs build needs asdf-astropy * add a function in the tools dir to update the test file list * add rate files to test file list * reorganize api docs a bit
1 parent 9d531da commit 0d26448

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2602
-515
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
docs/sg_execution_times.rst
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]

.readthedocs.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ version: 2
99
build:
1010
os: ubuntu-22.04
1111
tools:
12-
python: "3.11"
12+
python: "mambaforge-4.10"
1313

1414
# Build documentation in the docs/ directory with Sphinx
1515
sphinx:
1616
configuration: docs/conf.py
1717

18+
# Using conda to get a working version of graphviz
19+
conda:
20+
environment: .rtd-environment.yml
21+
1822
# Optionally build your docs in additional formats such as PDF and ePub
1923
formats: []
2024

.rtd-environment.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: rtd_fiasco
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.11
6+
- pip
7+
- graphviz!=2.42.*,!=2.43.*

docs/chianti.rst

-105
This file was deleted.

docs/code_ref/index.rst

-9
This file was deleted.

docs/conf.py

+43-46
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
'sphinx_automodapi.automodapi',
4242
'sphinx_automodapi.smart_resolver',
4343
'sphinxcontrib.bibtex',
44+
'sphinx_design',
4445
]
4546

4647
# Add any paths that contain templates here, relative to this directory.
@@ -91,13 +92,38 @@
9192
# The theme to use for HTML and HTML Help pages. See the documentation for
9293
# a list of builtin themes.
9394

94-
html_theme = 'sphinx_book_theme'
95+
html_theme = 'pydata_sphinx_theme'
9596

9697
# -- Sphinx Book Theme Options -----------------------------------------------------
9798
html_theme_options = {
98-
"repository_url": 'https://github.com/wtbarnes/fiasco',
99-
"use_repository_button": True,
100-
"use_issues_button": True,
99+
"use_edit_page_button": True,
100+
"icon_links": [
101+
{
102+
"name": "GitHub",
103+
"url": "https://github.com/wtbarnes/fiasco",
104+
"icon": "fa-brands fa-github",
105+
},
106+
{
107+
"name": "PyPI",
108+
"url": "https://pypi.org/project/fiasco/",
109+
"icon": "fa-brands fa-python",
110+
},
111+
{
112+
"name": "CHIANTI",
113+
"url": "http://chiantidatabase.org/",
114+
"icon": "fa-solid fa-wine-glass",
115+
}
116+
],
117+
#"secondary_sidebar_items": {
118+
# "index": [] # Remove secondary sidebar on landing page
119+
#},
120+
"announcement": "fiasco currently only supports version 8 of the CHIANTI database.",
121+
}
122+
html_context = {
123+
"github_user": "wtbarnes",
124+
"github_repo": "fiasco",
125+
"github_version": "main",
126+
"doc_path": "docs",
101127
}
102128
html_logo = '_static/fiasco-logo.png'
103129

@@ -127,7 +153,7 @@
127153

128154
# On Read the Docs and CI, download the database and build a minimal HDF5 version
129155
if ON_RTD or ON_GHA:
130-
from fiasco.util import build_hdf5_dbase, download_dbase
156+
from fiasco.util import build_hdf5_dbase, download_dbase, get_test_file_list
131157
from fiasco.util.setup_db import CHIANTI_URL, LATEST_VERSION
132158
FIASCO_HOME = pathlib.Path.home() / '.fiasco'
133159
FIASCO_HOME.mkdir(exist_ok=True, parents=True)
@@ -137,43 +163,7 @@
137163
build_hdf5_dbase(
138164
ascii_dbase_root,
139165
hdf5_dbase_root,
140-
files=[
141-
'chianti.ip',
142-
'chianti.ioneq',
143-
'sun_coronal_1992_feldman_ext.abund',
144-
'sun_coronal_1992_feldman.abund',
145-
'c_1.diparams',
146-
'c_2.diparams',
147-
'c_2.drparams',
148-
'c_2.rrparams',
149-
'c_3.diparams',
150-
'c_3.drparams',
151-
'c_3.easplups',
152-
'c_3.rrparams',
153-
'c_4.diparams',
154-
'c_4.drparams',
155-
'c_4.easplups',
156-
'c_4.rrparams',
157-
'c_5.diparams',
158-
'c_5.drparams',
159-
'c_5.rrparams',
160-
'c_6.diparams',
161-
'c_6.drparams',
162-
'c_6.rrparams',
163-
'c_7.rrparams',
164-
'fe_5.elvlc',
165-
'fe_15.elvlc',
166-
'fe_16.diparams',
167-
'fe_16.drparams',
168-
'fe_16.easplups',
169-
'fe_16.rrparams',
170-
'fe_18.elvlc',
171-
'fe_18.wgfa',
172-
'fe_18.scups',
173-
'o_6.scups',
174-
'o_6.elvlc',
175-
'o_6.wgfa',
176-
]
166+
files=get_test_file_list(),
177167
)
178168
with (FIASCO_HOME / 'fiascorc').open('w') as f:
179169
c = configparser.ConfigParser()
@@ -183,10 +173,17 @@
183173
c.write(f)
184174

185175
# -- Sphinx gallery -----------------------------------------------------------
176+
from sphinx_gallery.sorting import ExampleTitleSortKey, ExplicitOrder # NOQA: E402
177+
186178
extensions += ['sphinx_gallery.gen_gallery']
187179
sphinx_gallery_conf = {
188-
'examples_dirs': '../examples', # path to your example scripts
189-
'gallery_dirs': 'generated/gallery', # path to where to save gallery generated output
190-
'filename_pattern': '^((?!skip_).)*$',
191-
'default_thumb_file': '_static/fiasco-logo.png'
180+
'subsection_order': ExplicitOrder([
181+
'../examples/user_guide/',
182+
'../examples/idl_comparisons/',
183+
]),
184+
'within_subsection_order': ExampleTitleSortKey,
185+
'examples_dirs': '../examples', # path to your example scripts
186+
'gallery_dirs': 'generated/gallery', # path to where to save gallery generated output
187+
'filename_pattern': '^((?!skip_).)*$',
188+
'default_thumb_file': '_static/fiasco-logo.png'
192189
}

0 commit comments

Comments
 (0)