Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ _build
._*
_*
!_custom_build/
!docs/_templates/
!docs/_static/
.Spotlight-V100
.Trashes
ehthumbs.db
Expand Down
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ sphinx:

python:
install:
- requirements: requirements_docs.txt
- method: setuptools
- method: pip
path: .
extra_requirements:
- docs
16 changes: 16 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* Fix for Sphinx issue #11000: nature theme sidebar overflow with autodoc names */
/* See: https://github.com/sphinx-doc/sphinx/issues/11000 */

/* Increase sidebar width to accommodate longer names */
div.documentwrapper div.bodywrapper {
margin-left: 250px;
}

div.document div.sphinxsidebar {
width: 250px;
}

/* Add scrollbar for overflowing content */
div.sphinxsidebarwrapper div {
overflow: auto;
}
7 changes: 7 additions & 0 deletions docs/_templates/localtoc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{# Custom local TOC template with depth limit #}
{%- if display_toc %}
<div>
<h3><a href="{{ pathto(root_doc)|e }}">{{ _('Table of Contents') }}</a></h3>
{{ toctree(maxdepth=1, collapse=False, includehidden=True) }}
</div>
{%- endif %}
2 changes: 1 addition & 1 deletion docs/chemical_package_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Introduction to ChemicalConstantsPackage and PropertyCorrelationsPackage
.. contents:: :local:

These two objects are designed to contain information needed by flash algorithms.
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.
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.

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

Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom CSS files
html_css_files = ["custom.css"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
Expand Down
54 changes: 52 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,65 @@ Thermo: Thermodynamics and Phase Equilibrium component of Chemical Engineering
Contents:

.. toctree::
:maxdepth: 3
:maxdepth: 1
:caption: Tutorial

cubic_equations_of_state
activity_coefficients
property_objects
chemical_package_tutorial
tutorial_phases_and_flash
GibbsExcessLiquid_details
modules

.. toctree::
:maxdepth: 1
:caption: API

thermo.activity
thermo.bulk
thermo.chemical
thermo.chemical_package
thermo.datasheet
thermo.electrochem
thermo.eos
thermo.eos_mix
thermo.eos_mix_methods
thermo.eos_volume
thermo.eos_alpha_functions
thermo.equilibrium
thermo.flash
thermo.functional_groups
thermo.heat_capacity
thermo.interface
thermo.interaction_parameters
thermo.law
thermo.nrtl
thermo.mixture
thermo.permittivity
thermo.phases
thermo.phase_change
thermo.property_package
thermo.phase_identification
thermo.regular_solution
thermo.stream
thermo.thermal_conductivity
thermo.unifac
thermo.units
thermo.utils
thermo.vapor_pressure
thermo.viscosity
thermo.volume
thermo.wilson
thermo.uniquac
thermo.group_contribution.joback
thermo.group_contribution.fedors
thermo.group_contribution.wilson_jasperson
thermo.group_contribution.bondi

.. toctree::
:maxdepth: 1
:caption: Additional Resources

examples


Expand Down
46 changes: 0 additions & 46 deletions docs/modules.rst

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ max-complexity = 10
"docs/**/*.ipynb" = ["S101", "F403", "F405", "PT011", "B017", "TRY002"]

[tool.pytest.ini_options]
addopts = "--doctest-glob='*.rst' --ignore='setup.py' --ignore='chemical_compare.py' --doctest-modules"
addopts = "--doctest-glob='*.rst'"
norecursedirs = [".cache", ".git", "htmlcov", "notebooks", "dist", "build", "*.egg-info", ".tox", "surfaces", "prof", "benchmarks", "dev", "_build", "_custom_build", "__pycache__"]
doctest_optionflags = ["NORMALIZE_WHITESPACE"]
markers = [
Expand Down
8 changes: 4 additions & 4 deletions tests/test_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
try:
import numba
import numba.core
if numba is not None:
import chemicals.numba

import thermo.numba
except:
numba = None
import numpy as np

if numba is not None:
import chemicals.numba

import thermo.numba

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

Expand Down
2 changes: 1 addition & 1 deletion thermo/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ def set_from_PT(self, Vs, only_l=False, only_g=False):
self.phase = "l/g"
else:
# Even in the case of three real roots, it is still the min/max that make sense
print([self.T, self.P, b, self.delta, self.epsilon, self.a_alpha, "coordinates of failure"])
# print([self.T, self.P, b, self.delta, self.epsilon, self.a_alpha, "coordinates of failure"])
if self.multicomponent:
extra = f", zs is {self.zs}"
else:
Expand Down
1 change: 1 addition & 0 deletions thermo/eos_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ def volume_solutions_halley(T, P, b, delta, epsilon, a_alpha):
# the value of the second term plus P is equal to P.
if a_alpha/(b*(b + delta) + epsilon) + P == P:
return (b + R*T/P, 0.0, 0.0)

# Run this first, before the low P criteria
if a_alpha > 1e4:
V_possible = high_alpha_one_root(T, P, b, delta, epsilon, a_alpha)
Expand Down
Loading