cfx_version#

Module for getting the CFX version.

Exceptions:

AnsysVersionNotFound

Raised when the Ansys version is not found.

ComparisonError()

Raised when a comparison can't be completed.

Classes:

CFXVersion(*values)

Provide an enumeration over supported CFX versions.

Functions:

get_version([session])

Get the CFX version.

get_version_for_file_name([version, session])

Get the CFX version for the file name.

exception ansys.cfx.core.utils.cfx_version.AnsysVersionNotFound#

Bases: RuntimeError

Raised when the Ansys version is not found.

class ansys.cfx.core.utils.cfx_version.CFXVersion(*values)#

Bases: Enum

Provide an enumeration over supported CFX versions.

Examples

CFXVersion(“25.2.0”) == CFXVersion.v252

CFXVersion.v252.number == 252

CFXVersion.v252.awp_var == ‘AWP_ROOT252’

Attributes:

awp_var

Get the CFX version in AWP environment variable format.

number

Get the CFX version as a plain integer.

v252

Version 2025 R2

v261

Version 2026 R1

v271

Version 2027 R1

Methods:

current_dev()

Get the version of the current development version.

current_release()

Get the version of the current release.

get_latest_installed()

Get the version corresponding to the most recent Ansys installation available.

property awp_var#

Get the CFX version in AWP environment variable format.

classmethod current_dev()#

Get the version of the current development version.

Returns:
CFXVersion

CFXVersion corresponding to the latest development version.

classmethod current_release()#

Get the version of the current release.

Returns:
CFXVersion

CFXVersion corresponding to the latest release.

classmethod get_latest_installed()#

Get the version corresponding to the most recent Ansys installation available.

Returns:
CFXVersion

CFXVersion corresponding to the newest CFX version.

Raises:
AnsysVersionNotFound

If an Ansys version cannot be found.

property number#

Get the CFX version as a plain integer.

v252 = '25.2.0'#

Version 2025 R2

v261 = '26.1.0'#

Version 2026 R1

v271 = '27.1.0'#

Version 2027 R1

exception ansys.cfx.core.utils.cfx_version.ComparisonError#

Bases: RuntimeError

Raised when a comparison can’t be completed.

Methods:

__init__()#
ansys.cfx.core.utils.cfx_version.get_version(session=None)#

Get the CFX version.

ansys.cfx.core.utils.cfx_version.get_version_for_file_name(version: str | None = None, session=None)#

Get the CFX version for the file name.