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
On systems with a shared python installation, we reccomend that users install the package within a virtual python environment.
21
+
On systems with a shared python installation, we recommend that users install the package within a virtual python environment.
23
22
A script designed to automatically setup a virtual environment, install the dependencies, and install pygeos is included in `scripts/setupVirtualPythonEnvironment.bash` .
24
23
The options for the script include:
25
24
26
25
- -p/--python_root : This specifies the root path for the parent python environment
27
26
- -o/--output_path : This specifies location where the virtual environment will be installed
28
27
29
-
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`
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.
30
29
31
-
To use the load the python environment, run the following: `source ~/Python/virtual/geosx/bin/activate` .
32
-
Within the environment, the commands `python` and `pip` will point to the correct versions.
33
-
To exit the virtual environment, run the command: `deactivate` .
30
+
To use the virtual environment, do one of the following:
34
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` ).
35
34
36
35
37
-
XML Preprocessing
36
+
37
+
Advanced XML Features
38
38
=================================
39
39
40
-
The xml preprocessor is designed to take an raw input file, and generate an new file that can be directly read by GEOSX.
40
+
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.
41
41
The syntax for the advanced xml format is given below.
42
42
During the processing the order of operations are:
43
43
@@ -49,14 +49,29 @@ During the processing the order of operations are:
49
49
50
50
51
51
52
-
Use Example
52
+
Command-line Example
53
53
------------------------------
54
54
55
-
`pygeos.preprocessGEOSXML(input, schema='')` is used to process the input xml.
56
-
The name of the newly generated, preprocessed xml file will be returned by this function call.
57
-
By default it will have the name 'prep_' + a randomly generated string.
55
+
Pygeos can be called from the command line to process .xml files via the script.
56
+
(Note: this be on your path if you are in a virtual environment. Otherwise, it can be called directly from the bin directory of your python distribution.)
57
+
The following will read a raw .xml file, generate a processed version, and return the new file name.
58
+
59
+
pygeos input_file.xml
60
+
61
+
Optional arguments include:
62
+
- -o / --output = The desired name for the output file (otherwise, it is randomly generated)
63
+
- -s / --schema = The location of a schema to validate the final .xml file
64
+
- -v / --verbose = Increase module verbosity
65
+
66
+
This can be embedded within a call to GEOSX:
67
+
68
+
srun -n 16 geosx -i \`pygeos input_file.xml\`
69
+
70
+
71
+
Script-based Example
72
+
------------------------------
58
73
59
-
The following is a example python script that will read process an xml file specified via the command line.
74
+
The pygeos module can also be called from within a python script. For example:
60
75
61
76
.. code-block:: python
62
77
@@ -150,7 +165,7 @@ Examples:
150
165
Symbolic Math
151
166
------------------------------
152
167
Input xml files can also include symbolic mathematical expressions.
153
-
These are indicated with curly braces, and use a python syntax.
168
+
These are placed within pairs of backticks (\`), and use a python syntax.
154
169
Parameters and units are evaluated before symbolic expressions.
155
170
Note: symbolic expressions are sanitized by removing any residual alpha characters, but this can be relaxed if more complicated function are needed.
0 commit comments