Skip to main content

class AttributeValue

Stores and provides access to attribute data values. The attributes in a Record 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 the update() notes argument to provide revision notes.

is_empty()

Checks whether the attribute value is populated.

property definition : AttributeDefinition

The attribute definition associated with this attribute value.

property id : int

Attribute identifier.
  • Return type: int

property is_applicable : bool

Whether the attribute is applicable to the current record. Setting this to False will clear any data values on the attribute on import.
  • Return type: bool
  • Raises: TypeError – If attempting to set a non-boolean value.

property is_meta : bool

Whether the attribute is a meta-attribute.

property is_meta_for : str | None

Name of the parent attribute.
  • Returns: Name of the parent attribute, or None if not a meta-attribute.
  • Return type: str or None

property meta_attributes : dict[str, AttributeValue]

Meta-attributes associated with this attribute. Does not make calls to the Service Layer.

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

Extended AttributeValue 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 the BinaryType object is populated by checking if it contains any binary data.

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, the mime_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 with include_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 None if 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, the Table.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

Extended AttributeBinary 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. Use Record.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 a GRANTA_ServiceLayerError for 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 the BinaryType object is populated by checking if it contains any binary data.

load(path)

Wraps the Picture.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.jpg or /home/username/Pictures/image.jpg.

save(path)

Wraps the Picture.save() method.
  • Parameters: path (str or pathlib.Path) – Path where the image should be saved. Takes the form C:\\Users\\yourname\\Pictures\\image.jpg or /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, the mime_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 with include_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 None if 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, the Table.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

Extended AttributeBinary 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. Use Record.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 a GRANTA_ServiceLayerError for 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 the BinaryType object is populated by checking if it contains any binary data.

load(path)

Wraps the File.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.pdf or /home/username/Documents/file.pdf.

save(path)

Wraps the File.save() method.
  • Parameters: path (str or pathlib.Path) – Path where the file should be saved. Takes the form C:\\Users\\yourname\\Documents\\file.pdf or /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 the File 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, the mime_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 with include_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 None if 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, the Table.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

Extended AttributeValue class for date attributes.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use Record.attributes to access instances of this class.

property value : date | None

Return the value of the date attribute as a datetime.date object. Can be modified. Use datetime.date.fromisoformat() to create a date object from a string before assigning to this property.

class AttributeDiscrete

Extended AttributeValue 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.

property possible_discrete_values : list[str]

List of the attribute’s possible discrete data values.

class AttributeDiscreteSingle

Extended AttributeValue 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. Use Record.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

Extended AttributeDiscrete 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. Use Record.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.

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.
Extended AttributeValue 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. Use Record.attributes to access instances of this class. Text which displays instead of the URL in MI applications.
  • Return type: 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

Extended AttributeValue class for integer attributes.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use Record.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

Extended AttributeValue class for logical attributes.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use Record.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

Extended AttributeValue 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 to False for new attribute values.

property is_multivalued : bool

Whether this attribute allows multiple values to be set.

class AttributePointSingle

Extended AttributePoint 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. Use Record.attributes to access instances of this class.

set_value(value)

Sets the attribute value. This method is an alternative to setting the value 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.

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 by Table.set_display_unit().
  • Returns: None if the attribute is dimensionless.
  • Return type: str or None

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 a ValueWithPrecision to set the value.

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.

class AttributePointMulti

Extended AttributePoint 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. Use Record.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.

set_value(values, parameters=None)

Sets the value 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.

Examples

Attribute value without parameter values:
Attribute value with parameter values for the first value only:

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 by Table.set_display_unit().
  • Returns: None if the attribute is dimensionless.
  • Return type: str or None

property parameters : mappingproxy[str, PointValueParameter]

Parameters associated with the point data attribute, indexed by name. Modify the PointValueParameter.unit property on the returned objects to specify a different unit for .

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 converts ValueWithPrecision to float.

Examples

For a multi-valued point attribute named Modulus, 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, use ValueWithPrecision in value.

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.

Examples

For a multi-valued point attribute named Modulus, with parameters Temperature and Statistical basis:

class AttributeRange

Extended AttributeValue class for range data attributes.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use Record.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 by Table.set_display_unit().
  • Returns: None if the attribute is dimensionless.
  • Return type: str or None

property high : float | ValueWithPrecision | None

High value of the range. Read-only property. Proxies to Range.high on the attribute value.

property high_value_is_inclusive : bool

Whether the high value is included in the range. Read-only property. Proxies to Range.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 a ValueWithPrecision object to set the value.

property is_estimated : bool

Whether the value has been estimated. Defaults to False for new attribute values.

property low : float | ValueWithPrecision | None

Low value of the range. Read-only property. Proxies to Range.low on the attribute value.

property low_value_is_inclusive : bool

Whether the low value is included in the range. Read-only property. Proxies to Range.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 a ValueWithPrecision object to set the value.

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.
  • Return type: Range or None
  • Raises: TypeError – If providing a value that is not a Range instance.

class AttributeTabular

Extended AttributeValue 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 as UnsupportedType Importing an empty tabular attribute is deprecated. Instead: Use the 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. Use Record.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.
If destructive editing is performed while unexported binary data is present, a 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: Destructive editing may be forced for a tabular attribute by calling force_destructive_editing() before importing the data.

force_destructive_editing()

Force destructive editing of the tabular data. See enable_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, a UnexportedBinaryDataError is raised on import. See Table.bulk_fetch() for more information.

is_empty()

Checks whether the attribute value is populated.

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 indices row1 and row2.
  • Parameters:
    • row1 (int) – Index of the first row.
    • row2 (int) – Index of the second row.
  • 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 method enable_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 structure my_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.

property destructively_edited : bool

Whether the tabular data has been destructively edited. If the value of this property is False then imports will be safe to use with Data Updater.

SEE ALSO

enable_destructive_editing() : Enable destructive editing of the tabular data.
  • Returns: True if destructive editing is enabled and any actions have been taken that require destructive editing. False if 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.

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 if AttributeDefinitionTabular.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.

property linking_table : Table | None

Table object which the linking attribute belongs to.
  • Returns: Table object. None for purely local tabular data.
  • Return type: Table or None

property rows : tuple[TabularRow, …]

Returns a tuple of TabularRow objects representing each row in the tabular data.

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.
When exporting data as a write user or above, this property will include all rows.

class AttributeShortText

Extended AttributeValue class for short text attributes.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use Record.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

Extended AttributeValue class for long text attributes.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use Record.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. Use Record.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

If create_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: If this method is used with data that cannot be represented as grid functional data, conversion will fail with a 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.

set_value(value)

Set the current value of the attribute. This method is an alternative to setting the value 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:
    • parameter_name (str) – Name of the parameter to use as X-axis.
    • create_empty (bool , optional) – Whether to create an empty attribute value or copy existing data. Default is False.
  • Returns: New instance of functional attribute of identical type.
  • Return type: AttributeFunctionalSeriesPoint
  • Raises: ValueError – If the name is not a valid parameter.

Notes

If create_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.

property parameters : mappingproxy[str, FunctionalValueParameter]

Parameters associated with the functional data attribute, indexed by name. Modify the FunctionalValueParameter.unit property on the returned objects to specify a different unit for import.

property show_as_table : bool

Whether the attribute should be displayed as a table.

property table_view : FunctionalSeriesPointTableView

Supports additional read-only views of the attribute value.

property unit : str

Unit symbol for the y-axis. For the x-axis parameter or constraint parameters, use unit 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, use with_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. Use Record.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

If create_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: 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. If this method is used with data that cannot be represented as grid functional data, conversion will fail with a 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.

set_value(value)

Set the current value of the attribute. This method is an alternative to setting the value 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:
    • parameter_name (str) – Name of the parameter to use as X-axis.
    • create_empty (bool , optional) – Whether to create an empty attribute value or copy existing data. Default is False.
  • Returns: New instance of functional attribute of identical type.
  • Return type: AttributeFunctionalSeriesRange
  • Raises: ValueError – If the name is not a valid parameter.

Notes

If create_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.

property parameters : mappingproxy[str, FunctionalValueParameter]

Parameters associated with the functional data attribute, indexed by name. Modify the FunctionalValueParameter.unit property on the returned objects to specify a different unit for import.

property show_as_table : bool

Whether the attribute should be displayed as a table.

property table_view : FunctionalSeriesRangeTableView

Supports additional read-only views of the attribute value.

property unit : str

Unit symbol for the y-axis. For the x-axis parameter or constraint parameters, use unit 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, use with_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. Use Record.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

If create_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:

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:
    • parameter_name (str) – Name of the parameter to use as X-axis.
    • create_empty (bool , optional) – Whether to create an empty attribute value or copy existing data. Default is False.
  • Returns: New instance of functional attribute of identical type.
  • Return type: AttributeFunctionalGridPoint
  • Raises: ValueError – If the name is not a valid parameter.

Notes

If create_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 the FunctionalValueParameter.unit property on the returned objects to specify a different unit for import.

property table_view : FunctionalGridPointTableView

Supports additional read-only views of the attribute value.

property unit : str

Unit symbol for the y-axis. For the x-axis parameter or constraint parameters, use unit 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, use with_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. Use Record.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

If create_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:

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:
    • parameter_name (str) – Name of the parameter to use as X-axis.
    • create_empty (bool , optional) – Whether to create an empty attribute value or copy existing data. Default is False.
  • Returns: New instance of functional attribute of identical type.
  • Return type: AttributeFunctionalGridRange
  • Raises: ValueError – If the name is not a valid parameter.

Notes

If create_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 the FunctionalValueParameter.unit property on the returned objects to specify a different unit for import.

property table_view : FunctionalGridRangeTableView

Supports additional read-only views of the attribute value.

property unit : str

Unit symbol for the y-axis. For the x-axis parameter or constraint parameters, use unit 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, use with_new_x_axis().
  • Return type: str

class AttributeUnsupported

Extended AttributeValue 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. Use Record.attributes to access instances of this class.

is_empty()

Checks whether the attribute value is populated.

property is_applicable : bool

Whether the attribute is applicable to the current record. Setting this to False will clear any data values on the attribute on import.
  • Return type: bool
  • Raises: TypeError – If attempting to set a non-boolean value.

property object : UnsupportedType

Gets the underlying UnsupportedType object representing the attribute value or the tabular cell. Does not allow access to the data.

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. Use Record.get_attributes() to generate instances of this class.

is_empty()

Checks whether the pseudo-attribute value is populated or not.

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

Parent Record described by the PseudoAttributeValue.

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 the Record.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