Conversation
|
Can we get a rough overview of what is planned to be talked about in the SoftwareX article? |
|
Do the updates here mean that the online readthedocs will be deployed from this repo going forward? |
lloyd-rmi
left a comment
There was a problem hiding this comment.
Still some comments to address but overall the updates look reasonable.
|
|
||
| All XML elements are described further in :doc:`opgee-xml`. | ||
| When the model is built, all the ``Streams`` and ``Processes`` identified by | ||
| ``StreamRef`` and ``ProcessRef`` elements within the enclosed ``<ProcessGroup>>`` |
There was a problem hiding this comment.
Delete additional '>' around ProcessGroup
| @@ -134,13 +136,36 @@ is used for both validation and to generate the interactive user interface. | |||
|
|
|||
| ProcessChoice and ProcessGroup | |||
There was a problem hiding this comment.
Should be consist on whether you always want to have <> brackets when referring to XML elements, or if you don't want to use them at all (or only use them the first time a new element is talked about/introduced). Right now it's not completely consistent.
There was a problem hiding this comment.
Good point! I will address.
Note, though, that there are many Python classes of the same name as the XML elements, so whether to include "" brackets depends on whether the element or class is being discussed.
| The file ``etc/opgee.xml``, included in the OPGEE distribution, | ||
| defines a ``Field`` named ``template`` that provides the basis for common | ||
| oil and gas field configurations. The subcommand ``csv2xml`` allows a | ||
| user to define ``Fields`` using a small number of attributes by generating |
There was a problem hiding this comment.
Is there a limit on the # of attributes that can be used by the csv2xml script when creating fields?
| definitions for the 9,000 Fields used in testing OPGEE. See the schematic | ||
| figure below for an illustration of one such field. | ||
|
|
||
| .. figure:: images/gas_lifting.* |
There was a problem hiding this comment.
I don't know if this is just an issue with how GitHub previews these files, but this currently doesn't show up correctly when reviewing on GitHub. I can see the image successfully in the images directory though, so it might just be a GitHub thing
There was a problem hiding this comment.
This is a Sphinx/ReStrucutredText feature and goes beyond the basic Github rendering. You actually need to run sphinx-build to get the properly rendered content.
I just built the docs locally, and the image appears as expected.
| .. figure:: images/gas_lifting.* | ||
| :figclass: align-center | ||
|
|
||
| Schematic diagram of a "gas lifting field" from the "template" field |
There was a problem hiding this comment.
Is this text supposed to be tied to the figure in some way like as a sub-header? currently it just shows up as a "normal" paragraph in the preview after where the image is supposed to be.
There was a problem hiding this comment.
It appears as a caption because it's indented and "within" the ..figure. You can build the docs locally by changing to the OPGEEv4/docs directory and running "make html" (at least on a Mac or in Linux. There's also a make.bat there, which I assume works, but I've never used it.)
After building the docs, you can open docs/build/html/index.html to see the resulting files.
@lloyd-rmi I would support this option given the lack of permissions on the upstream repo. However, before fully committing to this, we should probably have a clearer plan for how changes in the fork will get pushed/synced with upstream. |
It's just a basic description of the software and it's value. Wennan and Adam wanted a journal article on OPGEEv4 that could be cited in other publications. Note that Stanford is funding the development of the paper. Rather than publish the traditional "supporting information", I decided it made more sense to include everything worth discussing directly in the readthedocs documentation. I think it ultimately makes sense to automate the doc generation from the RMI repo, since there's no guarantee that the documentation will remain consistent with whatever the Pitt folks are doing, and which I'm not tracking. |
mbarlow12
left a comment
There was a problem hiding this comment.
Left a coupe non-essential notes for additional content.
I'll also create an issue to add the auditing documentation and clean up those docstrings.
| definitions for the 9,000 Fields used in testing OPGEE. See the schematic | ||
| figure below for an illustration of one such field. | ||
|
|
||
| .. figure:: images/gas_lifting.* |
There was a problem hiding this comment.
This is a Sphinx/ReStrucutredText feature and goes beyond the basic Github rendering. You actually need to run sphinx-build to get the properly rendered content.
I just built the docs locally, and the image appears as expected.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| A ``<ProcessGroup>`` describes a set of ``<ProcessRef>`` and ``<StreamRef>`` elements that | ||
| The ``<ProcessChoice>`` and ``<ProcessGroup>`` elements enable ``Fields`` to be used | ||
| as parameterized templates. A ``<ProcessGroup>`` encloses a set of ``<ProcessRef>`` | ||
| and ``<StreamRef>`` elements that | ||
| can be enabled or disabled as a set. The ``<ProcessChoice>`` element encloses multiple | ||
| ``<ProcessGroup>`` elements and selects among them based on the value of an attribute | ||
| ``<ProcessGroup>`` elements and selects among them based on the value of a ``Field`` attribute | ||
| named in the ``<ProcessChoice>``, whose value must match the name of one of the enclosed | ||
| ``<ProcessGroup>`` elements. |
There was a problem hiding this comment.
Would it be beneficial to add an example to show the 2 equivalent ways of creating the same input?
E.g.
Given the following in opgee.xml and attributes.xml:
<!-- opgee.xml or other template XML file -->
<Field name="my_template">
<!-- ... other field elements -->
<ProcessChoice name="gas_path">
<ProcessGroup name="Minimal">
<ProcessRef name="GasGathering" />
<ProcessRef name="GasDehydration" />
<StreamRef name="GasGathering => GasDehydration" />
<StreamRef name="GasDehydration => GasPartition" />
</ProcessGroup>
<ProcessGroup name="Acid Wet Gas">
<ProcessRef name="GasGathering" />
<ProcessRef name="GasDehydration" />
<ProcessRef name="AcidGasRemoval" />
<ProcessRef name="Demethanizer" />
<ProcessRef name="NGL" />
<StreamRef name="GasGathering => GasDehydration" />
<StreamRef name="GasDehydration => AcidGasRemoval" />
<StreamRef name="AcidGasRemoval => Demethanizer" />
<StreamRef name="Demethanizer => GasPartition" />
<StreamRef name="Demethanizer => NGL" />
</ProcessGroup>
<ProcessGroup name="Acid Gas">
<ProcessRef name="GasGathering" />
<ProcessRef name="GasDehydration" />
<ProcessRef name="AcidGasRemoval" />
<StreamRef name="GasGathering => GasDehydration" />
<StreamRef name="GasDehydration => AcidGasRemoval" />
<StreamRef name="AcidGasRemoval => GasPartition" />
</ProcessGroup>
</ProcessChoice>
</Field>
<!-- attributes.xml -->
<ClassAttrs name="Field">
<Options name="gas_path" default="Minimal">
<Option desc="">None</Option>
<Option desc="Dehydrator">Minimal</Option>
<Option desc="Dehydrator + Amine Process">Acid Gas</Option>
<Option desc="Dehydrator + Amine Process + Demethanizer">Acid Wet Gas</Option>
</Options>
</ClassAttrs>The 2 XML inputs below are equivalent.
<!-- using process choice attribute -->
<Field name="my_field" modifies="my_template">
<A name="gas_path">Acid Gas</A>
</Field>
<!-- using explicit process/stream definitions -->
<Field name="my_field">
<Process class="GasGathering"/>
<Process class="GasDehydration"/>
<Process class="AcidGasRemoval"/>
<Stream src="GasGathering" dst="GasDehydration">
<Contains>gas for gas dehydration</Contains>
</Stream>
<Stream src="GasDehydration" dst="AcidGasRemoval">
<Contains>gas for AGR</Contains>
</Stream>
<Stream src="AcidGasRemoval" dst="GasPartition">
<Contains>gas for gas partition</Contains>
</Stream>
</Field>| matching process proceeds recursively to the next lower level of the XML structure. If a final | ||
| XML element (i.e., one with no children) matches, its text is copied in place of any that appeared | ||
| in the currently merged XML. **Give example.** | ||
| in the currently merged XML. More examples are available in the ``tests/test_merge_xml.py``. |
There was a problem hiding this comment.
Is it possible to create a hyperlink to the test file in the github repo? I tinkered and got this to work.
... merged XML. More examples are available in the |test_merge_xml|_.
.. |test_merge_xml| replace:: ``tests/test_merge_xml.py``
.. _test_merge_xml: https://github.com/RMI/OPGEEv4/blob/main/tests/test_merge_xml.pyThe link works, but it displays as any other inline code with no visual link indicator. The following gets the link highlighting but no code formatting:
`tests/tests_merge_xml.py <https://github.com/RMI/OPGEEv4/blob/main/tests/test_merge_xml.py>`_
Added documentation in preparation for a "SoftwareX" journal article on OPGEE.