Skip to main content

MI Scripting Toolkit 4.2 release notes

Enhancements

Bug fixes

Examples

There have been no changes to example scripts in MI Scripting Toolkit 4.2.

Backwards incompatible API changes

There are no known backwards-incompatible changes in MI Scripting Toolkit 4.2.

Foundation API changes

  • Additional logging has been added to assist in debugging scripts, this is available via the GDL.http logger.
  • Logging has been reorganised to allow more granular control of message logging, existing request and response log messages are now available via the GDL.core logger.
  • GetRecordAttributesByRefRequest.tabularDataSettings added to control how tabular attributes are exported.

Known issues

  • If an attribute is exported with the Table.bulk_fetch() method with include_binary_data=False, subsequent values returned by the AttributePicture.mime_file_type property will always return image/png, regardless of the actual image format. The header returned when accessing the URL is unaffected and should be used instead.
  • The behavior of Table.get_record_by_lookup_value() when a non-unique lookup value is provided is dependent on the Granta MI version. In Granta MI 2025 R2 and later, if multiple matches are detected, no results are returned. In earlier Granta MI versions, an exception is raised.
  • If an attribute is removed from the Granta MI database after the parent Database is first accessed, calls to Table.refresh_attributes() raise a GRANTA_ServiceLayerError. Use Database.refresh_tables() instead.
  • In version-controlled tables, DataRevisionHistory objects have an ambiguous meaning. The history.last_modified_date for the following attribute types is updated when the release state of the parent record is modified:
    • Date
    • Hyperlink
    • Integer
    • Logical
    • Range
    • Short text
    The history.last_modified_date for the following attribute types is not updated when the release state of the parent record is modified:
    • Discrete
    • File
    • Functional
    • Long text
    • Picture
    • Point
    • Tabular
  • The following hyperlink display options available in MI Viewer are not supported by Hyperlink.hyperlink_display:
    • Current pane
    • Left browse pane
    • Both panes below toolbar
    If a hyperlink attribute value with one of these three display options is exported, the hyperlink_display will be set to Content. If the attribute is subsequently re-imported, the display option in MI Viewer will be changed to “Right content pane”.

Planned changes and deprecations

This section describes deprecated functionality which will be removed or changed in a future release.

Functionality deprecated with version 4.2

Functionality deprecated with version 4.1

Upgrading from earlier versions

This section summarizes all the breaking changes in previous versions of MI Scripting Toolkit.

Upgrading from MI Scripting Toolkit Version 4.1

There are no changes required to upgrade from MI Scripting Toolkit Version 4.1.

Upgrading from MI Scripting Toolkit Version 4.0

Attribute Values

Parameters

Unit systems and absolute temperatures

This section describes the previous incorrect behavior and usages that are subject to behavior changes in version 4.1.
  • If the unit_system and absolute_temperature arguments were never used, the default absolute temperature was True. It now defaults to False.
  • If only the absolute_temperature argument was provided, it was ignored and the absolute temperature scale was not updated on the database.
  • If the unit_system argument was provided, it only had an effect if the provided value was not the DATABASE_UNIT_SYSTEM and if the provided value was different from the previously active unit system:
In version 4.1, the behavior of these methods and arguments has been fixed.

Upgrading from MI Scripting Toolkit for Python Version 3.x

Subsets

  • If your code does not use the Table.subsets property and the default subset in your tables contain all records, you should see no behavior changes. This is the most common scenario.
  • If your code sets the Table.subsets property to the default subset, then you should disable this assignment from your code, since it now occurs automatically.
  • If your code sets the Table.subsets property to a non-default subset, then you should clear the Table.subsets property with table_object.subsets.clear() before setting the non-default subset.
  • If your code sets the Table.subsets property to a set containing more than one subset and you perform any subsequent record fetching or search operations, these operations will raise a ValueError. They would previously not consider all applied subsets, and so would return incorrect results.

Searching and browsing for records

  • All searches except Database.search_for_records_by_text() now apply a subset filter when searching. If a table included in a search has multiple applied subsets, a ValueError is raised.
  • The Table.search_for_records_where() list_of_criteria parameter must now only contain criteria based on pseudo-attributes and attribute definitions from the table being searched. Otherwise a ValueError is raised.
  • The Database.search_for_records_where() list_of_criteria parameter must now only contain criteria based on pseudo-attributes and attribute definitions from at most one table within the database being searched. Otherwise a ValueError is raised.
  • Getting records based on the Granta MI tree is generally now subject to subset filtering. If a table included in a record fetch operation has multiple applied subsets, a ValueError is raised.

Other changes

AsyncJobs

The AsyncJobQueue functionality has been moved to a new PyAnsys package called PyGranta JobQueue. If you are using Granta MI 2024 R2 or later, you can use this package to import and export Excel files and import text data into Granta MI. If you are using Granta MI 2024 R1 or earlier and require Job Queue functionality, you should continue to use MI Scripting Toolkit v3.3.

Upgrading from MI Scripting Toolkit for Python Version 2.X

New store_password option on the Session class

Old behavior: The password for a Session is used to connect to Granta MI once, and cannot be stored. New behavior: The password assigned to a Session can be stored and used multiple times. You must specify whether you want to store the password or not using the store_password property. If store_password is missing, bulk operations will fail.

AttributeValue.value property has been standardized

Additional changes to Version 2.0 scripts

Version 2.0 scripts may need to be modified to take account of these additional breaking changes: