diff --git a/.gitignore b/.gitignore index b82f7e98c..b6122f165 100644 --- a/.gitignore +++ b/.gitignore @@ -118,4 +118,6 @@ fort.99 savefig/ # ignore generated docs files -_generated/ \ No newline at end of file +_generated/ +docs/auto_examples/ +sg_execution_times.rst \ No newline at end of file diff --git a/changelog.md b/changelog.md index d6966756d..a01f15ef8 100644 --- a/changelog.md +++ b/changelog.md @@ -101,4 +101,14 @@ This release contains _several_ fixes to how CO core masses/remnant masses are h - WD chandrasekhar check use ``mc_co`` instead of ``mc`` - Remnant flags 0-4 inclusive use ``mc_co`` instead of ``mc`` - Got rid of ``mcx`` in ``assign_remnant`` in favour of clearer ``m_proto`` and ``m_FeNi`` to match the papers - - [Very minor] Fryer Rapid was using <= instead of < everywhere \ No newline at end of file + - [Very minor] Fryer Rapid was using <= instead of < everywhere + + +## 3.7.3 +- Additions/changes: + - Add new setting ``LBV_flag`` which allows one to turn off LBV winds, use Hurley+2000, or use Belcyznski+2008 + - Change the default LBV winds to Hurley + +- Documentation: + - Start new settings gallery in the documentation + - Tag settings/options with the version they were added in the docs page and auto link them to release \ No newline at end of file diff --git a/docs/_static/cosmic-docs.css b/docs/_static/cosmic-docs.css index 41cbbd2cc..3989e656a 100644 --- a/docs/_static/cosmic-docs.css +++ b/docs/_static/cosmic-docs.css @@ -125,6 +125,16 @@ html[data-theme="dark"] .sd-card { max-width: 100%; } +.setting-chooser .name-cont { + display: flex; + align-items: center; +} + +.setting-chooser .name { + display: inline-block; + margin-right: 0.5rem; +} + .setting-chooser .description { margin-bottom: 0; } @@ -134,6 +144,10 @@ html[data-theme="dark"] .sd-card { font-weight: bold; } +.setting-chooser .version-added { + font-style: italic; +} + .options { overflow: hidden; } @@ -152,6 +166,41 @@ html[data-theme="dark"] .sd-card { color: var(--color-brand-primary); } +.options .opt-badge-cont { + margin-left: 0.5rem; + font-style: italic; +} + +/* base badge */ +.badge { + display: inline-block; + padding: 0.35em 0.65em; + font-size: 0.75em; + font-weight: 700; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: 0.375rem; +} + +/* pill style */ +.badge.rounded-pill { + border-radius: 50rem; +} + +.badge-primary { background-color: #0d6efd; } +.badge-secondary { background-color: #6c757d; } +.badge-success { background-color: #198754; } +.badge-danger { background-color: #dc3545; } +.badge-warning { background-color: #ffc107; color: #000; } +.badge-info { background-color: #0dcaf0; color: #000; } +.badge-light { background-color: #f8f9fa; color: #000; } +.badge-dark { background-color: #212529; } + + + .setting .col-3 label { cursor: pointer; } @@ -469,4 +518,19 @@ select.form-control { .btn-toggle.active { filter: brightness(1.1); font-weight: bold; +} + +/* Centre gallery thumbnail labels and titles */ +.sphx-glr-thumbcontainer[tooltip]:hover::after, +.sphx-glr-thumbnail-title { + text-align: center; +} + +/* vertically align content in the thumbnails */ +.sphx-glr-thumbcontainer { + justify-content: center; +} + +.link-white { + color: white!important; } \ No newline at end of file diff --git a/docs/_static/gallery.mplstyle b/docs/_static/gallery.mplstyle new file mode 100644 index 000000000..d3ec8e44d --- /dev/null +++ b/docs/_static/gallery.mplstyle @@ -0,0 +1,14 @@ +font.family: serif +text.usetex: False +figure.figsize: 12, 8 +axes.titlesize: 24 +legend.title_fontsize: 18 +legend.fontsize: 16 +axes.labelsize: 24 +xtick.labelsize: 21 +ytick.labelsize: 21 +axes.linewidth: 1.1 +xtick.major.size: 7 +xtick.minor.size: 4 +ytick.major.size: 7 +ytick.minor.size: 4 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 804e0e22a..8009f9755 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,6 +62,7 @@ def setup(app): 'numpydoc', 'sphinx_design', 'sphinx_copybutton', + 'sphinx_gallery.gen_gallery', ] # -- Extensions --------------------------------------------------------------- @@ -76,6 +77,15 @@ def setup(app): autoclass_content = 'class' autodoc_default_flags = ['show-inheritance', 'members', 'inherited-members'] +# -- sphinx_gallery ----------------------------- + +sphinx_gallery_conf = { + 'examples_dirs': 'settings_examples', # path to your example scripts + 'gallery_dirs': 'auto_examples', # path to where to save gallery generated output + 'download_all_examples': False, + 'remove_config_comments': True, +} + # -- autosummary -------------------------------- autosummary_generate = True diff --git a/docs/create_settings_html.py b/docs/create_settings_html.py index 02a782086..9d4f6e50b 100644 --- a/docs/create_settings_html.py +++ b/docs/create_settings_html.py @@ -10,6 +10,22 @@ import bs4 import json import pandas as pd +from cosmic import __version__ as cosmic_version + +# how many versions in the past should we show as badges for when options were added? +VERSION_CUTOFFS = { + "major": 0, + "minor": 3, + "patch": 1000 +} + +def version_is_recent(version_string): + version_nums = version_string.split(".") + cosmic_nums = cosmic_version.split(".") + for i, label in enumerate(["major", "minor", "patch"]): + if int(cosmic_nums[i]) - int(version_nums[i]) > VERSION_CUTOFFS[label]: + return False + return True # blame BS4 for me calling this soup main_soup = """ @@ -29,7 +45,7 @@ settings_template = """
-

+

@@ -43,7 +59,7 @@
""" # same as above, but for an option for a setting, this will go in the