You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pygeos_package/pygeos/pygeos_documentation.rst
+24-23Lines changed: 24 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ It allows users to include child files, parameters, units, and symbolic math.
8
8
9
9
Setup
10
10
=================================
11
-
The pygeos module is located in the GEOSX repository: `src/coreComponents/python/modules/pygeos_package`.
11
+
The pygeos module is located in the GEOSX repository: `src/coreComponents/python/modules/pygeos_package`.
12
12
The module is compabitable with python 2/3, and depends on the `lxml`, `numpy`, and `re` packages.
13
13
It can be installed into an existing python distribution via pip:
14
14
@@ -19,18 +19,18 @@ Virtual Python Environment
19
19
---------------------------------
20
20
21
21
On systems with a shared python installation, we recommend that users install the package within a virtual python environment.
22
-
A script designed to automatically setup a virtual environment, install the dependencies, and install pygeos is included in `scripts/setupVirtualPythonEnvironment.bash`.
22
+
A script designed to automatically setup a virtual environment, install the dependencies, and install pygeos is included in `scripts/setupVirtualPythonEnvironment.bash`.
23
23
The options for the script include:
24
24
25
-
- -p/--python_root: This specifies the root path for the parent python environment
26
-
- -o/--output_path: This specifies location where the virtual environment will be installed
25
+
- ``-p/--python_root``: This specifies the root path for the parent python environment
26
+
- ``-o/--output_path``: This specifies location where the virtual environment will be installed
27
27
28
-
The default settings for the script will build a virtual environment for the python-3.6.4 installation on LC systems, and will place the environment in `~/Python/virtual/geosx`. The script will also install pygeos and its pre-requisites.
28
+
The default settings for the script will build a virtual environment for the python-3.6.4 installation on LC systems, and will place the environment in `~/Python/virtual/geosx`. The script will also install pygeos and its pre-requisites.
29
29
30
30
To use the virtual environment, do one of the following:
31
31
32
-
1) Load the startup script: `source ~/Python/virtual/geosx/bin/activate`. This will add the (geosx) decorator to your shell, and will set the proper aliases for python, pip, etc. To exit the environment, run `deactivate`.
33
-
2) Access the bin directory of the virtual python environment directly (e.g. `~/Python/virtual/geosx/bin/python some_script.py`).
32
+
1) Load the startup script: `source ~/Python/virtual/geosx/bin/activate`. This will add the (geosx) decorator to your shell, and will set the proper aliases for python, pip, etc. To exit the environment, run `deactivate`.
33
+
2) Access the bin directory of the virtual python environment directly (e.g. `~/Python/virtual/geosx/bin/python some_script.py`).
34
34
35
35
36
36
@@ -51,9 +51,9 @@ The following will read a raw .xml file, generate a processed version, and retur
51
51
52
52
Optional arguments include:
53
53
54
-
- -o / --output = The desired name for the output file (otherwise, it is randomly generated)
55
-
- -s / --schema = The location of a schema to validate the final .xml file
56
-
- -v / --verbose = Increase module verbosity
54
+
- ``-o/--output``: The desired name for the output file (otherwise, it is randomly generated)
55
+
- ``-s/--schema``: The location of a schema to validate the final .xml file
56
+
- ``-v/--verbose``: Increase module verbosity
57
57
58
58
For convenience, this script can be embedded within GEOSX arguments:
59
59
@@ -78,11 +78,11 @@ The pygeos module can also be called from within a python script. For example:
78
78
Advanced XML Features
79
79
=================================
80
80
81
-
The xml preprocessor in pygeos is designed to take an raw input file, and generate an new file that can be directly read by GEOSX.
82
-
The syntax for the advanced xml format is given below.
81
+
The xml preprocessor in pygeos is designed to take a raw input file, and generate a new file that can be directly read by GEOSX.
82
+
The syntax for the advanced XML format is given below.
83
83
During the processing the order of operations are:
84
84
85
-
1) Merging any included xml files into the root structure
85
+
1) Merging any included XML files into the root structure
86
86
2) Substituting in any parameters
87
87
3) Evaluating unit strings
88
88
4) Evaluating symbolic math
@@ -95,10 +95,11 @@ XML inputs can point to included children (these children can then include grand
95
95
During processing, these are recursively inserted into the root XML structure by the following scheme:
96
96
97
97
- Merge two objects if:
98
-
- At the root level and an object with the matching tag exists.
99
-
- If the “name” attribute is present and a object with the matching tag and name exist.
98
+
99
+
- At the root level an object with the matching tag exists.
100
+
- If the "name" attribute is present and an object with the matching tag and name exists.
100
101
- Any preexisting attributes are overwritten by the donor.
101
-
- Otherwise append the xml structure with the target.
102
+
- Otherwise append the XML structure with the target.
102
103
103
104
104
105
.. code-block:: xml
@@ -112,8 +113,8 @@ During processing, these are recursively inserted into the root XML structure by
112
113
113
114
Parameters
114
115
------------------------------
115
-
Parameters are a convenient way to build a configurable and human-readable input xml.
116
-
They are defined via a block in the xml structure.
116
+
Parameters are a convenient way to build a configurable and human-readable input XML.
117
+
They are defined via a block in the XML structure.
117
118
Parameter names may only include upper/lower case letters and underscores (to avoid conflicts with symbolic math).
118
119
Parameters may have any value:
119
120
@@ -124,7 +125,7 @@ Parameters may have any value:
124
125
- Etc.
125
126
126
127
127
-
They can be used in any field within in the xml file (except in Includes) as follows:
128
+
They can be used in any field within in the XML file (except in Includes) as follows:
128
129
129
130
- $x_par
130
131
- $:x_par
@@ -150,8 +151,8 @@ Units
150
151
By default, input values are specified using SI units.
151
152
In some cases, it is useful to override this behavior by explicitly specifying the units of the input.
152
153
These are specified by appending a valid number with a unit definition in square braces.
153
-
The unit manager supports most common units and SI prefixes, using both long- and abbreviated names (e.g.: c, centi, k, kilo, etc.)
154
-
Units may include predefined composite units (dyne, N, etc.) or may be built up from sub-units using a python syntax (e.g.: [N], [kg*m/s**2].
154
+
The unit manager supports most common units and SI prefixes, using both long- and abbreviated names (e.g.: c, centi, k, kilo, etc.).
155
+
Units may include predefined composite units (dyne, N, etc.) or may be built up from sub-units using a python syntax (e.g.: [N], [kg*m/s**2]).
155
156
Any (or no) amount of whitespace is allowed between the number and the unit bracket.
156
157
157
158
@@ -170,7 +171,7 @@ Examples:
170
171
171
172
Symbolic Math
172
173
------------------------------
173
-
Input xml files can also include symbolic mathematical expressions.
174
+
Input XML files can also include symbolic mathematical expressions.
174
175
These are placed within pairs of backticks (\`), and use a python syntax.
175
176
Parameters and units are evaluated before symbolic expressions.
176
177
Note: symbolic expressions are sanitized by removing any residual alpha characters, but this can be relaxed if more complicated function are needed.
@@ -195,6 +196,6 @@ Validation
195
196
------------------------------
196
197
Unmatched special characters ($, [, \`, etc.) mean that parameters, units, or symbolic math were not specified correctly.
197
198
If the code detects these, it will throw an error.
198
-
The XML is validated against the input schema to check if all of the required field are present, and that input parameters match their expected types.
199
+
The XML is validated against the input schema to check if all of the requireds field are present, and that input parameters match their expected types.
0 commit comments