The ``misc.py`` module ====================== .. py:module:: ansys.dyna.core.pre.misc Summary ------- .. py:currentmodule:: misc .. tab-set:: .. tab-item:: Classes .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~ansys.dyna.core.pre.misc.Plain_Report` - .. tab-item:: Functions .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~is_float` - Determine if a string can be converted to a float. * - :py:obj:`~random_string` - Generate a random string of a fixed length. * - :py:obj:`~create_temp_dir` - Create a unique working directory in a temporary directory. * - :py:obj:`~check_valid_ip` - Check if an IP address is valid. * - :py:obj:`~check_valid_port` - Check if a port is valid. .. tab-item:: Attributes .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~base_report_class` - .. tab-item:: Constants .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~MODULE_PATH` - .. toctree:: :titlesonly: :maxdepth: 1 :hidden: Plain_Report Description ----------- Module providing miscellaneous functions and methods. .. !! processed by numpydoc !! Module detail ------------- .. py:function:: is_float(input_string) Determine if a string can be converted to a float. :Parameters: **input_string** : :class:`python:str` String. :Returns: ``True`` :obj:`when` :obj:`the` :class:`python:str` :obj:`can` :obj:`be` :obj:`converted` :obj:`to` :obj:`a` :class:`python:float`, ``False`` otherwise. .. .. !! processed by numpydoc !! .. py:function:: random_string(stringLength=10, letters=string.ascii_lowercase) Generate a random string of a fixed length. :Parameters: **stringLength** : :class:`python:int`, :obj:`optional` Length of the string. The default is ``10``. **letters** .. .. !! processed by numpydoc !! .. py:function:: create_temp_dir(tmpdir=None) Create a unique working directory in a temporary directory. :Parameters: **tempdir** : :class:`python:str`, :obj:`optional` Name of the temporary directory to create the working directory in. The default is ``None``. .. !! processed by numpydoc !! .. py:function:: check_valid_ip(ip) Check if an IP address is valid. :Parameters: **ip** IP address. .. !! processed by numpydoc !! .. py:function:: check_valid_port(port, lower_bound=1000, high_bound=60000) Check if a port is valid. :Parameters: **port** : :class:`python:int` Port. **lower_bound** : :class:`python:int`, :obj:`optional` Lowest value for the port range. The default is ``1000``. **high_bound** : :class:`python:int`, :obj:`optional` Highest value for the port range. The default is ``6000``. .. !! processed by numpydoc !! .. py:data:: MODULE_PATH .. py:data:: base_report_class