|
pyCAPS
pyCAPS: A Python Extension Module for CAPS
|
Defines a CAPS Problem Object. More...
Inherits object.
Inherited by capsProblem.
Public Member Functions | |
| __init__ (self, problemName, phaseName=None, phaseStart=None, capsFile=None, outLevel=1, phaseContinuation=True, phaseReadOnly=False) | |
| Initialize the problem. | |
| close (self) | |
| Exlicitly closes CAPS Problem Object. | |
| closePhase (self, phaseName=None) | |
| Completes the Phase and closes the CAPS Problem Object. | |
| intentPhrase (self, lines) | |
| Set the current intent phrase. | |
| name (self) | |
| Property returns the name of the CAPS Problem Object. | |
| journaling (self) | |
| Boolean indicator if the CAPS Problem Object is currently journaling. | |
| setOutLevel (self, outLevel) | |
| Set the verbosity level of the CAPS output. | |
| autoLinkParameter (self, param=None) | |
| Create a link between a created CAPS parameter and analyis inputs of all loaded AIMs, automatically. | |
| createTree (self, filename="myProblem", **kwargs) | |
| Create a HTML dendrogram/tree of the current state of the problem. | |
Defines a CAPS Problem Object.
The Problem Object is the top-level object for a single mission/problem. It maintains a single set of interrelated geometric models (see ProblemGeometry), analyses to be executed (see Analysis), connectivity and data (see Bound) associated with the run(s), which can be both multi-fidelity and multi-disciplinary.
| Problem.geometry | ProblemGeometry instances representing the CSM geometry |
| Problem.analysis | AnalysisSequence of Analysis instances |
| Problem.parameter | ParamSequence of ValueIn parameters |
| Problem.bound | BoundSequence of Bound instances |
| Problem.attr | AttrSequence of ValueIn attributes |
| __init__ | ( | self, | |
| problemName, | |||
phaseName = None, |
|||
phaseStart = None, |
|||
capsFile = None, |
|||
outLevel = 1, |
|||
phaseContinuation = True, |
|||
phaseReadOnly = False |
|||
| ) |
Initialize the problem.
| problemName | CAPS problem name that serves as the root directory for all file I/O. |
| phaseName | the current phase name (None is equivalent to 'Scratch') |
| phaseStart | name of the phase used to start the new phase |
| capsFile | CAPS file to load. If starting a new phase then this file will replaced the csm file used in previous phases without checking for differences. Options: *.csm or *.egads. |
| outLevel | Level of output verbosity. See setOutLevel . |
| phaseContinuation | use continuation for a open phase, otherwise the phase is first deleted on disk |
| phaseReadOnly | open a closed Phase in Read Only mode |
| autoLinkParameter | ( | self, | |
param = None |
|||
| ) |
Create a link between a created CAPS parameter and analyis inputs of all loaded AIMs, automatically.
Valid CAPS value, parameter objects must be created with Problam.parameter.create(). Note, only links to ANALYSISIN inputs are currently made at this time.
| param | Parameter to use when creating the link (default - None). A combination (i.e. a single or list) of ValueIn dictionary entries and/or value object instances (returned from a call to Problam.parameter.create()) can be used. If no value is provided, all entries in the ValueIn dictionary (ValueIn) will be used. |
| close | ( | self | ) |
Exlicitly closes CAPS Problem Object.
This method is mainly useful for testing purposes
| closePhase | ( | self, | |
phaseName = None |
|||
| ) |
Completes the Phase and closes the CAPS Problem Object.
| phaseName | Phase Name of the Scratch phase is closed as complete |
| createTree | ( | self, | |
filename = "myProblem", |
|||
| ** | kwargs | ||
| ) |
Create a HTML dendrogram/tree of the current state of the problem.
See example problem6.py for a representative use case. The HTML file relies on the open-source JavaScript library, D3, to visualize the data. This library is freely available from https://d3js.org/ and is dynamically loaded within the HTML file. If running on a machine without internet access a (miniaturized) copy of the library may be written to a file alongside the generated HTML file by setting the internetAccess keyword to False. If set to True, internet access will be necessary to view the tree.
| filename | Filename to use when saving the tree (default - "myProblem"). Note an ".html" is automatically appended to the name (same with ".json" if embedJSON = False). |
| **kwargs | See below. |
Valid keywords:
| embedJSON | Embed the JSON tree data in the HTML file itself (default - True). If set to False a seperate file is generated for the JSON tree data. |
| internetAccess | Is internet access available (default - True)? If set to True internet access will be necessary to view the tree. |
| analysisGeom | Show the geometry for each analysis entity (default - False). |
| internalGeomAttr | Show the internal attributes (denoted by starting with an underscore, for example "_AttrName") that exist on the geometry (default - False). |
| reverseMap | Reverse the geometry attribute map (default - False). |
| intentPhrase | ( | self, | |
| lines | |||
| ) |
Set the current intent phrase.
| lines | String or list of strings describing the intent |
| setOutLevel | ( | self, | |
| outLevel | |||
| ) |
Set the verbosity level of the CAPS output.
See problem5.py for a representative use case.
| outLevel | Level of output verbosity. Options: 0 (or "minimal"), 1 (or "standard") [default], and 2 (or "debug"). |