Schema
class LinkGroupDetails
Provides access to the properties of a record link group.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseDatabase.record_link_groups to access instances of this class.
property database_from : str
Database key of the database the link group originates from.- Return type: str
property database_to : str
Database key of the database target by the link group.- Return type: str
property name : str
Name of the record link group.- Return type: str
property reverse_name : str
Name of the record link group in the return direction.- Return type: str
property table_from : str
Name of the table the link group comes from.- Return type: str
property table_to : str
Name of the table targeted by the link group.- Return type: str
property type : str
Whether the record link group is ‘static’, ‘crossDatabase’ or ‘dynamic’.- Return type: str
class TableLayout
Represents a layout for a table in the database. Provides individually accessible categories, or a full representation of the layout as a JSON-style object.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseTable.layouts
to access instances of this class.
meta_attributes_on(attribute_name)
Returns the list of meta-attributes corresponding to a given attribute in this layout.property attributes_by_category : Dict[str, List[str]]
Dictionary of attribute lists, indexed by the layout category they are in.property categories : List[str]
List of all the categories (headings) in the layout.property layout : List[Dict[str, str | List[str] | Dict[str, str | List[str]]]]
JSON-style representation of the layout.property link_groups_by_category : Dict[str, List[str]]
Dictionary of link group lists, indexed by the layout category they are in.property meta_attributes_by_attribute : Dict[str, List[str]]
Dictionary of meta-attribute lists, indexed by parent attributes.property name : str
Layout name.- Return type: str
class Exporter
Represents a Granta MI FEA exporter. FEA exporters are used to export record data from Granta MI into formats supported by CAD and CAE packages. This operation performs no subset filtering, so all tabular rows will be included in the Initial XML regardless of the subset membership of the linked records.Notes
Do not create instances of this class; it represents a pre-existing database structure. Useget_available_exporters() to retrieve exporters for a given table.
export_list_is_valid(records)
Verifies that a list of records is valid for export.- Parameters:
records (list[
Record]) – List of records to validate. - Returns: Whether the specified list of records can be exported with this exporter.
- Return type: bool
get_parameters_required_for_export(records)
Returns a dictionary of all the parameter definitions the Exporter requires to export the data. Returns parameters required from the specified list of records, indexed by parameter name.- Parameters:
records (list[
Record]) – List of records to export. - Return type:
dict[str,
ExporterParameter] - Raises: InvalidRecordStateError – If one or more records have not been pushed to the server.
run_exporter(records, stop_before=None, parameter_defs=None, sig_figs=None)
Performs an FEA export on the specified list of records, returning the data representing the records as a string.- Parameters:
- records (list[
Record]) – List of records to export. - stop_before (int or str , optional) – Either refers to the index of the transform step (int) or its name (str).
- parameter_defs (dict[str,
ExporterParameter], optional) – Dictionary of exporter parameters. - sig_figs (int , optional) – Number of significant figures for numerical data.
- records (list[
- Returns: Contains data output by the exporter.
- Return type: str
- Raises: InvalidRecordStateError – If one or more records have not been pushed to the server.
save(file_path, file_name=None, file_extension=None)
Saves the output of the last FEA export to the path provided. Uses the default naming convention and file extension for the exporter; specify afile_name or
file_extension to override the defaults.
- Parameters:
- file_path (str or pathlib.Path) – File path of the form C:\Users\Username\.
- file_name (str , optional) – Output file name. Does not require a file extension.
- file_extension (str , optional) – Output file extension.
property absolute_temperatures_optional : bool
Whether this exporter allows the user to specify absolute or relative temperatures. IfTrue the user can choose to use the absolute or relative form of the temperature
unit defined in the unit system. Otherwise, the exporter will use the form defined in the
.exp file.
- Return type: bool
property default_bom : bytes | None
Returns the default byte-order mark as defined by the exporter configuration file. If no BOM is required by default, this property isNone.
- Return type:
bytes or
None
property default_encoding : str
Returns the default file encoding scheme as defined by the exporter configuration file.- Return type: str
Notes
This is returned as a Python-compatible string (e.g. “cp1252”) rather than the .NET codepage “1252”.property default_file_extension : str
Returns the default file extension as defined by the exporter configuration file.- Return type: str
property default_file_name : str
Returns the default file name for the last performed export. As defined by the exporter configuration file.- Return type: str
property description : str
The Exporter description.- Return type: str
property exporter_key : str
The unique key that is used to identify the exporter.- Return type: str
property model : str
The Finite-Element Material Model name.- Return type: str
Notes
This name is exported to the initial XML file, and appears in the MI Viewer and MI Explore export interfaces.property name : str
The name of the exporter, as defined in the.exp file.
- Return type: str
property package : str
The Package defines the name of the target CAE analysis package.- Return type: str
Notes
This name is exported to the initial XML file, and appears in the MI Viewer and MI Explore export interfaces.property transforms : list[ExporterTransform]
Iterable containing the transform steps defined for this exporter. Each entry in the iterable contains the index of the transform stage, and the ID. Either can be provided to theExporter.run_exporter() stop_before argument to selectively run
transformation steps.
- Return type: list[ExporterTransform]
property unit_system : str | None
The currently selected unit-system. If None then the default unit system for the exporter will be used, otherwise the provided unit-system will be used when running the exporter.- Return type:
str or
None
property unit_systems : List[str]
All the unit-systems this exporter supports.property use_absolute_temperatures : bool
Whether this exporter should use absolute temperatures. IfTrue the exporter will use the absolute form of the temperature unit defined in the
selected unit-system. Otherwise, it will use the relative form.
- Return type: bool
class ExporterTransform
Dictionary representing a transformation step defined for anExporter.
Provide the id or index to the Exporter.run_exporter() stop_before argument to selectively run
transformation steps.
id : str
ID of the transform step.index : int
Index of the transform step.Parameters
class ParameterDefinition
Base class for parameters. Provides access to parameter properties such as revision history, default and possible values, and units.Notes
Do not create instances of this class; it represents an abstract database structure.reset_unit()
Resets the unit back to its original value when the parameter was initially exported.property axis_scale_type : Literal[‘Linear’, ‘Log’] | None
Axis scale type for the parameter.property data_type : Literal[‘Numeric’, ‘Discrete’]
Parameter data type.- Returns: One of ‘Numeric’ or ‘Discrete’.
- Return type: str
- Raises: NotImplementedError – If the parameter type is not supported.
property database_unit : str | None
Database unit symbol for the parameter.- Return type:
str or
None
property default_value : str | float
Default value of the parameter.property history : ObjectHistory
Revision history of the parameter.- Return type:
ObjectHistory
property history_of_default : ObjectHistory
Revision history of the parameter’s default value.- Return type:
ObjectHistory
property id : int
Parameter identifier.- Return type: int
property interpolation_type : Literal[‘None’, ‘Linear’, ‘Cubic Spline’]
The interpolation type for the parameter.- Return type:
InterpolationType
property name : str
Parameter name.- Return type: str
property restricted : bool
Whether the parameter is restricted to specific values.- Return type: bool
property unit : str | None
Unit symbol for the parameter.- Return type:
str or
None
Notes
This property is used to specify a unit in the following situations:- Specify a unit on an object of any
ParameterDefinitionsubclass to control the unit of the values returned by thedefault_valueandvaluesproperties on that object. - Specify a unit on an
ExporterParameterobject to provide a value with a different unit to theExporterParameter.value_for_exportersproperty.
Database.unit_system and Database.absolute_temperatures settings.
property values : List[str | float]
List of all possible values the parameter can take.property values_histories : List[ObjectHistory]
Revision histories of each possible value of a parameter.- Return type:
list[
ObjectHistory]
class DatabaseParameter
Bases:ParameterDefinition
Definition of a parameter at the database level.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseDatabase.parameters to access instances of this class.
class AttributeParameter
Bases:DatabaseParameter
Definition of a parameter as configured for an attribute.
Inherited properties ParameterDefinition.default_value, ParameterDefinition.axis_scale_type, and
ParameterDefinition.interpolation_type can differ from the database parameter definition.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseAttributeDefinitionMultiValue.parameters to access instances of this class.
property order : int
Order in which the parameter is stored in the attribute. This is relevant for some interpolation methods, and determines the display order in MI Viewer.- Return type: int
property parent_attribute : AttributeDefinitionMultiValue
Attribute to which this parameter applies.- Return type:
AttributeDefinitionMultiValue
class PointValueParameter
Parameter information that is associated with a point attribute value.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseAttributePointMulti.parameters to access instances of this class.
property name : str
Parameter name.- Return type: str
property unit : str | None
Unit symbol for the parameter. Defines the unit of the values for this parameter when importing into a point attribute.class ExporterParameter
Bases:DatabaseParameter
Definition of a parameter that is used by an exporter.
The value and unit can be set to control the exporter output. If the value is not set then the database parameter
default value will be used.
Notes
Do not create instances of this class manually. UseExporter.get_parameters_required_for_export() to
generate instances of this class.
clear_value_for_exporters()
Clear the value on theExporterParameter instance and return it to the default value.
property value_for_exporters : str | float
Value on theExporterParameter instance for use in any exporters the parameter is passed to.
Can be set by the user. If this value is unset, the exporter will use the default value defined in the database
schema.
class FunctionalValueParameter
Parameter that is associated with a functional attribute value. Used to override parameter settings for an individual attribute value.WARNING
When importing data, ifFunctionalValueParameter object attributes are modified and the parameter is not
populated in the parent attribute value, the modification will be ignored during import. A UserWarning will be
emitted.
When exporting data, parameter settings may exist even if the parameter has no value on the parent attribute. These
parameter settings will be exported correctly.
Notes
Do not create instances of this class; it represents a pre-existing database structure. Use theparameters
property of a functional attribute value, for example AttributeFunctionalSeriesPoint.parameters, to access
instances of this class.
property axis_scale_type : Literal[‘Linear’, ‘Log’] | None
The scale type for the parameter.- Returns:
If set to
None, the value is inherited from the parameter definition associated with the parent attribute definition. - Return type:
ScaleTypeor None - Raises:
- TypeError – If providing a non-string value.
- ValueError – If providing an invalid scale type.
SEE ALSO
effective_axis_scale_type
: The effective value of this property, taking inheritance into account if the property is set to None.
property default_value : str | float | None
Default value for the parameter.- Returns:
Parameter default value. If set to
None, the value is inherited from the parameter definition associated with the parent attribute definition. - Return type: str or float or None
- Raises:
- TypeError – If providing a non-float value for a numeric parameter or a non-str value for a discrete parameter.
- ValueError – If the string value is not in the allowed values list.
SEE ALSO
effective_default_value
: The effective value of this property, taking inheritance into account if the property is set to None.
property effective_axis_scale_type : Literal[‘Linear’, ‘Log’] | None
Effective scale type, inherited from the attribute parameter if not defined on the datum. None for all discrete parameters.- Return type:
ScaleTypeor None
property effective_default_value : str | float
Effective default value, inherited from the attribute parameter if not defined on the datum.property effective_interpolation_type : Literal[‘None’, ‘Linear’, ‘Cubic Spline’]
Effective interpolation type, inherited from the attribute parameter if not defined on the datum.- Return type:
InterpolationType
property interpolation_type : Literal[‘None’, ‘Linear’, ‘Cubic Spline’] | None
The interpolation type for the parameter.- Returns:
If set to
None, the value is inherited from the parameter definition associated with the parent attribute definition. - Return type:
InterpolationTypeor None - Raises:
- TypeError – If providing a non-string value.
- ValueError – If providing an invalid interpolation type.
SEE ALSO
effective_interpolation_type
: The effective value of this property, taking inheritance into account if the property is set to None.
property name : str
Parameter name.- Return type: str
property unit : str | None
Unit symbol for the parameter. Defines the unit of the values for this parameter when importing into a functional attribute.WARNING
Theunit property affects both the default_value and the functional attribute parameter
value for import. If the unit is modified, you must make sure that both the default_value and the
corresponding functional attribute data contain values consistent with the new unit.
Item history
class ObjectHistory
Provides access to the revision history of an MI database element. Object histories are currently supported via the following properties:AttributeDefinition.historyAttributeDefinitionTabular.column_historiesParameterDefinition.historyParameterDefinition.history_of_defaultParameterDefinition.values_historiesDataRevisionHistory.history
Notes
Do not create instances of this class; it represents a pre-existing database structure. Use the properties listed above to access instances of this class.property created_at : datetime
Date and time the database element was created.- Return type: datetime.datetime
property created_by : str
The username of the user who created the database element.- Return type: str
property date_created : str
Date the database element was created.- Return type: str
property last_modified_at : datetime
Date and time the database element was last modified.- Return type: datetime.datetime
property last_modified_by : str
The username of the last user to modify the database element.- Return type: str
property last_modified_date : str
Date the database element was last modified.- Return type: str
property update_count : int
The number of times the object has been updated.- Return type: int
class RecordVersionHistory
Provides access to the revision history of an MI Record.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.record_history to access an instance of this class.
property created_at : datetime
Date and time the record version was created.- Return type: datetime.datetime
property created_by : str
The username of the user who created the record version.- Return type: str
property creation_notes : str
Notes associated with the creation of the record version.- Return type: str
property last_modification_notes : str
Notes associated with the last modification made to record version.- Return type: str
property last_modified_at : datetime
Date and time the record version was last modified.- Return type: datetime.datetime
property last_modified_by : str
The username of the user who last modified the record version.- Return type: str
property release_notes : str | None
Notes associated with the release of the record version.- Return type: str or None
property released_at : datetime | None
Date and time the record version was released.- Return type: datetime.datetime or None
property released_by : str | None
The username of the user who released the record version.- Return type: str or None
property superseded_at : datetime | None
Date and time the record version was superseded.- Return type: datetime.datetime or None
property superseded_by : str | None
The username of the user who superseded the record version.- Return type: str or None
property supersession_notes : str | None
Notes associated with the last operation that superseded the record version.- Return type: str or None
property withdrawal_notes : str | None
Notes associated with the withdrawal of the record version.- Return type: str or None
property withdrawn_at : datetime | None
Date and time the record version was withdrawn.- Return type: datetime.datetime or None
property withdrawn_by : str | None
The username of the user who withdrew the record version.- Return type: str or None
class DataRevisionHistory
Provides revision history information about the data in an attribute of a record.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.data_revision_history to access an instance of this class.
property created_in_record_version : int
Version of the record when this datum was created.- Return type: int
property data_version_number : int
Data version number.- Return type: int
property history : ObjectHistory | None
Revision history of the attribute data, as anObjectHistory object.
Is None for empty attributes.
- Return type:
ObjectHistoryor None
property is_meta : bool
Whether the attribute is a meta-attribute or not.- Return type: bool
property is_meta_for : str | None
Name of the parent attribute, if a meta-attribute. ReturnsNone otherwise.
- Return type: str or None
property is_populated : bool
Whether the attribute is populated.- Return type: bool
property meta_attributes : Dict[str, DataRevisionHistory]
Data revision history of meta-attributes associated with this attribute, indexed by meta-attribute name.- Return type:
dict[str,
DataRevisionHistory]
property name : str
Name of the attribute.- Return type: str
property retired_in_record_version : int
Version of the record when this datum was retired.- Return type: int
Search criterion
class SearchCriterion(attribute, operator, value=None, column_name=None)
Defines a single criterion for use in a search. The criterion can be as simple as the presence of the specified attribute, or as complex as the data in a specified column of the tabular attribute being greater than a specified value. The search will use the same units as theAttributeDefinition.
- Parameters:
- attribute (AttributeDefinition | PseudoAttributeDefinition) – The subject of the search criterion.
- operator (Literal [ “LESS_THAN” , “GREATER_THAN” , “BETWEEN” , “CONTAINS_ANY” , “CONTAINS_ALL” , “CONTAINS” , “NOT_CONTAINS” , “EXISTS” , “NOT_EXISTS” , “EQUAL” ]) – The search mode for this criterion. The operator value must be compatible with the type of attribute or pseudo-
attribute specified in the
attributeparameter. - value (float | bool | int | str | List [str ] | tuple [datetime.datetime , datetime.datetime ] | tuple [datetime.date , datetime.date ] | list [float ] | RecordColor | RecordType | None) – The value used in this criterion. The value type must correspond to the type of attribute or pseudo-attribute
specified in the
attributeparameter. - column_name (str | None) – For tabular attributes, the name of the column to which this search criterion applies. Required when the
operator is
EQUAL.
Notes
To perform an exact search on a discrete attribute, the operator argument should be eitherCONTAINS_ANY or
CONTAINS_ALL. In the case of searching for a single discrete value, the value argument should be a list
containing the search term.
datetime values default to UTC if no timezone information is provided.
property attribute : AttributeDefinition | PseudoAttributeDefinition
AttributeDefinition or PseudoAttributeDefinition for the attribute used in this search criterion.
- Return type: AttributeDefinition | PseudoAttributeDefinition
property operation : str
Operator used in this criterion, if provided.- Example: ‘EXISTS’ or ‘CONTAINS’
- Return type: str
Media attribute values
class BinaryType
Stores and provides access to Pictures and Files and associated metadata. Pictures and files can appear in Granta MI as data (for example, in a tabular data column), or as an attribute value. This class wraps files and images for inclusion in the corresponding MI Scripting Toolkit class.load(path)
Populates the object with the data located onpath.
Relative paths are permitted.
- Parameters: path (str or pathlib.Path) – Path to the object to load.
save(path)
Saves an object to file locationpath.
Relative paths are permitted.
- Parameters: path (str or pathlib.Path) – Path where the object should be saved.
property binary_data : bytes | None
The binary data for the file. Binary data can be set with a bytes object or file buffer.- Return type: bytes or None
- Raises: ValueError – If binary data is available on the server but has not been exported.
property is_empty : bool
Checks whether theBinaryType object is populated by checking whether there is binary data in the
object.
- Return type: bool
property mime_file_type : str | None
MIME (Multipurpose Internet Mail Extensions) file type. If this object is populated via export, themime_file_type property returns the MIME file type stored in
Granta MI.
If this object is populated via load() or setting the binary_data property, the
mime_file_type property is populated using the filetype library. If filetype cannot determine the
MIME file type, the mime_file_type property is set to None and Granta MI determines the MIME file
type during import.
- Return type: str or None
Notes
The filetype PyPI page lists supported MIME types.property url : str | None
URL of the hosted file.- Returns:
URL to the file stored in the parent Granta MI attribute, or
Noneif the URL was not populated. - Return type: str or None
Notes
The data can be retrieved by using a Python HTTP library (e.g. Requests, HTTPX) and by supplying the appropriate authentication for your Granta MI server. To populate this property, theTable.bulk_fetch() method must be used with
include_binary_data = False (default). If include_binary_data = True is specified, or if the attribute
is fetched on-demand by accessing the attributes dictionary without performing a bulk fetch, this property
will always return None.
property value : bytes | None
The binary data of the hosted file, if exported.None if the attribute was exported with include_binary_data = False.
- Return type:
bytes or
None
class Picture(*, path=None)
ExtendedBinaryType class for Pictures in MI.
- Parameters:
path (str or pathlib.Path , optional) – Path to the image file to load. Takes the form
C:\\Users\\username\\Pictures\\image.jpgor/home/username/Pictures/image.jpg.
Notes
Pictures of up to 500 MB in size may be stored in Granta MI. To upload pictures larger than 20 Mb using Scripting Toolkit:- Granta MI Service Layer must be configured to allow large requests. If this is not configured,
Session.update()will raise aGRANTA_ServiceLayerErrorfor a “413 Request Entity Too Large” HTTP response. For more information, contact your Ansys Technical Representative. - The Python client environment must have sufficient system resources to load and Base64-encode the binary data. If there are insufficient system resources, unhandled Python exceptions may be raised.
load(path)
Populates the Picture object with the image located onpath.
Relative paths are permitted.
- Parameters:
path (str or pathlib.Path) – Path to the image file to load. Takes the form
C:\\Users\\username\\Pictures\\image.jpgor/home/username/Pictures/image.jpg.
save(path)
Saves a Picture object to file locationpath.
Relative paths are permitted.
- Parameters:
path (str or pathlib.Path) – Path where the image should be saved. Takes the form
C:\\Users\\username\\Pictures\\image.jpgor/home/username/Pictures/image.jpg.
class File(*, path=None)
ExtendedBinaryType class for Files in MI.
- Parameters:
path (Union [str , pathlib.Path ] , optional) – Path to the file to load. Takes the form
C:\\Users\\username\\Documents\\file.pdfor/home/username/Documents/file.pdf.
Notes
Files of up to 500 MB in size may be stored in Granta MI. To upload files larger than 20 Mb using Scripting Toolkit:- Granta MI Service Layer must be configured to allow large requests. If this is not configured,
Session.update()will raise aGRANTA_ServiceLayerErrorfor a “413 Request Entity Too Large” HTTP response. For more information, contact your Ansys Technical Representative. - The Python client environment must have sufficient system resources to load and Base64-encode the binary data. If there are insufficient system resources, unhandled Python exceptions may be raised.
load(path)
Populates the File object with the file located bypath.
Relative paths are permitted.
- Parameters:
path (str or pathlib.Path) – Path to the file to load. Takes the form
C:\\Users\\username\\Documents\\file.pdfor/home/username/Documents/file.pdf.
save(path)
Saves a File object to file locationpath.
Relative paths are permitted.
- Parameters:
path (str or pathlib.Path) – Path where the file should be saved. Takes the form
C:\\Users\\username\\Documents\\file.pdfor/home/username/Documents/file.pdf.
property description : str | None
File description. Stored with the data value. If provided, the description replaces the file name for the attribute when displayed on a datasheet in MI Viewer.property file_name : str
Name of the file.- Return type: str
Numeric attribute values
class ParameterizedPointValue(value, parameters=<factory>)
Represents a point value with parameters in a multi-valued point attribute value.- Parameters:
- value (float | ValueWithPrecision) – The point float value.
- parameters (tuple [PointParameterValue , … ] , optional) – Tuple of
PointParameterValueobjects.
Examples
Point with no parameters:classmethod from_data(value, parameters=None)
Alternative constructor to createParameterizedPointValue from more general data types.
- Parameters:
- value (SupportsFloat) – The point float value.
- parameters (Sequence [PointParameterValue ] , optional) – Sequence of
PointParameterValueobjects.
- Return type: ParameterizedPointValue
parameters : tuple[PointParameterValue, …]
Tuple ofPointParameterValue objects.
property parameters_by_name : mappingproxy[str, str | float]
Returns a read-only mapping of parameter values by name.- Return type:
MappingProxyType[str, str | float]
value : float | ValueWithPrecision
The point float value.class PointParameterValue(name, value)
Parameter value for a point in a multi-valued point value.- Parameters:
Examples
Numeric parameter:classmethod from_data(name, value)
Alternative constructor to createPointParameterValue from more general data types.
- Parameters:
- Return type: PointParameterValue
name : str
The name of the parameter.value : float | str
The value of the parameter.class Range(low, high, low_value_is_inclusive=True, high_value_is_inclusive=True)
Range value representation.- Parameters:
- low (float | ValueWithPrecision | None) – The lower bound value. Use
Nonefor an open-ended range. - high (float | ValueWithPrecision | None) – The upper bound value. Use
Nonefor an open-ended range. - low_value_is_inclusive (bool , optional) – Whether the low value is included in the range. Defaults to
True. This property should only be set if thelowproperty has a value. IflowisNone, this property has no effect on imported data. - high_value_is_inclusive (bool , optional) – Whether the high value is included in the range. Defaults to
True. This property should only be set if thehighproperty has a value. IfhighisNone, this property has no effect on imported data.
- low (float | ValueWithPrecision | None) – The lower bound value. Use
Examples
Range with default inclusiveness and values for the lower and upper bounds:classmethod from_data(value, low_value_is_inclusive=True, high_value_is_inclusive=True)
Create aRange from data in various formats.
- Parameters:
- value (
Range_Value_Type) – Low and high values. - low_value_is_inclusive (bool , optional) – Whether the low value is included in the range. Defaults to
True. - high_value_is_inclusive (bool , optional) – Whether the high value is included in the range. Defaults to
True.
- value (
- Returns:
The created
Rangeobject. - Return type: Range
Examples
From a dictionary with keyslow and high:
property as_dict : dict[str, float | ValueWithPrecision | None]
Returns a dictionary representation of the range value withlow and high keys.
- Return type: dict[str, float | ValueWithPrecision | None]
high : float | ValueWithPrecision | None
The upper bound value.high_value_is_inclusive : bool = True
Whether the high value is included in the range. This property should only be set if thehigh property has a value. If high is None, this
property has no effect on imported data.
low : float | ValueWithPrecision | None
The lower bound value.low_value_is_inclusive : bool = True
Whether the low value is included in the range. This property should only be set if thelow property has a value. If low is None, this
property has no effect on imported data.
Range_Value_Type
Valid values for use withRange.from_data().
Alias of:
tuple[Range_Extrema_Value_Type,Range_Extrema_Value_Type]list[Range_Extrema_Value_Type]dict[Literal["high","low"],Range_Extrema_Value_Type]- Single
Range_Extrema_Value_Typefor ranges with identical low and high values.
Range_Extrema_Value_Type
alias ofSupportsFloat | ValueWithPrecision | None
class ValueWithPrecision(value, number_of_digits)
Represents a float value with a specific precision defined as a number of decimal digits. Upon import the value is rounded at the specified number of digits. This class helps compute the number of significant figures in a value.- Parameters:
- Raises: ValueError – If the value and precision would result in more than 15 significant figures or fewer than 1 significant figure.
Notes
Up to 15 significant figures are supported.property as_decimal : Decimal
Return aDecimal representation of the floating point value with the configured precision.
- Return type: decimal.Decimal
Examples
property number_of_digits : int
Number of significant decimal places.- Return type: int
property significant_figures : int
Number of significant figures, computed from the floating point value and number of digits. Significant figures as defined in an MI system include the number of digits in the integral and decimal parts of the value.- Return type: int
Examples
property value : float
Floating point value.- Return type: float
class TrailingZeroInformation
Trailing zero information for an exported attribute value.- Parameters:
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseValueWithPrecision to create values with precision information.
property as_decimal : Decimal
Return aDecimal representation of the value.
- Return type: decimal.Decimal
Examples
2 m, measured to a precision of 1 mm:property entered_unit : str
Unit symbol in which the value with trailing zero information was imported.- Return type: str
property entered_value : str
String representation of the floating point value.- Return type: str
property number_of_digits : int
Number of digits, computed from the entered value and significant figures.- Return type: int
property significant_figures : int
Number of significant digits in the value, including trailing zeros.- Return type: int
Functional attribute values
class SeriesPoint(*, x, is_estimated=None, decoration=GraphDecoration.LINES, y, parameters=<factory>)
Data that represents the value of a point series functional attribute. This class is a frozendataclass.
- Parameters:
- x (tuple [float , … ] | tuple [str , … ]) – Tuple of x-axis parameter values.
- y (tuple [float , … ]) – Tuple of y-axis values. Must be the same length as the
xparameter. - is_estimated (tuple [bool , … ] , optional) – Whether points are estimated. Defaults to a tuple of
Falsevalues. If provided, must be a tuple ofboolvalues and must be the same length as thexandyparameters. - parameters (tuple [SeriesParameterValue , … ] , optional) – Tuple of
SeriesParameterValueobjects. - decoration (GraphDecoration , optional) –
GraphDecorationstyle. Defaults toGraphDecoration.LINES.
Examples
Series with no extra parameters:classmethod from_data(x, y, is_estimated=None, parameters=None, decoration=None)
Alternative constructor to createSeriesPoint from more general data types.
- Parameters:
- x (Sequence *[*SupportsFloat ] | Sequence [str ]) – Sequence of x-axis parameter values.
- y (Sequence *[*SupportsFloat ]) – Sequence of values for the y-axis.
- is_estimated (Sequence [bool ] , optional) – Whether values are estimated. Defaults to
None, which results in all points being marked as not estimated. - parameters (Sequence [SeriesParameterValue ] , optional) – Sequence of
SeriesParameterValueobjects. - decoration (GraphDecoration , optional) – Graph decoration style.
- Return type: SeriesPoint
decoration : GraphDecoration = ‘Lines’
GraphDecoration style.
is_estimated : tuple[bool, …] = None
Whether points are estimated. Defaults to a tuple ofFalse values.
parameters : tuple[SeriesParameterValue, …]
Tuple ofSeriesParameterValue objects.
property parameters_by_name : mappingproxy[str, str | float]
Returns a read-only mapping of parameter values by name.- Return type:
MappingProxyType[str, str | float]
x : tuple[float, …] | tuple[str, …]
Tuple of x-axis parameter values.y : tuple[float, …]
Tuple of y-axis values.class SeriesRange(*, x, is_estimated=None, decoration=GraphDecoration.LINES, y_low, y_high, parameters=<factory>)
Data that represents the value of a range series functional attribute. This class is a frozendataclass.
- Parameters:
- x (tuple [float , … ] | tuple [str , … ]) – Tuple of x-axis parameter values.
- y_low (tuple [float , … ]) – Tuple of values for the y-axis lower bound. Must be the same length as the
xparameter. - y_high (tuple [float , … ]) – Tuple of values for the y-axis upper bound. Must be the same length as the
xparameter. - is_estimated (tuple [bool , … ] , optional) – Whether points are estimated. Defaults to a tuple of
Falsevalues. If provided, must be a tuple ofboolvalues and must be the same length as thex,y_low, andy_highparameters. - parameters (tuple [SeriesParameterValue , … ] , optional) – Tuple of
SeriesParameterValueobjects. - decoration (GraphDecoration , optional) –
GraphDecorationstyle. Defaults toGraphDecoration.LINES.
Examples
Series with no extra parameters:classmethod from_data(x, y_low, y_high, is_estimated=None, parameters=None, decoration=None)
Alternative constructor to createSeriesRange from more general data types.
- Parameters:
- x (Sequence *[*SupportsFloat ] | Sequence [str ]) – Sequence of x-axis parameter values.
- y_low (Sequence *[*SupportsFloat ]) – Sequence of values for the y-axis lower bound.
- y_high (Sequence *[*SupportsFloat ]) – Sequence of values for the y-axis upper bound.
- is_estimated (Sequence [bool ] , optional) – Whether values are estimated. Defaults to
None, which results in all points being marked as not estimated. - parameters (Sequence [SeriesParameterValue ] , optional) – Sequence of
SeriesParameterValueobjects. - decoration (GraphDecoration , optional) – Graph decoration style.
- Return type: SeriesRange
decoration : GraphDecoration = ‘Lines’
GraphDecoration style.
is_estimated : tuple[bool, …] = None
Whether points are estimated. Defaults to a tuple ofFalse values.
parameters : tuple[SeriesParameterValue, …]
Tuple ofSeriesParameterValue objects.
property parameters_by_name : mappingproxy[str, str | float]
Returns a read-only mapping of parameter values by name.- Return type:
MappingProxyType[str, str | float]
x : tuple[float, …] | tuple[str, …]
Tuple of x-axis parameter values.y_high : tuple[float, …]
Tuple of values for the y-axis upper bound.y_low : tuple[float, …]
Tuple of values for the y-axis lower bound.class SeriesParameterValue(name, value)
Parameter value for a functional series. The parameter value applies to the entireSeriesPoint or SeriesRange it is assigned to.
This class is a frozen dataclass.
- Parameters:
Examples
classmethod from_data(name, value)
Alternative constructor to createSeriesParameterValue from more general data types.
- Parameters:
- Return type: SeriesParameterValue
name : str
The name of the parameter.value : float | str
The value of the parameter. This must be a ‘float’ for numeric parameters, or a ‘str’ for discrete parameters.class GridPoint(*, x, is_estimated=None, decoration=GraphDecoration.LINES, y, parameters=<factory>)
Multi-dimensional data that represents the value of a point grid functional attribute. This class is a frozendataclass.
- Parameters:
- x (tuple [float , … ] | tuple [str , … ]) – Tuple of x-axis parameter values.
- y (tuple [float , … ]) – Tuple of y-axis values. Must be the same length as the
xparameter. - is_estimated (tuple [bool , … ] , optional) – Whether points are estimated. Defaults to a tuple of
Falsevalues. If provided, must be a tuple ofboolvalues and must be the same length as thexandyparameters. - parameters (tuple [GridParameterValues , … ] , optional) – Tuple of
GridParameterValuesobjects. - decoration (GraphDecoration , optional) –
GraphDecorationstyle. Defaults toGraphDecoration.LINES.
Examples
Grid with no parameters:__add__(other)
Returns a new grid object that concatenates both grids. Only grids that define values for the same parameters and use the same decoration style can be concatenated.- Parameters: other (GridPoint) – The other grid to concatenate with this grid.
- Returns: New instance with merged data from both input grids.
- Return type: GridPoint
Examples
classmethod from_data(x, y, is_estimated=None, parameters=None, decoration=None)
Alternative constructor to createGridPoint from more general data types.
- Parameters:
- x (Sequence *[*SupportsFloat ] | Sequence [str ]) – Sequence of x-axis parameter values.
- y (Sequence *[*SupportsFloat ]) – Sequence of values for the y-axis.
- is_estimated (Sequence [bool ] , optional) – Whether values are estimated. Defaults to
None, which results in all points being marked as not estimated. - parameters (Sequence [GridParameterValues ] , optional) – Sequence of
GridParameterValuesobjects. - decoration (GraphDecoration , optional) – Graph decoration style.
decoration : GraphDecoration = ‘Lines’
GraphDecoration style.
is_estimated : tuple[bool, …] = None
Whether points are estimated. Defaults to a tuple ofFalse values.
parameters : tuple[GridParameterValues, …]
Tuple ofGridParameterValues objects.
property parameters_by_name : mappingproxy[str, tuple[str, …] | tuple[float, …]]
Returns a read-only mapping of parameter values by name.- Return type:
MappingProxyType[str, tuple[str, …] | tuple[float, …]]
x : tuple[float, …] | tuple[str, …]
Tuple of x-axis parameter values.y : tuple[float, …]
Tuple of y-axis values.class GridRange(*, x, is_estimated=None, decoration=GraphDecoration.LINES, y_low, y_high, parameters=<factory>)
Multi-dimensional data that represents the value of a range grid functional attribute. This class is a frozendataclass.
- Parameters:
- x (tuple [float , … ] | tuple [str , … ]) – Tuple of x-axis parameter values.
- y_low (tuple [float , … ]) – Tuple of values for the y-axis lower bound. Must be the same length as the
xparameter. - y_high (tuple [float , … ]) – Tuple of values for the y-axis upper bound. Must be the same length as the
xparameter. - is_estimated (tuple [bool , … ] , optional) – Whether points are estimated. Defaults to a tuple of
Falsevalues. If provided, must be a tuple ofboolvalues and must be the same length as thex,y_low, and “y_high` parameters. - parameters (tuple [GridParameterValues , … ] , optional) – Tuple of
GridParameterValuesobjects. - decoration (GraphDecoration , optional) –
GraphDecorationstyle. Defaults toGraphDecoration.LINES.
Examples
Grid with no parameters:__add__(other)
Returns a new grid object that concatenates both grids. Only grids that define values for the same parameters and use the same decoration style can be concatenated.- Parameters: other (GridRange) – The other grid to concatenate with this grid.
- Returns: New instance with merged data from both input grids.
- Return type: GridRange
Examples
classmethod from_data(x, y_low, y_high, is_estimated=None, parameters=None, decoration=None)
Alternative constructor to createGridRange from more general data types.
- Parameters:
- x (Sequence *[*SupportsFloat ] | Sequence [str ]) – Sequence of x-axis parameter values.
- y_low (Sequence *[*SupportsFloat ]) – Sequence of values for the y-axis lower bound.
- y_high (Sequence *[*SupportsFloat ]) – Sequence of values for the y-axis upper bound.
- is_estimated (Sequence [bool ] , optional) – Whether values are estimated. Defaults to
None, which results in all points being marked as not estimated. - parameters (Sequence [GridParameterValues ] , optional) – Sequence of
GridParameterValuesobjects. - decoration (GraphDecoration , optional) – Graph decoration style.
decoration : GraphDecoration = ‘Lines’
GraphDecoration style.
is_estimated : tuple[bool, …] = None
Whether points are estimated. Defaults to a tuple ofFalse values.
parameters : tuple[GridParameterValues, …]
Tuple ofGridParameterValues objects.
property parameters_by_name : mappingproxy[str, tuple[str, …] | tuple[float, …]]
Returns a read-only mapping of parameter values by name.- Return type:
MappingProxyType[str, tuple[str, …] | tuple[float, …]]
x : tuple[float, …] | tuple[str, …]
Tuple of x-axis parameter values.y_high : tuple[float, …]
Tuple of values for the y-axis upper bound.y_low : tuple[float, …]
Tuple of values for the y-axis lower bound.class GridParameterValues(name, values)
Parameter values for a functional grid. When assigned toGridPoint or GridRange, there must be as many parameter values as xy value
pairs in the grid.
This class is a frozen dataclass.
- Parameters:
Examples
classmethod from_data(name, values)
Alternative constructor to createGridParameterValues from more general data types.
- Parameters:
- Return type: GridParameterValues
name : str
Name of the parameter.values : tuple[float, …] | tuple[str, …]
Tuple of values for the parameter.class GraphDecoration
LINES = ‘Lines’
LINES_AND_MARKERS = ‘LinesAndMarkers’
MARKERS = ‘Markers’
class FunctionalSeriesPointTableView
property column_headers
Column headers including units.property data_by_column : dict[str, list[float] | list[str], list[bool], list[None]]
View of the attribute value in a dictionary format. This is a view of the attribute value data. Modifying the view has no effect on the underlying attribute value.Examples
For a functional attribute namedStress-Strain (Ranged), with an X-axis of Strain and an additional
parameter Temperature:
property parameter_column_index : dict[str, int]
Mapping of parameter names to index in thecolumn_headers.
property table_view : list[list[str | float | bool | None]]
Value returned byAttributeFunctionalSeriesPoint.value in Scripting Toolkit versions earlier than 5.0.
Modifying the view has no effect on the underlying attribute value.
Examples
For a functional attribute namedStress-Strain, with an X-axis of Strain and an additional parameter
Temperature:
property table_view_with_series_number : list[list[str | float | bool | None | int]]
Table view of the attribute value as a list of points, including the series number. Modifying the view has no effect on the underlying attribute value.Examples
For a functional attribute namedStress-Strain, with an X-axis of Strain and an additional parameter
Temperature:
class FunctionalSeriesRangeTableView
property column_headers
Column headers including units.property data_by_column : dict[str, list[float] | list[str], list[bool], list[None]]
View of the attribute value in a dictionary format. This is a view of the attribute value data. Modifying the view has no effect on the underlying attribute value.Examples
For a functional attribute namedStress-Strain (Ranged), with an X-axis of Strain and an additional
parameter Temperature:
property parameter_column_index : dict[str, int]
Mapping of parameter names to index in thecolumn_headers.
property table_view : list[list[str | float | bool | None]]
Value returned byAttributeFunctionalSeriesRange.value in Scripting Toolkit versions earlier than 5.0.
Modifying the returned value has no effect on the attribute value.
Examples
For a functional attribute namedStress-Strain (Ranged), with an X-axis of Strain and an additional parameter
Temperature:
property table_view_with_series_number : list[list[str | float | bool | None | int]]
Table view of the attribute value as a list of points, including the series number. Modifying the view has no effect on the underlying attribute value.Examples
For a functional attribute namedStress-Strain (Ranged), with an X-axis of Strain and an additional
parameter Temperature:
class FunctionalGridPointTableView
property column_headers
Column headers including units.property data_by_column : dict[str, list[float] | list[str], list[bool], list[None]]
View of the attribute value in a dictionary format. This is a view of the attribute value data. Modifying the view has no effect on the underlying attribute value.Examples
For a functional attribute namedStress-Strain (Ranged), with an X-axis of Strain and an additional
parameter Temperature:
property parameter_column_index : dict[str, int]
Mapping of parameter names to index in thecolumn_headers.
property table_view : list[list[str | float | bool | None]]
Value returned byAttributeFunctionalGridPoint.value in Scripting Toolkit versions earlier than 5.0.
Modifying the view has no effect on the underlying attribute value.
Examples
For a functional attribute namedStress-Strain, with an X-axis of Strain and an additional parameter
Temperature:
class FunctionalGridRangeTableView
property column_headers
Column headers including units.property data_by_column : dict[str, list[float] | list[str], list[bool], list[None]]
View of the attribute value in a dictionary format. This is a view of the attribute value data. Modifying the view has no effect on the underlying attribute value.Examples
For a functional attribute namedStress-Strain (Ranged), with an X-axis of Strain and an additional
parameter Temperature:
property parameter_column_index : dict[str, int]
Mapping of parameter names to index in thecolumn_headers.
property table_view : list[list[str | float | bool | None]]
Value returned byAttributeFunctionalGridRange.value by pre-v5.0 Scripting Toolkit versions.
Modifying the view has no effect on the underlying attribute value.
Examples
For a functional attribute namedStress-Strain (Ranged), with an X-axis of Strain and an additional parameter
Temperature: