Package openmdao.lib

This package contains the OpenMDAO Standard Library. It’s intended to contain all of the plugins that are officially supported and released as part of openmdao.

api.py

Pseudo package containing plugins from the OpenMDAO Standard Library.

Public Variables

Array
Bool
CBool
Complex
Dict
Enum
File
Float
Instance
Int
List
Str

Drivers

CaseIteratorDriver
CONMINdriver
Genetic
Iterate

Components

ExternalCode

CaseIterators

ListCaseIterator
DBCaseIterator

CaseRecorders

DBCaseRecorder
DumpCaseRecorder

dbcaseiter.py

class openmdao.lib.caseiterators.dbcaseiter.DBCaseIterator(dbfile=':memory:', case_selector=None, var_selector=None)[source]

Bases: object

Pulls Cases from a relational DB (sqlite).

dbfile[source]

listcaseiter.py

class openmdao.lib.caseiterators.listcaseiter.ListCaseIterator(cases)[source]

Bases: object

An iterator that returns Case objects from a passed-in list of cases. This can be useful for runtime-generated cases from an optimizer, etc.

optlh.py

class openmdao.lib.caseiterators.optlh.LatinHypercube(doe, q=2, p=1)[source]

Bases: object

get_shape()[source]
mmphi()[source]

Calculates the Morris-Mitchell sampling criterion for input DOE.

perturb(mutation_count)[source]

Interchanges pairs of randomly chosen elements within randomly chosen columns of a DOE a number of times. The result of this operation will also be a Latin hypercube.

shape

(rowsxcolumns) size of the LatinHypercube DOE.

class openmdao.lib.caseiterators.optlh.OptLatinHypercube[source]

Bases: enthought.traits.has_traits.HasTraits

add_des_var(varname, low=None, high=None)[source]

Adds a design variable to the driver.

varname : string
Name of the public variable the driver should vary during execution.
low : float, optional
Minimum allowed value of the design variable.
high : float, optional
Maximum allowed value of the design variable.

If neither ‘low’ nor ‘high’ is specified, the min and max will default to the values in the metadata of the public variable being referenced. If they are not specified in the metadata and not provided as arguments a ValueError is raised.

add_event_var(varname)[source]

Adds an event variable to the driver, which the driver will the set before each iteration.

varname : string
Name of the public event variable that should be set before execution.
clear_des_vars()[source]
clear_event_vars()[source]
list_des_vars()[source]
list_event_vars()[source]
remove_des_var(varname)[source]
remove_event_var(varname)[source]
openmdao.lib.caseiterators.optlh.print_timing(func)[source]

dbcaserecorder.py

class openmdao.lib.caserecorders.dbcaserecorder.DBCaseRecorder(dbfile=':memory:', model_id='')[source]

Bases: object

Records Cases to a relational DB (sqlite).

dbfile[source]
record(case)[source]

Record the given Case.

dumpcaserecorder.py

class openmdao.lib.caserecorders.dumpcaserecorder.DumpCaseRecorder(out=<open file '<stdout>', mode 'w' at 0x01993070>)[source]

Bases: object

“Dumps Cases to a file-like object called ‘out’ (defaults to sys.stdout).

record(case)[source]

Dump the given Case in a “pretty” form.

external_code.py

class openmdao.lib.components.external_code.ExternalCode(*args, **kwargs)[source]

Bases: openmdao.main.component.Component

Run an external code as a component.

  • command is the command to be executed.
  • env_vars is a dictionary of environment variables for command.
  • resources is a dictionary of resources required to run this component.
  • poll_delay is the delay between polling for command completion (seconds). A value <= zero will use an internally computed default.
  • timeout is the maximum time to wait for command completion (seconds). A value <= zero implies an infinite wait.
  • return_code is the value returned by the command.
  • timed_out is set True if the command timed-out.
Str command

Command to be executed.

  • iotype: ‘in’
Dict env_vars

Environment variables.

  • iotype: ‘in’
Dict resources

Resources required to run this component.

  • iotype: ‘in’
Float timeout

Max time to wait for command completion.

  • iotype: ‘in’
  • units: ‘s’
  • low: 0.0
Int return_code

Return code from command.

  • iotype: ‘out’
Bool timed_out

True if command timed-out.

  • iotype: ‘out’
Float poll_delay

Delay between polling for command completion.

  • units: ‘s’
  • io_type: ‘in’
copy_files(directory, patterns)[source]

Copy files from directory that match patterns to the current directory and ensure they are writable.

copy_inputs(inputs_dir, patterns)[source]

Copy inputs from inputs_dir that match patterns. This can be useful for resetting problem state.

copy_results(results_dir, patterns)[source]

Copy files from results_dir that match patterns. This can be useful for workflow debugging when the external code takes a long time to execute.

execute()[source]

Remove existing output (but not in/out) files. If resources have been specified, then an appropriate server is allocated and the command is run on that server. Otherwise runs the command locally.

stop()[source]

Stop the external code.

mimic.py

class openmdao.lib.components.mimic.Mimic(*args, **kwargs)[source]

Bases: openmdao.main.component.Component

A Component that encapsulates another Component and mimics its input/output interface.

Instance (Component) model

Socket for the Component or Assembly being encapsulated

  • copy: ‘deep’
List mimic_excludes

A list of names of variables to be excluded from the public interface.

  • iotype: ‘in’
  • copy: ‘deep’
List mimic_includes

A list of names of variables to be included in the public interface.

  • iotype: ‘in’
  • copy: ‘deep’
execute()[source]

Default execution behavior is to set all inputs in the model, execute it, and update all outputs with the model’s outputs. Other classes can override this function to introduce other behaviors.

list_inputs_to_model()[source]

Return the list of names of public inputs that correspond to model inputs.

list_outputs_from_model()[source]

Return the list of names of public outputs that correspond to model outputs.

update_model_inputs()[source]

Copy the values of the Mimic’s inputs into the inputs of the model.

update_outputs_from_model()[source]

Copy output values from the model into the Mimic’s outputs.

caseiterdriver.py

class openmdao.lib.drivers.caseiterdriver.CaseIteratorDriver(*args, **kwargs)[source]

Bases: openmdao.main.driver.Driver

Run a set of cases provided by an ICaseIterator in a manner similar to the ROSE framework. Concurrent evaluation is supported, with the various evaluations executed across servers obtained from the ResourceAllocationManager.

  • The iterator socket provides the cases to be evaluated.
  • The model to be executed is found in the workflow.
  • The recorder socket is used to record results.
  • If sequential is True, then the cases are evaluated sequentially.
  • If reload_model is True, the model is reloaded between executions.
  • max_retries sets the number of times to retry a failed case.
Instance (ICaseIterator) iterator

Cases to evaluate.

  • required: True
  • copy: ‘deep’
Instance (object) recorder

Something to append() to.

  • required: True
  • copy: ‘deep’
Int max_retries

Number of times to retry a case.

  • iotype: ‘in’
  • low: 0
Bool reload_model

Reload model between executions.

  • iotype: ‘in’
Bool sequential

Evaluate cases sequentially.

  • iotype: ‘in’
execute()[source]

Run each case in iterator and record results in recorder.

resume(remove_egg=True)[source]

Resume execution. If remove_egg is True, then the egg file created for concurrent evaluation is removed at the end of the run.

setup(replicate=True)[source]

Setup to begin new run. If replicate, then replicate the model and save to an egg file first (for concurent evaluation).

step()[source]

Evaluate the next case.

stop()[source]

Avoid default driver handling of stop signal.

exception openmdao.lib.drivers.caseiterdriver.ServerError[source]

Bases: exceptions.Exception

Raised when a server thread has problems.

conmindriver.py

conmindriver.py - Driver for the CONMIN optimizer.

class openmdao.lib.drivers.conmindriver.CONMINdriver(doc=None)[source]

Bases: openmdao.main.driver.Driver

Driver wrapper of Fortran version of CONMIN.

Todo

Make CONMIN’s handling of user calculated gradients accessible through CONMINdriver

Array cons_is_linear

Array designating whether each constraint is linear.

  • iotype: ‘in’
  • comparison_mode: 1
ExpressionList constraints

A list of expression strings indicating constraints. A value of < 0 for the expression indicates that the constraint is violated.

  • iotype: ‘in’
  • copy: ‘deep’
Float ct

Constraint thickness parameter.

  • iotype: ‘in’
Float ctl

Constraint thickness parameter for linear and side constraints.

  • iotype: ‘in’
Float ctlmin

Minimum absoluate value of ctl used in optimization.

  • iotype: ‘in’
Float ctmin

Minimum absoluate value of ct used in optimization.

  • iotype: ‘in’
Float dabfun

Absolute convergence tolerance.

  • iotype: ‘in’
  • low: 1e-10
Float delfun

Relative convergence tolerance.

  • iotype: ‘in’
  • low: 0.0001
Float fdch

Relative change in design variables when calculating finite difference gradients.

  • iotype: ‘in’
Float fdchm

Minimum absolute step in finite difference gradient calculations.

  • iotype: ‘in’
Float icndir

Conjugate gradient restart parameter.

  • iotype: ‘in’
Int iprint

Print information during CONMIN solution. Higher values are more verbose.

  • iotype: ‘in’
Int itmax

Maximum number of iterations before termination.

  • iotype: ‘in’
Int itrm

Number of consecutive iterations to indicate convergence (relative or absolute).

  • iotype: ‘in’
Int linobj

Linear objective function flag.

  • iotype: ‘in’
Array lower_bounds

Array of constraints on the minimum value of each design variable.

  • iotype: ‘in’
  • comparison_mode: 1
Float nfdg

User-defined gradient flag (not yet supported).

  • iotype: ‘in’
Float nscal

Scaling control parameter – controls scaling of decision variables.

  • iotype: ‘in’
Expression objective

A string containing the objective function expression.

  • iotype: ‘in’
Float phi

Participation coefficient - penalty parameter that pushes designs towards the feasible region.

  • iotype: ‘in’
ExpressionList printvars

List of extra variables tooutput in the recorder.

  • iotype: ‘in’
  • copy: ‘deep’
Array scal

Array of scaling factors for the design variables.

  • iotype: ‘in’
  • comparison_mode: 1
Float theta

Mean value of the push-off factor in the method of feasible directions.

  • iotype: ‘in’
Array upper_bounds

Array of constraints on the maximum value of each design variable.

  • iotype: ‘in’
  • comparison_mode: 1
ExpressionList design_vars

An array of design variable names. These names can include array indexing.

  • iotype: ‘out’
  • copy: ‘deep’
execute()[source]

Perform the optimization.

genetic.py

A simple Pyevolve-based driver for OpenMDAO

class openmdao.lib.drivers.genetic.Genetic(doc=None)[source]

Bases: openmdao.main.driver.Driver

Genetic algorithm for the OpenMDAO framework, based on the Pyevolve Genetic algorithm module.

Float crossover_rate

The crossover rate used when two parent genomes reproduce to form a child genome.

  • iotype: ‘in’
  • low: 0.0
  • high: 1.0
Bool elitism

Controls the use of elitism in the creation of new generations.

  • iotype: ‘in’
Int generations

The maximum number of generations the algorithm will evolve to before stopping.

  • iotype: ‘in’
Float mutation_rate

The mutation rate applied to population members.

  • iotype: ‘in’
  • low: 0.0
  • high: 1.0
Expression objective

A string containing the objective function expression to be optimized.

  • iotype: ‘in’
Enum opt_type

Sets the optimization to either minimize or maximize the objective function.

  • iotype: ‘in’
  • values: [‘minimize’, ‘maximize’]
Int population_size

The size of the population in each generation.

  • iotype: ‘in’
Int seed

Random seed for the optimizer. Set to a specific value for repeatable results; otherwise leave as None for truly random seeding.

  • iotype: ‘in’
Enum selection_method

The selection method used to pick population members who will survive for breeding into the next generation.

  • iotype: ‘in’
  • values: (‘roulette_wheel’, ‘tournament’, ‘rank’, ‘uniform’)
Instance (GenomeBase) best_individual

The genome with the best score from the optimization.

  • iotype: ‘out’
  • copy: ‘deep’
add_parameter(param_name, low=None, high=None)[source]

Adds a parameter to the driver.

param_name : str
Name of the parameter to add to the driver.
low : number, optional
Minimum allowed value the optimizer can use for this parameter. If not specified, then the ‘low’ value from the public variable is used.
high : number, optional
Maximum allowed value the optimizer can use for this parameter. If not specified, then the ‘high’ value from the public variable is used.
clear_parameters()[source]

Removes all parameters from the genetic instance.

execute()[source]

Perform the optimization.

list_parameters()[source]

Returns a list of the names of the parameters currently in the genetic instance.

remove_parameter(param_name)[source]

Removes the specified parameter

param_name : str
Name of the parameter to remove from the driver.

iterate.py

A simple iteration driver. Basically runs a workflow, passing the output to the input for the next iteration. Relative change and number of iterations are used as termination criteria.

class openmdao.lib.drivers.iterate.Iterate(doc=None)[source]

Bases: openmdao.main.driver.Driver

A simple iteration driver. Basically runs a workflow, pasing the output to the input for the next iteration. Relative change and number of iterations are used as termination criterea.

Expression loop_end

loop output to pass to input.

  • iotype: ‘in’
Int max_iteration

Maximum number of iterations before termination.

  • iotype: ‘in’
Float tolerance

Absolute convergence tolerance between iterations.

  • iotype: ‘in’
Expression loop_start

loop input, taken from the input.

  • iotype: ‘out’
execute()[source]

Perform the iteration.

simplecid.py

class openmdao.lib.drivers.simplecid.SimpleCaseIterDriver(*args, **kwargs)[source]

Bases: openmdao.main.driver.Driver

A Driver that sequentially runs a set of cases provided by an ICaseIterator and records the results in a CaseRecorder. This is intended for test cases or very simple models only. For a more full- featured Driver with similar functionality, see CaseIteratorDriver.

  • The iterator socket provides the cases to be evaluated.
  • The recorder socket is used to record results.

For each case coming from the iterator, the workflow will be executed once.

Instance (ICaseIterator) iterator

Source of Cases.

  • required: True
  • copy: ‘deep’
Instance (ICaseRecorder) recorder

Where Case results are recorded.

  • required: True
  • copy: ‘deep’
execute()[source]

Run each case in iterator and record results in recorder.

array.py

Trait for numpy array variables, with optional units.

class openmdao.lib.traits.array.Array(default_value=None, dtype=None, shape=None, iotype=None, desc=None, units=None, **metadata)[source]

Bases: enthought.traits.trait_numeric.Array

A Public Variable wrapper for a numpy array with optional units.

error(object, name, value)[source]

Returns a string describing the type handled by Array.

get_val_meta_wrapper()[source]

Return a TraitValMetaWrapper object. Its value attribute will be filled in by the caller.

validate(object, name, value)[source]

Validates that a specified value is valid for this trait. Units are converted as needed.

domain.py

class openmdao.lib.traits.domain.domain.DomainObj[source]

Bases: object

A DomainObj represents a (possibly multi-zoned) mesh and data related to that mesh.

add_domain(other, prefix='', make_copy=False)[source]

Add zones from other to self, retaining names where possible. Zone names will be prepended with prefix. If make_copy is True, then a deep copy of each zone is made rather than just referring to a shared instance.

add_zone(name, zone, prefix='', make_copy=False)[source]

Add a Zone. If name is None or blank, then a default of the form zone_N is used. The resulting name will be prepended with prefix. If make_copy is True, then a deep copy of each zone is made rather than just referring to a shared instance. Returns the added zone.

copy()[source]

Returns a deep copy of self.

deallocate()[source]

Deallocate resources.

extent[source]

Returns list of coordinate ranges for each zone.

is_equivalent(other, logger=None, tolerance=0.0)[source]

Test if self and other are equivalent. tolerance is the maximum relative difference in array values to be considered equivalent.

make_cartesian(axis='z')[source]

Convert to cartesian coordinate system. axis specifies which is the cylinder axis (‘z’ or ‘x’).

make_cylindrical(axis='z')[source]

Convert to cylindrical coordinate system. axis specifies which is the cylinder axis (‘z’ or ‘x’).

make_left_handed()[source]

Convert to left-handed coordinate system.

make_right_handed()[source]

Convert to right-handed coordinate system.

remove_zone(zone)[source]

Remove zone, specified either by name or object reference. Returns the removed zone.

rename_zone(name, zone)[source]

Rename zone to name.

rotate_about_x(deg)[source]

Rotate about the X axis by deg degrees.

rotate_about_y(deg)[source]

Rotate about the Y axis by deg degrees.

rotate_about_z(deg)[source]

Rotate about the Z axis by deg degrees.

shape[source]

Returns list of coordinate index limits for each zone.

translate(delta_x, delta_y, delta_z)[source]

Translate coordinates.

zone_name(zone)[source]

Return name that zone is bound to.

flow.py

class openmdao.lib.traits.domain.flow.FlowSolution[source]

Bases: object

Contains solution variables for a Zone. All variables have the same shape and grid location.

add_array(name, array)[source]

Add a numpy.ndarray and bind to name. Returns the added array.

add_vector(name, vector)[source]

Add a Vector and bind to name. Returns the added vector.

arrays[source]
flip_z()[source]

Convert to other-handed coordinate system.

ghosts

Number of ghost cells for each index direction.

grid_location

Position at which data is located.

is_equivalent(other, logger, tolerance=0.0)[source]

Test if self and other are equivalent. tolerance is the maximum relative difference in array values to be considered equivalent.

make_cartesian(grid, axis='z')[source]

Convert to cartesian coordinate system. The associated GridCoordinates must be in cylindrical form. axis specifies which is the cylinder axis (‘z’ or ‘x’).

make_cylindrical(grid, axis='z')[source]

Convert to cylindrical coordinate system. The associated GridCoordinates must be in cylindrical form. axis specifies which is the cylinder axis (‘z’ or ‘x’).

name_of_obj(obj)[source]

Return name of object.

rotate_about_x(deg)[source]

Rotate about the X axis by deg degrees.

rotate_about_y(deg)[source]

Rotate about the Y axis by deg degrees.

rotate_about_z(deg)[source]

Rotate about the Z axis by deg degrees.

vectors[source]

grid.py

class openmdao.lib.traits.domain.grid.GridCoordinates[source]

Bases: openmdao.lib.traits.domain.vector.Vector

Coordinate data for a Zone.

ghosts

Number of ghost cells for each index direction.

is_equivalent(other, logger, tolerance=0.0)[source]

Test if self and other are equivalent. tolerance is the maximum relative difference in array values to be considered equivalent.

make_cartesian(axis='z')[source]

Convert to cartesian coordinate system. axis specifies which is the cylinder axis (‘z’ or ‘x’).

make_cylindrical(axis='z')[source]

Convert to cylindrical coordinate system. axis specifies which is the cylinder axis (‘z’ or ‘x’).

translate(delta_x, delta_y, delta_z)[source]

Translate coordinates.

plot3d.py

Functions to read and write a DomainObj in Plot3D format.

  • If multiblock, then the file is assumed to have a multiblock header.
  • dim specifies the expected dimensionality of the blocks.
  • If blanking, then blanking data is expected.
  • If planes, then the data is expected in planar, not whole, format.
  • If binary, the data is in binary, not text, form.
  • If big_endian, the data bytes are in ‘big-endian’ order. Only meaningful if binary.
  • If single_precision, floating-point data is 32 bits, not 64. Only meaningful if binary.
  • If unformatted, the data is surrounded by Fortran record length markers. Only meaningful if binary.

Default argument values are set for a typical 3D multiblock single-precision Fortran unformatted file. When writing, zones are assumed in Cartesian coordinates with data located at the vertices.

openmdao.lib.traits.domain.plot3d.read_plot3d_f(grid_file, f_file, varnames=None, multiblock=True, dim=3, blanking=False, planes=False, binary=True, big_endian=False, single_precision=True, unformatted=True, logger=None)[source]

Returns a DomainObj initialized from Plot3D grid_file and f_file. Variables are assigned to names of the form f_N.

openmdao.lib.traits.domain.plot3d.read_plot3d_grid(grid_file, multiblock=True, dim=3, blanking=False, planes=False, binary=True, big_endian=False, single_precision=True, unformatted=True, logger=None)[source]

Returns a DomainObj initialized from Plot3D grid_file.

openmdao.lib.traits.domain.plot3d.read_plot3d_q(grid_file, q_file, multiblock=True, dim=3, blanking=False, planes=False, binary=True, big_endian=False, single_precision=True, unformatted=True, logger=None)[source]

Returns a DomainObj initialized from Plot3D grid_file and q_file. Q variables are assigned to ‘density’, ‘momentum’, and ‘energy_stagnation_density’. Scalars are assigned to ‘mach’, ‘alpha’, ‘reynolds’, and ‘time’.

openmdao.lib.traits.domain.plot3d.read_plot3d_shape(grid_file, multiblock=True, dim=3, binary=True, big_endian=False, unformatted=True, logger=None)[source]

Returns a list of zone dimensions from Plot3D grid_file.

openmdao.lib.traits.domain.plot3d.write_plot3d_f(domain, grid_file, f_file, varnames=None, planes=False, binary=True, big_endian=False, single_precision=True, unformatted=True, logger=None)[source]

Writes domain to grid_file and f_file in Plot3D format. If varnames is None, then all arrays and then all vectors are written.

openmdao.lib.traits.domain.plot3d.write_plot3d_grid(domain, grid_file, planes=False, binary=True, big_endian=False, single_precision=True, unformatted=True, logger=None)[source]

Writes domain to grid_file in Plot3D format.

openmdao.lib.traits.domain.plot3d.write_plot3d_q(domain, grid_file, q_file, planes=False, binary=True, big_endian=False, single_precision=True, unformatted=True, logger=None)[source]

Writes domain to grid_file and q_file in Plot3D format. Requires ‘density’, ‘momentum’, and ‘energy_stagnation_density’ variables as well as ‘mach’, ‘alpha’, ‘reynolds’, and ‘time’ scalars.

probe.py

openmdao.lib.traits.domain.probe.register_surface_probe(name, function, integrate)[source]

Register a surface probe function.

  • name is the name of the metric calculated.
  • function is the function to call. The passed arguments are (domain, surface, weights, reference_state).
  • If integrate, then function values are integrated, not averaged.
openmdao.lib.traits.domain.probe.surface_probe(domain, surfaces, variables, weighting_scheme='area')[source]

Calculate metrics on mesh surfaces. Currently only supports 3D structured grids with cell-centered data.

  • domain is the Domain to be processed.
  • surfaces is a list of (zone_name,imin,imax,jmin,jmax,kmin,kmax) mesh surface specifications to be used for the calculation. Indices start at 0. Negative indices are relative to the end of the array.
  • variables is a list of (metric_name, units) tuples. Legal metric names are ‘area’, ‘mass_flow’, ‘corrected_mass_flow’, ‘pressure’, ‘pressure_stagnation’, ‘temperature’, and ‘temperature_stagnation’.
  • weighting_scheme specifies how individual values are weighted. Legal values are ‘area’ for area averaging and ‘mass’ for mass averaging.

Returns a list of metric values in the order of the variables list.

vector.py

class openmdao.lib.traits.domain.vector.Vector[source]

Bases: object

Vector data for a FlowSolution. In cartesian coordinates, array indexing order is x,y,z; so an ‘i-face’ is a y,z surface. In cylindrical coordinates, array indexing order is z,r,t; so an ‘i-face’ is a r,t surface.

extent[source]

Returns tuple of component ranges.

flip_z()[source]

Convert to other-handed coordinate system.

is_equivalent(other, name, logger, tolerance=0.0)[source]

Test if self and other are equivalent. tolerance is the maximum relative difference in array values to be considered equivalent.

make_cartesian(grid, axis='z')[source]

Convert to cartesian coordinate system. The associated GridCoordinates must be in cylindrical form. axis specifies which is the cylinder axis (‘z’ or ‘x’).

make_cylindrical(grid, axis='z')[source]

Convert to cylindrical coordinate system. The associated GridCoordinates must be in cylindrical form. axis specifies which is the cylinder axis (‘z’ or ‘x’).

rotate_about_x(deg)[source]

Rotate about the X axis by deg degrees.

rotate_about_y(deg)[source]

Rotate about the Y axis by deg degrees.

rotate_about_z(deg)[source]

Rotate about the Z axis by deg degrees.

shape[source]

Returns tuple of index limits.

zone.py

class openmdao.lib.traits.domain.zone.Zone[source]

Bases: object

One zone in a possibly multi-zone DomainObj.

coordinate_system

Coordinate system in use.

extent[source]

Returns tuple of coordinate ranges.

is_equivalent(other, logger, tolerance=0.0)[source]

Test if self and other are equivalent. tolerance is the maximum relative difference in array values to be considered equivalent.

make_cartesian(axis='z')[source]

Convert to cartesian coordinate system. axis specifies which is the cylinder axis (‘z’ or ‘x’).

make_cylindrical(axis='z')[source]

Convert to cylindrical coordinate system. axis specifies which is the cylinder axis (‘z’ or ‘x’).

make_left_handed()[source]

Convert to left-handed coordinate system.

make_right_handed()[source]

Convert to right-handed coordinate system.

rotate_about_x(deg)[source]

Rotate about the X axis by deg degrees.

rotate_about_y(deg)[source]

Rotate about the Y axis by deg degrees.

rotate_about_z(deg)[source]

Rotate about the Z axis by deg degrees.

shape[source]

Returns tuple of coordinate index limits.

translate(delta_x, delta_y, delta_z)[source]

Translate coordinates.

enum.py

Trait for enumerations, with optional alias list

class openmdao.lib.traits.enum.Enum(default_value=None, values=(), iotype=None, aliases=(), desc=None, **metadata)[source]

Bases: enthought.traits.trait_handlers.TraitType

A Public Variable wrapper for an enumeration, which is a variable that can assume one value from a set of specified values.

error(object, name, value)[source]

Returns a general error string for Enum.

validate(object, name, value)[source]

Validates that a specified value is valid for this trait.

file.py

Support for files, either as File or external files.

class openmdao.lib.traits.file.File(default_value=None, iotype=None, desc=None, **metadata)[source]

Bases: enthought.traits.trait_handlers.TraitType

A trait wrapper for a FileRef object. For input files legal_types may be set to a list of expected ‘content_type’ strings. Then upon assignment the actual ‘content_type’ must match one of the legal_types strings. Also for input files, if local_path is set, then upon assignent the associated file will be copied to that path.

post_setattr(obj, name, value)[source]

If ‘local_path’ is set on an input, then copy the source FileRef’s file to that path.

validate(obj, name, value)[source]

Verify that value is a FileRef of a legal type.

float.py

Trait for floating point variables, with optional min, max, and units

class openmdao.lib.traits.float.Float(default_value=None, iotype=None, desc=None, low=None, high=None, exclude_low=False, exclude_high=False, units=None, **metadata)[source]

Bases: enthought.traits.trait_handlers.TraitType

A Public Variable wrapper for floating point number valid within a specified range of values.

error(object, name, value)[source]

Returns a string describing the type handled by Float.

get_val_meta_wrapper()[source]

Return a TraitValMetaWrapper object. Its value attribute will be filled in by the caller.

validate(object, name, value)[source]

Validates that a specified value is valid for this trait. Units are converted as needed.

int.py

Trait for floating point variables, with optional min and max

class openmdao.lib.traits.int.Int(default_value=None, iotype=None, desc=None, low=None, high=None, exclude_low=False, exclude_high=False, **metadata)[source]

Bases: enthought.traits.trait_handlers.TraitType

A Public Variable wrapper for an integer valid within a specified range of values.

error(object, name, value)[source]

Returns a string describing the type handled by Int.

validate(object, name, value)[source]

Validates that a specified value is valid for this trait.