Module functions

mstar.Load(fn='')

Load a msb document.

Parameters:

fn (str) – The file name to load. If argument is an empty string (the default), returns a new empty model.

Returns:

The mstar model MStarModel

mstar.LoadFromCatalog(name='')

Load a msb document from the built-in catalog

Parameters:

fn (str) – The name to load

Returns:

The mstar model MStarModel

mstar.CheckOutLicense()

Check out an M-Star pre-processing license. Required to do any processing

mstar.SetVerbose()

Enable verbose printing

mstar.ListComponentTypes()
Returns:

The available component types that can be created using the AddComponent methods

Return type:

list

mstar.SetLogVerbosity(level)

Change what type of messages show up in the log. By default all messages show up in the log except for verbose messages.

Values:

  • 1 : Errors

  • 2 : Warnings

  • 9 : All messages

Parameters:

level (int) – Max level to report to log.

mstar.EnableLogging(value)

Enable logging to standard output. Log is disabled by default.

Parameters:

value (bool) – Enable or disable logging

mstar.QueryRLMProducts(license, product, version)

Query the license system to show available licenses and other information. Useful for querying a remote license server to see the available license count at any given time.

Note that you do not need to call mstar.Initialize() or mstar.CheckOutLicense() to use this feature.

Parameters:
  • license (str) – Enter license path here, for example, 5053@mylicenseserver. If left empty, the default license configuration is used taken from GUI configuration. Licenses defined in environment variable mstar_LICENSE and license files installed next to the executable are always used by RLM.

  • product (str) – RLM product name. Either dmt-preprocess or dmt-solver.

  • version (str) – RLM version. 1.0.

Returns:

List of RLM product definitions

Return type:

list[RlmProduct]

class mstar.RlmProduct

Data structure containing RLM query results for a particular product and version.

GetName()

Get product name

Return type:

str

GetVersion()

Get version. Note this is a version specific to the license itself. This is not related to the released product version.

Return type:

str

GetExpireDateString()

Get expiration date string. Typically in the form dd-mmm-yyyy. Parse using Python datetime format string %d-%b-%Y

Return type:

str

GetExpireDays()

Get the number of days until expiration. 0 indicates permanent license.

Return type:

int

GetStartDateString()

Get the start date string (if present). Typically in the form dd-mmm-yyyy. Parse using Python datetime format string %d-%b-%Y

Return type:

str

GetCustomer()

Get customer name

Return type:

str

GetContract()

Get contract name

Return type:

str

IsFloating()

Get flag indicates if this is a floating counted license

Return type:

bool

IsNodeLocked()

Get flag indicates if this is node locked or unlocked

Return type:

bool

GetFloatingLicenseServer()

Get floating license server name. Only relevant if this is a floating license.

Return type:

str

GetCount()

Get total number of licenses. Only relevant if this is a floating counted license.

Return type:

int

GetCountInUse()

Get number of licenses currently in use. Only relevant if this is a floating counted license.

Return type:

int

GetHostId()

Get host ID of a node-locked license. ANY indicates a node-unlocked license.

Return type:

str