Skip to main content
This section summarizes all the breaking changes in previous versions of MI Scripting Toolkit.

Upgrading from MI Scripting Toolkit Version 4.2

Package

  • Moved MI Scripting Toolkit to new packages ansys-grantami-core and ansys-grantami-backend-soap.
  • Added compatibility package GRANTA_MIScriptingToolkit, which is deprecated from v5.0.
  • Removed Async Job Queue stubs: module mi_async_jobs, method Session.get_async_job_queue and error handling in the granta namespace.

Session

  • Added SessionBuilder to create Session objects. Session is no longer supported unless imported via GRANTA_MIScriptingToolkit.
  • Removed Streamlined API function connect().
  • Removed methods Session.can_connect(), Session.assert_can_run_parallelized().
  • Removed Session.spawn_session. Create foundation layer sessions using ansys.grantami.backend.soap.GRANTA_MISession.
  • Session objects that are instantiated with URLs that do not specify a protocol now default to HTTPS. To use HTTP, provide the full URL including the http protocol.

Database

Table

Bulk methods

Attribute definitions

Records

  • Removed Record.all_children. Use Record.get_descendants().
  • Removed support for setting Record.type to a string. Set to a RecordType value.
  • Removed support for record color and record type SearchCriterion using str criterion values. Define the criterion value using the enumerations RecordColor and RecordType.
  • Removed deprecated method refetch_pseudos(). Use the alternative Record.refetch_pseudo_attributes().
  • Removed support for deprecated argument names include_metas and include_pseudos on Record.get_attributes(). Use include_meta_attributes and include_pseudo_attributes.
  • Removed deprecated attribute Record.pseudo_attributes. Pseudo-attributes are available as individual Record properties.
  • The behavior when invalid operations are performed on staged records has been standardized. All methods and properties now raise InvalidRecordStateError when called on staged records in circumstances where this is not permitted.

Float functional attribute values

  • FunctionalSeries has been split into AttributeFunctionalSeriesPoint and AttributeFunctionalSeriesRange.
  • FunctionalGrid has been split into AttributeFunctionalGridPoint and AttributeFunctionalGridRange.
  • FunctionalSeries.hide_graph has been renamed to show_as_table.
  • Removed AttributeFunctionalSeries.series_linestyles and AttributeFunctionalGrid.linestyle. Use the decoration property.
  • Removed AttributeFunctional.clear(). Set the .value to None.
  • The unit property on functional attribute classes now returns None for dimensionless attributes, instead of an empty string.
  • AttributeFunctional.xaxis_parameter has been removed. To access x-axis parameter information, use the x_axis and parameters properties.
  • The mapping AttributeFunctional.xaxis has been removed. Use with_new_x_axis(), to create an attribute value with a different x-axis.
  • The parameters property now returns a mapping of parameter names to FunctionalValueParameter objects.

Tabular attribute values

Other attribute values

Schema and supporting items

Miscellaneous functions

  • Removed method mi_functions.log_to_file_in_local_app_data. Use the Python logging module, and obtain the built-in logger with the function get_foundation_logger().
  • Removed method mi_functions.extract_parameter_value.

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

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

  • Session.records_from_string() now defaults to use_strict_version=True.
  • get_records_by_ids and get_record_by_id methods on Session, Database, and Table classes no longer accept the identity argument. Use history_identity instead.
  • Table.paths_from(), Table.path_from(), and Table.get_records_from_path() no longer support str and Table inputs. Use None to use the table root as starting node. All three methods now raise a ValueError if the record specified as starting_node is not in the current table, and raise a TypeError if the argument value is not a Record or None.
  • Record.color no longer supports str inputs. Only RecordColor objects are supported.
  • ‘AttributeFunctional.add_point’ and ‘AttributeFunctional.add_range’ methods now raise KeyError exceptions if a dictionary with incorrect keys is provided. Note: these methods were removed with MI Scripting Toolkit v5.0.
  • File.load(), File.save(), Picture.load(), and Picture.save() no longer accept file_name as an argument. Provide the full path including the file name to the path argument. For file attributes, the name of the file is part of the attribute value and can be accessed via AttributeFile.file_name or File.file_name to build a full path.
  • File.name has been removed. Use File.file_name.
  • Picture.name has been removed.
  • File and Picture no longer accept name or load as arguments. Provide the full path to the file/picture (including the file name) to the keyword only argument path.
  • File.description now only supports str inputs.
  • AttributeHyperlink.object has been removed, use the properties on the AttributeHyperlink object instead.
  • Any code which performs bulk export operations on file and picture attributes should be modified either to access the binary data with an HTTP library such as requests or httpx. Alternatively, the binary data can be exported directly by specifying include_binary_data = True in the call to Table.bulk_fetch(). However, this is likely to be less performant for large amounts of data.
  • The Record.id property has been renamed to Record.history_identity.

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: