class AttributeValue
Stores and provides access to attribute data values. The attributes in aRecord are represented in the MI Scripting Toolkit by AttributeDefinition
objects, with an associated AttributeValue object containing the attribute’s data.
AttributeValue is the base class, and each attribute type has a specialised class that inherits from it.
Notes
Do not create instances of this class; it represents an abstract database structure. The ‘Notes’ field, available for all attributes, is a property of the update operation. Use theupdate() notes argument to provide revision notes.
is_empty()
Checks whether the attribute value is populated.- Return type: bool
property definition : AttributeDefinition
The attribute definition associated with this attribute value.- Return type:
AttributeDefinition
property id : int
Attribute identifier.- Return type: int
property is_applicable : bool
Whether the attribute is applicable to the current record. Setting this toFalse will clear any data values on the attribute on import.
property is_meta : bool
Whether the attribute is a meta-attribute.- Return type: bool
property is_meta_for : str | None
Name of the parent attribute.property meta_attributes : dict[str, AttributeValue]
Meta-attributes associated with this attribute. Does not make calls to the Service Layer.- Return type:
dict[str,
AttributeValue]
property name : str
Attribute name.- Return type: str
property record : Record
Record in which the attribute value is defined.- Return type:
Record - Raises: ValueError – If the AttributeValue is not associated with a record.
property type : str
Attribute data type, as a four-character string.- Return type: str
Notes
- Numeric attributes:
POIN(point),RNGE(range),INPT(integer). - Text attributes:
STXT(short text),LTXT(long text),DISC(discrete). - Functional attributes:
FUNC(float functional). - Media attributes:
HLNK(hyperlink),PICT(picture),FILE(file). - Other attributes:
LOGI(logical),DTTM(date time),TABL(tabular).
DSFN and MAFN data values are not supported by the MI Scripting Toolkit, and appear as UNSUPPORTED DATA
TYPE.
abstract property value : Any
Current value of the attribute. Can be modified.- Return type: Any
class AttributeBinary
ExtendedAttributeValue class to handle BinaryType objects as attribute data values.
Base class for AttributePicture and AttributeFile.
Notes
Do not create instances of this class; it represents an abstract database structure.is_empty()
Checks if theBinaryType object is populated by checking if it contains any binary data.
- Return type: bool
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 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.
Setting this attribute value (via either .load(), setting the binary_data property, or
setting the underlying .object.binary_data) will update the mime_file_type property 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. In a future version this property will raise an exception if the attribute is exported withinclude_binary_data = True. See Planned file and picture data changes for more details.
- 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.- Return type:
bytes or
None - Raises:
ValueError – If binary data is available on the server but has not been exported. In the next release, this behavior will
be deprecated. A later release will not raise an exception if the attribute is exported with
include_binary_data = False. Instead, the URL will be returned if the attribute is populated. See Planned file and picture data changes for more details.
class AttributePicture
ExtendedAttributeBinary class for handling Picture objects.
Provides access to Picture save/load methods.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
Pictures of up to 500 MB in size may be stored in Granta MI databases. 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.
is_empty()
Checks if theBinaryType object is populated by checking if it contains any binary data.
- Return type: bool
load(path)
Wraps thePicture.load() method (populates the Picture object with the specified image file).
- Parameters:
path (str or pathlib.Path) – Path to the image file to load.
Takes the form
C:\\Users\\yourname\\Pictures\\image.jpgor/home/username/Pictures/image.jpg.
save(path)
Wraps thePicture.save() method.
- Parameters:
path (str or pathlib.Path) – Path where the image should be saved.
Takes the form
C:\\Users\\yourname\\Pictures\\image.jpgor/home/username/Pictures/image.jpg.
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 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.
Setting this attribute value (via either .load(), setting the binary_data property, or
setting the underlying .object.binary_data) will update the mime_file_type property 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. In a future version this property will raise an exception if the attribute is exported withinclude_binary_data = True. See Planned file and picture data changes for more details.
- 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.- Return type:
bytes or
None - Raises:
ValueError – If binary data is available on the server but has not been exported. In the next release, this behavior will
be deprecated. A later release will not raise an exception if the attribute is exported with
include_binary_data = False. Instead, the URL will be returned if the attribute is populated. See Planned file and picture data changes for more details.
class AttributeFile
ExtendedAttributeBinary class to handle File objects.
Provides access to File object save/load methods, file name, and description.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
Files of up to 500 MB in size may be stored in Granta MI databases. 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.
is_empty()
Checks if theBinaryType object is populated by checking if it contains any binary data.
- Return type: bool
load(path)
Wraps theFile.load() method (populates the File object with the specified file).
- Parameters:
path (str or pathlib.Path) – Path to the file to be imported.
Takes the form
C:\\Users\\yourname\\Documents\\file.pdfor/home/username/Documents/file.pdf.
save(path)
Wraps theFile.save() method.
- Parameters:
path (str or pathlib.Path) – Path where the file should be saved.
Takes the form
C:\\Users\\yourname\\Documents\\file.pdfor/home/username/Documents/file.pdf.
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 description : str | None
Description of the file displayed in MI applications.- Return type: str | None
property file_name : str
Name of the file associated with theFile object.
Displayed in MI applications.
- Return type: str
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.
Setting this attribute value (via either .load(), setting the binary_data property, or
setting the underlying .object.binary_data) will update the mime_file_type property 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. In a future version this property will raise an exception if the attribute is exported withinclude_binary_data = True. See Planned file and picture data changes for more details.
- 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.- Return type:
bytes or
None - Raises:
ValueError – If binary data is available on the server but has not been exported. In the next release, this behavior will
be deprecated. A later release will not raise an exception if the attribute is exported with
include_binary_data = False. Instead, the URL will be returned if the attribute is populated. See Planned file and picture data changes for more details.
class AttributeDate
ExtendedAttributeValue class for date attributes.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
property value : date | None
Return the value of the date attribute as adatetime.date object.
Can be modified. Use datetime.date.fromisoformat() to create a date object from a string before
assigning to this property.
- Return type: datetime.date or None
- Raises: TypeError – If providing a non-date value.
class AttributeDiscrete
ExtendedAttributeValue class for discrete attributes.
Base class for AttributeDiscreteSingle and AttributeDiscreteMulti.
Notes
Do not create instances of this class; it represents an abstract database structure.property is_multivalued : bool
Whether this attribute allows multiple values to be set.- Return type: bool
property possible_discrete_values : list[str]
List of the attribute’s possible discrete data values.class AttributeDiscreteSingle
ExtendedAttributeValue class for discrete attributes.
Provides access to the attribute’s data value as a string, and the order.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
property order : int | None
Position of the current discrete value in the discrete type. Relevant for ordered discrete types. Read-only property. Index starts at 1.- Return type: int or None
property value : str | None
Discrete value associated with this attribute.- Return type: str or None
- Raises:
- TypeError – If providing a non-string value.
- ValueError – If the value is not in the list of possible discrete values.
class AttributeDiscreteMulti
ExtendedAttributeDiscrete class for multivalued discrete attributes.
Provides access to the tuple of strings that store the attribute’s data values, and their order.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
is_empty()
Checks whether the attribute value is populated.AttributeDiscreteMulti objects are empty if AttributeDiscreteMulti.value is None or an
empty tuple.
- Return type: bool
property order : tuple[int] | None
Positions of the current discrete values in the discrete type. Relevant for ordered discrete types. Read-only property. Index starts at 1.property value : tuple[str] | None
Discrete value(s) associated with this attribute. To set to a single value, use a tuple with one item, such as('item',).
- Return type: tuple[str] or None
- Raises:
- TypeError – If providing a string, a non-tuple value, or if any element in the tuple is not a string.
- ValueError – If one or more values are not in the list of possible discrete values.
class AttributeHyperlink
ExtendedAttributeValue class for hyperlink attributes.
Provides access to the hyperlink_description and hyperlink_display text properties.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
property hyperlink_description : str
Text which displays instead of the URL in MI applications.- Return type: str
property hyperlink_display : str
Indicates how the hyperlink should be opened when clicked on in MI applications. Takes one of the following values:-
New: Open in a new window or tab. -
Top: Open in the current window or tab. -
Content: Open within the current MI application (for example, in a frame or dialog). - Return type: str
- Raises: ValueError – If providing an invalid hyperlink display style.
property value : str | None
Returns the URL as a string, or None if unset.- Return type: str or None
class AttributeInteger
ExtendedAttributeValue class for integer attributes.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
property value : int | None
Current value of the attribute. Can be modified.- Return type: int or None
- Raises:
- TypeError – If providing a non-integer value.
- ValueError – If the value is too large (must be between -2,147,483,648 and 2,147,483,647).
class AttributeLogical
ExtendedAttributeValue class for logical attributes.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
property value : bool | None
Current value of the attribute. Can be modified.- Return type: bool or None
class AttributePoint
ExtendedAttributeValue class for point data attributes.
Base class for AttributePointSingle and AttributePointMulti.
Notes
Do not create instances of this class; it represents an abstract database structure.property is_estimated : bool
Whether the value has been estimated. Defaults toFalse for new attribute values.
- Return type: bool
property is_multivalued : bool
Whether this attribute allows multiple values to be set.- Return type: bool
class AttributePointSingle
ExtendedAttributePoint class for single-valued point data attributes.
Provides access to the single scalar value.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
set_value(value)
Sets the attribute value. This method is an alternative to setting thevalue property directly. It accepts any object that
implements the SupportsFloat protocol and sets the attribute value to the result of the
conversion of the input value to a float.
- Parameters:
value (
SupportsFloat) – Value to set.
property default_unit : str | None
Attribute database unit in the active unit system. The unit used by MI Viewer or MI Explore to display this attribute in the active unit system. This property is only affected by the unit system choice, and is not affected byTable.set_display_unit().
property trailing_zero_information : TrailingZeroInformation | None
Trailing zero information associated with the attribute value. This property is only populated for exported attribute values which include trailing zero information. To include trailing zero information in an attribute value during import with the Scripting Toolkit, use aValueWithPrecision to set the value.
- Return type:
TrailingZeroInformationor None
property unit : str | None
Unit symbol of the attribute. Can be modified.None if the attribute is dimensionless.
- Return type: str or None
property value : float | int | ValueWithPrecision | None
Point values associated with this attribute.- Return type:
float or int or
ValueWithPrecisionor None - Raises:
TypeError – If providing a value that is not a float, int, or
ValueWithPrecision.
class AttributePointMulti
ExtendedAttributePoint class for multi-valued point data attributes.
Multi-valued points are represented in the Streamlined API as tuples of ParameterizedPointValue objects.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
is_empty()
Checks whether the attribute value is populated.AttributePointMulti objects are empty if AttributePointMulti.value is None or an empty
tuple.
- Return type: bool
set_value(values, parameters=None)
Sets thevalue to a tuple of ParameterizedPointValue built from values and parameters.
Arguments values and parameters must be Sequences of equal lengths.
- Parameters:
- values (Sequence[SupportsFloat |
ValueWithPrecision]) – Point values. - parameters (Sequence *[*Mapping [str , str | float ] ] or None , optional) – Parameter values for each point in values. If
None, values are set without parameter values.
- values (Sequence[SupportsFloat |
Examples
Attribute value without parameter values:property default_unit : str | None
Attribute database unit in the active unit system. The unit used by MI Viewer or MI Explore to display this attribute in the active unit system. This property is only affected by the unit system choice, and is not affected byTable.set_display_unit().
property parameters : mappingproxy[str, PointValueParameter]
Parameters associated with the point data attribute, indexed by name. Modify thePointValueParameter.unit property on the returned objects to specify a different unit for
.
- Returns: Read-only mapping of parameters
- Return type:
MappingProxyType[str,PointValueParameter]
property points : tuple[float, …]
Read-only view of point values currently set on the attribute value. The returned value does not include parameter values and convertsValueWithPrecision to float.
Examples
For a multi-valued point attribute namedModulus, with parameters Temperature and Statistical basis:
property trailing_zero_information : tuple[TrailingZeroInformation | None, …] | None
Trailing zero information associated with the attribute value. This property is only populated for exported attribute values which include trailing zero information. To include trailing zero information in an attribute value during import with the Scripting Toolkit, useValueWithPrecision in value.
- Return type: tuple[TrailingZeroInformation | None] | None
property unit : str | None
Unit symbol of the attribute. Can be modified.None if the attribute is dimensionless.
- Return type: str or None
property value : tuple[ParameterizedPointValue, …]
Point values associated with this attribute.- Return type: tuple[ParameterizedPointValue, …]
Examples
For a multi-valued point attribute namedModulus, with parameters Temperature and Statistical basis:
class AttributeRange
ExtendedAttributeValue class for range data attributes.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
property default_unit : str | None
Attribute database unit in the active unit system. The unit used by MI Viewer or MI Explore to display this attribute in the active unit system. This property is only affected by the unit system choice, and is not affected byTable.set_display_unit().
property high : float | ValueWithPrecision | None
High value of the range. Read-only property. Proxies toRange.high on the attribute value.
- Return type:
float or
ValueWithPrecisionor None - Raises: ValueError – If the attribute value is empty.
property high_value_is_inclusive : bool
Whether the high value is included in the range. Read-only property. Proxies toRange.high_value_is_inclusive on the attribute value.
- Return type: bool
- Raises: ValueError – If the attribute value is empty.
property high_value_trailing_zero_information : TrailingZeroInformation | None
Trailing zero information associated with the high value. This property is only populated for exported attribute values which include trailing zero information. To include trailing zero information in an attribute value during import with the Scripting Toolkit, use aValueWithPrecision object to set the value.
- Return type:
TrailingZeroInformationor None
property is_estimated : bool
Whether the value has been estimated. Defaults toFalse for new attribute values.
- Return type: bool
property low : float | ValueWithPrecision | None
Low value of the range. Read-only property. Proxies toRange.low on the attribute value.
- Return type:
float or
ValueWithPrecisionor None - Raises: ValueError – If the attribute value is empty.
property low_value_is_inclusive : bool
Whether the low value is included in the range. Read-only property. Proxies toRange.low_value_is_inclusive on the attribute value.
- Return type: bool
- Raises: ValueError – If the attribute value is empty.
property low_value_trailing_zero_information : TrailingZeroInformation | None
Trailing zero information associated with the low value. This property is only populated for exported attribute values which include trailing zero information. To include trailing zero information in an attribute value during import with the Scripting Toolkit, use aValueWithPrecision object to set the value.
- Return type:
TrailingZeroInformationor None
property unit : str | None
Unit symbol of the attribute. Can be modified.None if the attribute is dimensionless.
- Return type: str or None
property value : Range | None
Current value of the attribute. Can be modified.class AttributeTabular
ExtendedAttributeValue class for tabular data attributes.
Provides access to tabular data and its properties, such as linking attribute and table, and methods for
adding, deleting or swapping rows.
WARNING
Linked functional columns are not supported in tabular attributes. Exported cells are represented asUnsupportedType
Importing an empty tabular attribute is deprecated. Instead:
- To delete all rows in an existing tabular attribute, use the
Record.clear_attributesmethod to delete the attribute value. - To mark the attribute as Not Applicable, set the
AttributeValue.is_applicableproperty toFalse.
AttributeTabular.shape property to determine the current number of rows in the tabular
attribute.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
append_row(linking_value=None)
Appends a new unpopulated row, and sets the linking value for that row if one is provided.- Parameters: linking_value (str , optional) – Linking value for the new row.
delete_row(index)
Removes the row at the specified index.- Parameters: index (int) – Index of the row to delete.
Examples
delete_row(0) deletes the first row.
enable_destructive_editing()
Enable destructive editing of the tabular data.- Warns: UserWarning – If unexported binary data is present in any of the tabular cells.
WARNING
Destructive editing removes existing rows and creates new ones. Destructive editing should be avoided because:- This can be slow for attributes with File or Picture attributes, especially if many rows are present.
- Users of Data Updater will face conflicts when applying subsequent updates.
UnexportedBinaryDataError is raised on import. See Table.bulk_fetch() for more information.
SEE ALSO
is_destructive_editing_allowed
: Whether destructive editing of the tabular attribute value is allowed.
destructively_edited
: Whether destructive editing has been performed.
Notes
The following actions are considered destructive:AttributeTabular.swap_rows()TabularRow.set_linking_value()for an exported row
force_destructive_editing() before
importing the data.
force_destructive_editing()
Force destructive editing of the tabular data. Seeenable_destructive_editing() for warnings associated with destructive editing. This method should
only be used for cases where destructive editing is absolutely necessary and is not triggered automatically.
- Warns: UserWarning – If unexported binary data is present in any of the tabular cells.
Notes
If destructive editing is performed while unexported binary data is present, aUnexportedBinaryDataError is raised on import. See Table.bulk_fetch() for more information.
is_empty()
Checks whether the attribute value is populated.- Return type: bool
load()
Loads exported tabular data. Exported data is generally lazily loaded by any property of the tabular that requires it. This method can be used to explicitly load the exported data or to discard staged user modifications and reset the attribute value to the exported data.show()
Displays the data as an ascii-art style table.swap_rows(row1, row2)
Change the positions of two rows with indicesrow1 and row2.
- Parameters:
- Raises: ValueError – If destructive editing is not enabled.
WARNING
The swap_rows operation is considered destructive and will trigger a complete re-import of the tabular data which may be slow, and will prevent Data Updater from tracking row-level updates to the tabular data. It is disabled by default. To enable this action, call the methodenable_destructive_editing() before calling
this method.
SEE ALSO
is_destructive_editing_allowed
: Whether destructive editing of the tabular attribute value is allowed.
Examples
Swap the first and fifth rows in the Tabular data structuremy_data:
property column_types : list[str]
Data type in each column.- Returns: Only populated for local, linked attribute, or linked column tabular columns. The element will be an empty string otherwise.
- Return type: list[str]
Examples
['STXT', 'POIN', 'DISC', '', '']
property columns : list[str]
List of columns in the tabular data.property definition : AttributeDefinitionTabular
The attribute definition associated with this attribute value.- Return type:
AttributeDefinition
property destructively_edited : bool
Whether the tabular data has been destructively edited. If the value of this property isFalse then imports will be safe to use with Data Updater.
SEE ALSO
enable_destructive_editing()
: Enable destructive editing of the tabular data.
- Returns:
Trueif destructive editing is enabled and any actions have been taken that require destructive editing.Falseif no destructive actions have been taken or if destructive editing is not enabled. - Return type: bool
property is_destructive_editing_allowed : bool
Whether destructive editing of the tabular data is allowed. By default, destructive editing is not allowed.- Return type: bool
SEE ALSO
enable_destructive_editing()
: Enable destructive editing of the tabular data.
property linked_columns : list[bool]
Whether each column is linked or not.property linked_records : dict[str, list[Record]]
The records linked to each row, indexed by the linking value of each row at loading. These links are calculated in Granta MI, and therefore cannot be edited by the user. The dictionary is unaffected by local changes to the tabular data, and the data must be re-imported to reflect local changes. This property will be empty if the user cannot access the linked table, or ifAttributeDefinitionTabular.ignore_linked_records was set to True before data export.
- Return type:
dict[str, list[
Record]]
property linking_attribute : AttributeDefinition | None
Short text-type attribute used to link rows in the tabular data attribute to records.- Returns:
AttributeDefinitionobject.Nonefor purely local tabular data. - Return type: AttributeDefinition or None
property linking_table : Table | None
Table object which the linking attribute belongs to.
property rows : tuple[TabularRow, …]
Returns a tuple ofTabularRow objects representing each row in the tabular data.
- Return type:
tuple[
TabularRow, …]
property shape : tuple[int, int]
Number of rows by number of columns.property value : tuple[tuple[str | int | bool | date | MappingProxyType | HyperlinkValue | PictureValue | FileValue | tuple[float] | tuple[str] | None | tuple[str | int | bool | date | MappingProxyType | HyperlinkValue | PictureValue | FileValue | tuple[float] | tuple[str] | None]]]
Raw data for the attribute. Data is organized as a tuple of tuples:- The items in the outer tuple represent a row, and so the length of the outer tuple corresponds to the number of rows in the tabular attribute.
- The items in each inner tuple represent a cell, and so the lengths of the inner tuples correspond to the number of columns in the tabular attribute.
-
Return type:
tuple[tuple[str | int | bool | datetime.date | MappingProxyType |
HyperlinkValue|PictureValue|FileValue| tuple | None]]
Notes
When exporting data as a read user, this property may omit rows for the following reasons:- If a row is completely empty.
- If a row contains no local data and has a linking value which does not exist in the target table.
- If a row contains no local data and has a linking value which exists in the target table, but all linked records are inaccessible to the user because of version control or access control.
class AttributeShortText
ExtendedAttributeValue class for short text attributes.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
property value : str | None
Current value of the attribute. Can be modified. Short text values can be at most 255 characters long.- Return type: str or None
- Raises: ValueError – If the value is too long.
class AttributeLongText
ExtendedAttributeValue class for long text attributes.
Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
property value : str | None
Current value of the attribute. Can be modified.- Return type: str or None
class AttributeFunctionalSeriesPoint
Attribute value class for point series functional data.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
generate_grid_version(create_empty=False)
Convert this object to the equivalent grid functional attribute value object and return the result.- Parameters:
create_empty (bool , optional) – Whether to create an empty object. Default is
False. - Returns: New instance of a grid functional attribute value.
- Return type:
AttributeFunctionalGridPoint - Raises: ValueError – If data cannot be represented as grid functional data.
Notes
Ifcreate_empty is True, an empty functional attribute value is returned.
If create_empty is False, the following information is copied to the new functional attribute value:
value(converted toGridPoint)unitparametersis_applicable
ValueError.
Series functional data can be defined with multiple points sharing the same set of parameter values. These may
occur with hysteresis curves or multiple series without distinguishing parameters. Such data cannot be
represented as grid data.
Series with identical parameter values, or with no parameter values, can be converted to grid functional data as
long as all points have unique x-axis values. However, information about which series the points used to belong
to will be lost.
is_empty()
Checks whether the attribute value is populated.- Return type: bool
set_value(value)
Set the current value of the attribute. This method is an alternative to setting thevalue property directly, and accepts any sequence type.
- Parameters:
value (Sequence[
SeriesPoint]) – New value for the attribute.
with_new_x_axis(parameter_name, create_empty=False)
Generate an empty attribute value of the same type with another parameter as X-axis.- Parameters:
- Returns: New instance of functional attribute of identical type.
- Return type:
AttributeFunctionalSeriesPoint - Raises: ValueError – If the name is not a valid parameter.
Notes
Ifcreate_empty is True, an empty functional attribute value is returned.
If create_empty is False, the following information is copied to the new functional attribute value:
property log_yaxis : bool
Whether the Y axis is using a logarithmic scale.- Return type: bool
property parameters : mappingproxy[str, FunctionalValueParameter]
Parameters associated with the functional data attribute, indexed by name. Modify theFunctionalValueParameter.unit property on the returned objects to specify a different unit
for import.
- Returns: Read-only mapping of parameters associated with this functional value.
- Return type:
MappingProxyType[str,FunctionalValueParameter]
property show_as_table : bool
Whether the attribute should be displayed as a table.- Return type: bool
property table_view : FunctionalSeriesPointTableView
Supports additional read-only views of the attribute value.- Return type:
FunctionalSeriesPointTableView
property unit : str
Unit symbol for the y-axis. For the x-axis parameter or constraint parameters, useunit on
FunctionalValueParameter objects provided by the parameters property.
- Return type: str or None
property value : tuple[SeriesPoint, …]
Current value of the attribute. Can be modified.Versionchanged
Changed in version 5.0: This property now accepts as input and returns a structured representation of a functional attribute value.table_view provides properties to obtain the value in the format
previously returned by this property.
- Return type:
tuple[
SeriesPoint, …] - Raises:
- TypeError – If providing a value that is not a tuple of SeriesPoint objects.
- ValueError – If the value defines series with incompatible parameters or invalid parameter names.
property x_axis : str
Name of the parameter used as the x-axis for the attribute value. Data exported from Granta MI may define a different x-axis parameter than the default x-axis parameter set in the attribute definition. To import data with a different x-axis parameter, usewith_new_x_axis().
- Return type: str
class AttributeFunctionalSeriesRange
Attribute value class for series range functional data.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
generate_grid_version(create_empty=False)
Convert this object to the equivalent grid functional attribute value object and return the result.- Parameters:
create_empty (bool , optional) – Whether to create an empty object. Default is
False. - Returns: New instance of a grid functional attribute value.
- Return type:
AttributeFunctionalGridRange - Raises: ValueError – If data cannot be represented as grid functional data.
Notes
Ifcreate_empty is True, an empty functional attribute value is returned.
If create_empty is False, the following information is copied to the new functional attribute value:
value(converted toGridRange)unitparametersis_applicable
ValueError.
Series with identical parameter values, or with no parameter values can be converted to grid functional as long
as all points have unique x-axis values.
is_empty()
Checks whether the attribute value is populated.- Return type: bool
set_value(value)
Set the current value of the attribute. This method is an alternative to setting thevalue property directly, and accepts any Sequence type.
- Parameters:
value (Sequence[
SeriesRange]) – New value for the attribute.
with_new_x_axis(parameter_name, create_empty=False)
Generate an empty attribute value of the same type with another parameter as X-axis.- Parameters:
- Returns: New instance of functional attribute of identical type.
- Return type:
AttributeFunctionalSeriesRange - Raises: ValueError – If the name is not a valid parameter.
Notes
Ifcreate_empty is True, an empty functional attribute value is returned.
If create_empty is False, the following information is copied to the new functional attribute value:
property log_yaxis : bool
Whether the Y axis is using a logarithmic scale.- Return type: bool
property parameters : mappingproxy[str, FunctionalValueParameter]
Parameters associated with the functional data attribute, indexed by name. Modify theFunctionalValueParameter.unit property on the returned objects to specify a different unit
for import.
- Returns: Read-only mapping of parameters associated with this functional value.
- Return type:
MappingProxyType[str,FunctionalValueParameter]
property show_as_table : bool
Whether the attribute should be displayed as a table.- Return type: bool
property table_view : FunctionalSeriesRangeTableView
Supports additional read-only views of the attribute value.- Return type:
FunctionalSeriesRangeTableView
property unit : str
Unit symbol for the y-axis. For the x-axis parameter or constraint parameters, useunit on
FunctionalValueParameter objects provided by the parameters property.
- Return type: str or None
property value : tuple[SeriesRange, …]
Current value of the attribute. Can be modified.Versionchanged
Changed in version 5.0: This property now accepts as input and returns a structured representation of a functional attribute value.table_view provides properties to obtain the value in the format
previously returned by this property.
- Return type:
tuple[
SeriesRange, …] - Raises:
- TypeError – If providing a value that is not a tuple of SeriesRange objects.
- ValueError – If the value defines series with incompatible parameters or invalid parameter names.
property x_axis : str
Name of the parameter used as the x-axis for the attribute value. Data exported from Granta MI may define a different x-axis parameter than the default x-axis parameter set in the attribute definition. To import data with a different x-axis parameter, usewith_new_x_axis().
- Return type: str
class AttributeFunctionalGridPoint
Attribute value class for point grid functional data.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
generate_series_version(create_empty=False)
Convert this object to the equivalent series functional attribute value object and return the result.- Parameters:
create_empty (bool , optional) – Whether to create an empty object. Default is
False. - Returns: New instance of a series functional attribute value.
- Return type:
AttributeFunctionalSeriesPoint
Notes
Ifcreate_empty is True, an empty functional attribute value is returned.
If create_empty is False, the following information is copied to the new functional attribute value:
value(converted toSeriesPoint)unitparametersis_applicable
with_new_x_axis(parameter_name, create_empty=False)
Generate an empty attribute value of the same type with another parameter as X-axis.- Parameters:
- Returns: New instance of functional attribute of identical type.
- Return type:
AttributeFunctionalGridPoint - Raises: ValueError – If the name is not a valid parameter.
Notes
Ifcreate_empty is True, an empty functional attribute value is returned.
If create_empty is False, the following information is copied to the new functional attribute value:
property parameters : mappingproxy[str, FunctionalValueParameter]
Parameters associated with the functional data attribute, indexed by name. Modify theFunctionalValueParameter.unit property on the returned objects to specify a different unit
for import.
- Returns: Read-only mapping of parameters associated with this functional value.
- Return type:
MappingProxyType[str,FunctionalValueParameter]
property table_view : FunctionalGridPointTableView
Supports additional read-only views of the attribute value.- Return type:
FunctionalGridPointTableView
property unit : str
Unit symbol for the y-axis. For the x-axis parameter or constraint parameters, useunit on
FunctionalValueParameter objects provided by the parameters property.
- Return type: str or None
property value : GridPoint
Current value of the attribute. Can be modified.Versionchanged
Changed in version 5.0: This property now accepts as input and returns a structured representation of a functional attribute value.table_view provides properties to obtain the value in the format
previously returned by this property.
- Return type:
GridPoint - Raises:
- TypeError – If providing a value that is not a GridPoint object.
- ValueError – If the value defines invalid parameter names.
property x_axis : str
Name of the parameter used as the x-axis for the attribute value. Data exported from Granta MI may define a different x-axis parameter than the default x-axis parameter set in the attribute definition. To import data with a different x-axis parameter, usewith_new_x_axis().
- Return type: str
class AttributeFunctionalGridRange
Attribute value class for range grid functional data.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
generate_series_version(create_empty=False)
Convert this object to the equivalent series functional attribute value object and return the result.- Parameters:
create_empty (bool , optional) – Whether to create an empty object. Default is
False. - Returns: New instance of a series functional attribute value.
- Return type:
AttributeFunctionalSeriesRange
Notes
Ifcreate_empty is True, an empty functional attribute value is returned.
If create_empty is False, the following information is copied to the new functional attribute value:
value(converted toSeriesRange)unitparametersis_applicable
with_new_x_axis(parameter_name, create_empty=False)
Generate an empty attribute value of the same type with another parameter as X-axis.- Parameters:
- Returns: New instance of functional attribute of identical type.
- Return type:
AttributeFunctionalGridRange - Raises: ValueError – If the name is not a valid parameter.
Notes
Ifcreate_empty is True, an empty functional attribute value is returned.
If create_empty is False, the following information is copied to the new functional attribute value:
property parameters : mappingproxy[str, FunctionalValueParameter]
Parameters associated with the functional data attribute, indexed by name. Modify theFunctionalValueParameter.unit property on the returned objects to specify a different unit
for import.
- Returns: Read-only mapping of parameters associated with this functional value.
- Return type:
MappingProxyType[str,FunctionalValueParameter]
property table_view : FunctionalGridRangeTableView
Supports additional read-only views of the attribute value.- Return type:
FunctionalGridRangeTableView
property unit : str
Unit symbol for the y-axis. For the x-axis parameter or constraint parameters, useunit on
FunctionalValueParameter objects provided by the parameters property.
- Return type: str or None
property value : GridRange
Current value of the attribute. Can be modified.Versionchanged
Changed in version 5.0: This property now accepts as input and returns a structured representation of a functional attribute value.table_view provides properties to obtain the value in the format
previously returned by this property.
- Return type:
GridRange - Raises:
- TypeError – If providing a value that is not a GridRange object.
- ValueError – If the value defines invalid parameter names.
property x_axis : str
Name of the parameter used as the x-axis for the attribute value. Data exported from Granta MI may define a different x-axis parameter than the default x-axis parameter set in the attribute definition. To import data with a different x-axis parameter, usewith_new_x_axis().
- Return type: str
class AttributeUnsupported
ExtendedAttributeValue class for attributes with unsupported data types.
Notes
Unsupported attribute data will not yield any information regarding its value in that record. However, some meta-data is still available through this class (such as the attribute’s name and data type). An unsupported attribute value remains unpopulated, and these objects cannot be edited. Do not create instances of this class; it represents a pre-existing database structure. UseRecord.attributes to access instances of this class.
is_empty()
Checks whether the attribute value is populated.- Return type: bool
property is_applicable : bool
Whether the attribute is applicable to the current record. Setting this toFalse will clear any data values on the attribute on import.
property object : UnsupportedType
Gets the underlyingUnsupportedType object representing the attribute value or the tabular cell.
Does not allow access to the data.
- Return type:
UnsupportedType
property value : None
This property always returns None for unsupported attribute values.class PseudoAttributeValue
Stores and provides access to pseudo-attribute data values.Notes
Do not create instances of this class; it represents a pre-existing database structure. UseRecord.get_attributes() to generate instances of this class.
is_empty()
Checks whether the pseudo-attribute value is populated or not.- Return type: bool
property id : int
Attribute identifier (this is always 0 for pseudo-attributes).- Return type: int
property name : str
Name of the pseudo-attribute.- Return type: str
property record : Record
ParentRecord described by the PseudoAttributeValue.
- Return type:
Record
property type : str
Data type of the pseudo-attribute value (four-character string).- Return type: str
property value : list[str] | str | int | bool | set[str] | datetime | RecordColor
Current value of the pseudo-attribute. Cannot be modified. Modification of editable pseudo-attributes must be done through theRecord.color,
Record.short_name and Record.name properties.
- Return type:
list[str] or str or int or bool or set[str] or datetime.datetime or
RecordColor