ansys.dyna.core.pre.misc#

Module providing miscellaneous functions and methods.

Attributes#

Classes#

Functions#

is_float(input_string)

Determine if a string can be converted to a float.

random_string([stringLength, letters])

Generate a random string of a fixed length.

create_temp_dir([tmpdir])

Create a unique working directory in a temporary directory.

check_valid_ip(ip)

Check if an IP address is valid.

check_valid_port(port[, lower_bound, high_bound])

Check if a port is valid.

Module Contents#

ansys.dyna.core.pre.misc.MODULE_PATH[source]#
class ansys.dyna.core.pre.misc.Plain_Report(core, optional=None, additional=None, **kwargs)[source]#
additional[source]#
core[source]#
optional[source]#
kwargs[source]#
get_version(package)[source]#
__repr__()[source]#
ansys.dyna.core.pre.misc.base_report_class[source]#
ansys.dyna.core.pre.misc.is_float(input_string)[source]#

Determine if a string can be converted to a float.

Parameters:
input_stringstr

String.

Returns:
True when the str can be converted to a float, False otherwise.
ansys.dyna.core.pre.misc.random_string(stringLength=10, letters=string.ascii_lowercase)[source]#

Generate a random string of a fixed length.

Parameters:
stringLengthint, optional

Length of the string. The default is 10.

letters
ansys.dyna.core.pre.misc.create_temp_dir(tmpdir=None)[source]#

Create a unique working directory in a temporary directory.

Parameters:
tempdirstr, optional

Name of the temporary directory to create the working directory in. The default is None.

ansys.dyna.core.pre.misc.check_valid_ip(ip)[source]#

Check if an IP address is valid.

Parameters:
ip

IP address.

ansys.dyna.core.pre.misc.check_valid_port(port, lower_bound=1000, high_bound=60000)[source]#

Check if a port is valid.

Parameters:
portint

Port.

lower_boundint, optional

Lowest value for the port range. The default is 1000.

high_boundint, optional

Highest value for the port range. The default is 6000.