Skip to content

Commit 0bf18e4

Browse files
authored
Merge pull request #177 from CalebBell/master
Fix sidebar theme in new sphinx version
2 parents 2fba706 + 57dd6ce commit 0bf18e4

File tree

12 files changed

+91
-57
lines changed

12 files changed

+91
-57
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ _build
6161
._*
6262
_*
6363
!_custom_build/
64+
!docs/_templates/
65+
!docs/_static/
6466
.Spotlight-V100
6567
.Trashes
6668
ehthumbs.db

.readthedocs.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ sphinx:
2222

2323
python:
2424
install:
25-
- requirements: requirements_docs.txt
26-
- method: setuptools
25+
- method: pip
2726
path: .
27+
extra_requirements:
28+
- docs

docs/_static/custom.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* Fix for Sphinx issue #11000: nature theme sidebar overflow with autodoc names */
2+
/* See: https://github.com/sphinx-doc/sphinx/issues/11000 */
3+
4+
/* Increase sidebar width to accommodate longer names */
5+
div.documentwrapper div.bodywrapper {
6+
margin-left: 250px;
7+
}
8+
9+
div.document div.sphinxsidebar {
10+
width: 250px;
11+
}
12+
13+
/* Add scrollbar for overflowing content */
14+
div.sphinxsidebarwrapper div {
15+
overflow: auto;
16+
}

docs/_templates/localtoc.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{# Custom local TOC template with depth limit #}
2+
{%- if display_toc %}
3+
<div>
4+
<h3><a href="{{ pathto(root_doc)|e }}">{{ _('Table of Contents') }}</a></h3>
5+
{{ toctree(maxdepth=1, collapse=False, includehidden=True) }}
6+
</div>
7+
{%- endif %}

docs/chemical_package_tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Introduction to ChemicalConstantsPackage and PropertyCorrelationsPackage
44
.. contents:: :local:
55

66
These two objects are designed to contain information needed by flash algorithms.
7-
In the first iteration of thermo, data was automatically looked up in databases and there was no way to replace that data. Thermo now keeps data and algorithms completely separate. This has also been very helpful to make unit tests that do not change their results.
7+
In the first iteration of Thermo, data was automatically looked up in databases and there was no way to replace that data. Thermo now keeps data and algorithms completely separate. This has also been very helpful to make unit tests that do not change their results.
88

99
There are five places to configure the flash and phase infrastructure:
1010

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@
184184
# so a file named "default.css" will overwrite the builtin "default.css".
185185
html_static_path = ['_static']
186186

187+
# Custom CSS files
188+
html_css_files = ["custom.css"]
189+
187190
# Add any extra paths that contain custom files (such as robots.txt or
188191
# .htaccess) here, relative to this directory. These files are copied
189192
# directly to the root of the documentation.

docs/index.rst

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,65 @@ Thermo: Thermodynamics and Phase Equilibrium component of Chemical Engineering
77
Contents:
88

99
.. toctree::
10-
:maxdepth: 3
10+
:maxdepth: 1
11+
:caption: Tutorial
1112

1213
cubic_equations_of_state
1314
activity_coefficients
1415
property_objects
1516
chemical_package_tutorial
1617
tutorial_phases_and_flash
1718
GibbsExcessLiquid_details
18-
modules
19+
20+
.. toctree::
21+
:maxdepth: 1
22+
:caption: API
23+
24+
thermo.activity
25+
thermo.bulk
26+
thermo.chemical
27+
thermo.chemical_package
28+
thermo.datasheet
29+
thermo.electrochem
30+
thermo.eos
31+
thermo.eos_mix
32+
thermo.eos_mix_methods
33+
thermo.eos_volume
34+
thermo.eos_alpha_functions
35+
thermo.equilibrium
36+
thermo.flash
37+
thermo.functional_groups
38+
thermo.heat_capacity
39+
thermo.interface
40+
thermo.interaction_parameters
41+
thermo.law
42+
thermo.nrtl
43+
thermo.mixture
44+
thermo.permittivity
45+
thermo.phases
46+
thermo.phase_change
47+
thermo.property_package
48+
thermo.phase_identification
49+
thermo.regular_solution
50+
thermo.stream
51+
thermo.thermal_conductivity
52+
thermo.unifac
53+
thermo.units
54+
thermo.utils
55+
thermo.vapor_pressure
56+
thermo.viscosity
57+
thermo.volume
58+
thermo.wilson
59+
thermo.uniquac
60+
thermo.group_contribution.joback
61+
thermo.group_contribution.fedors
62+
thermo.group_contribution.wilson_jasperson
63+
thermo.group_contribution.bondi
64+
65+
.. toctree::
66+
:maxdepth: 1
67+
:caption: Additional Resources
68+
1969
examples
2070

2171

docs/modules.rst

Lines changed: 0 additions & 46 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ max-complexity = 10
347347
"docs/**/*.ipynb" = ["S101", "F403", "F405", "PT011", "B017", "TRY002"]
348348

349349
[tool.pytest.ini_options]
350-
addopts = "--doctest-glob='*.rst' --ignore='setup.py' --ignore='chemical_compare.py' --doctest-modules"
350+
addopts = "--doctest-glob='*.rst'"
351351
norecursedirs = [".cache", ".git", "htmlcov", "notebooks", "dist", "build", "*.egg-info", ".tox", "surfaces", "prof", "benchmarks", "dev", "_build", "_custom_build", "__pycache__"]
352352
doctest_optionflags = ["NORMALIZE_WHITESPACE"]
353353
markers = [

tests/test_numba.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
try:
3737
import numba
3838
import numba.core
39+
if numba is not None:
40+
import chemicals.numba
41+
42+
import thermo.numba
3943
except:
4044
numba = None
4145
import numpy as np
4246

43-
if numba is not None:
44-
import chemicals.numba
45-
46-
import thermo.numba
4747

4848
jit_disabled = os.environ.get('NUMBA_DISABLE_JIT') == '1'
4949

0 commit comments

Comments
 (0)