Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ahockin committed Oct 1, 2024
2 parents 6df90fa + 5d990d8 commit e716261
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 31 deletions.
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.7"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: documentation/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: documentation/requirements.txt
1 change: 1 addition & 0 deletions documentation/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-r ../requirements.txt
sphinx
sphinx-copybutton
sphinx_rtd_theme
# matplotlib
ipykernel
2 changes: 1 addition & 1 deletion documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# Don't copy the code prompts:
# https://sphinx-copybutton.readthedocs.io/en/latest/use.html#strip-and-configure-input-prompts-for-code-cells
copybutton_prompt_is_regexp = True
copybutton_prompt_text =r'In \[\d*\]: | {2,5}\.\.\.: '
copybutton_prompt_text =r'In \[\d*\]: | {2,5}\.\.\.: | {2,5}\.\.\.\.:'

# -- Options for HTML output -------------------------------------------------

Expand Down
61 changes: 31 additions & 30 deletions documentation/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ The name of the chemical is checked against the chemical database and the closes

.. ipython:: python
pipe1.set_conditions(chemical_name="Benzeen",
temperature_groundwater=12,
concentration_groundwater=1.8,
flow_rate=0.5)
pipe1.set_conditions(chemical_name="Benzeen",
temperature_groundwater=12,
concentration_groundwater=1.8,
flow_rate=0.5)
The program gives a warning that no drinking water concentration was defined and the concentration has been set at the norm value. In the next step we will override this concentration and calculate the drinking water concentration for our defined conditions. This warning can be suppressed by setting *suppress_warning* = True.
Expand Down Expand Up @@ -107,7 +107,7 @@ Step 1: Create pipe segments and define pipe
material='PE40',
length=25,
inner_diameter=0.0196,
wall_thickness=0.0027,)
wall_thickness=0.0027)
pipe2 = Pipe(segment_list=[seg2])
Expand All @@ -118,10 +118,11 @@ The drinking water concentration is given in the set_conditions() function (*con
Both the groundwater concentration which would not exceed the peak and the mean daily concentration can be calculated.

.. ipython:: python
:okwarning:
pipe2.set_conditions(chemical_name="Benzeen",
temperature_groundwater=12,
flow_rate=0.5)
temperature_groundwater=12,
flow_rate=0.5)
pipe2.validate_input_parameters()
Expand Down Expand Up @@ -153,10 +154,10 @@ In the following example we create a pipe made from two 5m PE40 pipe segments, j
.. ipython:: python
seg1 = Segment(name='seg1',
material='PE40',
length=5,
inner_diameter=0.0196,
wall_thickness=0.0027)
material='PE40',
length=5,
inner_diameter=0.0196,
wall_thickness=0.0027)
seg2 = Segment(name='seg2',
material = 'EPDM',
Expand All @@ -167,10 +168,10 @@ In the following example we create a pipe made from two 5m PE40 pipe segments, j
permeation_direction = 'parallel')
seg3 = Segment(name='seg3',
material='PE40',
length=5,
inner_diameter=0.0196,
wall_thickness=0.0027)
material='PE40',
length=5,
inner_diameter=0.0196,
wall_thickness=0.0027)
pipe2 = Pipe(segment_list=[seg1, seg2, seg3])
Expand All @@ -183,10 +184,10 @@ The remaining calculations are done the same as for the simple example:

.. ipython:: python
pipe2.set_conditions(chemical_name="Benzeen",
temperature_groundwater=12,
concentration_groundwater=1.8,
flow_rate=0.5)
pipe2.set_conditions(chemical_name="Benzeen",
temperature_groundwater=12,
concentration_groundwater=1.8,
flow_rate=0.5)
pipe2.validate_input_parameters()
Expand All @@ -212,17 +213,17 @@ The model contains a chemical database from which the partitioning (Kpw) and dif
chemicals = ['benzene','ethylbenzene', 'toluene']
for chemical in chemicals:
pipe3.set_conditions(
concentration_groundwater=0.1, #g/m3
chemical_name=chemical,
temperature_groundwater=12,
flow_rate=0.5,
suppress_print=True,
suppress_warning = True)
pipe3.set_conditions(
concentration_groundwater=0.1, #g/m3
chemical_name=chemical,
temperature_groundwater=12,
flow_rate=0.5,
suppress_print=True,
suppress_warning = True)
pipe3.validate_input_parameters()
mean_conc = pipe3.calculate_mean_dw_concentration()
print("The mean drinking water concentration for", chemical, "is:", round(mean_conc,8), "g/m3")
pipe3.validate_input_parameters()
mean_conc = pipe3.calculate_mean_dw_concentration()
print("The mean drinking water concentration for", chemical, "is:", round(mean_conc,8), "g/m3")
Example 5 - Advanced settings
Expand Down Expand Up @@ -347,7 +348,7 @@ Model Testing
The model has been tested by calculating the concentration in drinking water given a known groundwater concentration and feeding that drinking water concentration into the model again and verifying the same groundwater concentration is output. This is done for both the peak and mean concentrations for all chemicals in the database where the molecular weight, solubility and drinking water norm were known. In addition, the drinking water norm was less than the solubility limit.

.. ipython:: python
:okwarning:
seg1 = Segment(name='seg1',
material= 'PE40',
length=25,
Expand Down

0 comments on commit e716261

Please sign in to comment.