ensight_version_check#

Session.ensight_version_check(version: int | str, message: str = '', exception: bool = True, strict: bool = False) bool#

Check if the session is a specific version.

Different versions of pyensight Sessions may host different versions of EnSight. This method compares the version of the remote EnSight session to a specific version number. If the remote EnSight version is at least the specified version, then this method returns True. If the version of EnSight is earlier than the specified version, this method will raise an exception. The caller can specify the error string to be included. They may also specify if the version check should be for a specific version vs the specified version or higher. It is also possible to avoid the exception and instead just return True or False for cases when an alternative implementation might be used.

Parameters:
versionUnion[int, str]

The version number to compare the EnSight version against.

messagestr

The message string to be used as the text for any raised exception.

exceptionbool

If True, and the version comparison fails, an InvalidEnSightVersion is raised. Otherwise, the result of the comparison is returned.

strictbool

If True, the comparison of the two versions will only pass if they are identical. If False, if the EnSight version is greater than or equal to the specified version the comparison will pass.

Returns:
True if the comparison succeeds, False otherwise.
Raises:
InvalidEnSightVersion if the comparison fails and exception is True.