# {py:mod}`airsspy.utils` ```{py:module} airsspy.utils ``` ```{autodoc2-docstring} airsspy.utils :allowtitles: ``` ## Module Contents ### Functions ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`trim_stream ` - ```{autodoc2-docstring} airsspy.utils.trim_stream :summary: ``` * - {py:obj}`filter_out_stream ` - ```{autodoc2-docstring} airsspy.utils.filter_out_stream :summary: ``` * - {py:obj}`calc_kpt_tuple_recip ` - ```{autodoc2-docstring} airsspy.utils.calc_kpt_tuple_recip :summary: ``` * - {py:obj}`unique ` - ```{autodoc2-docstring} airsspy.utils.unique :summary: ``` * - {py:obj}`stream_to_list ` - ```{autodoc2-docstring} airsspy.utils.stream_to_list :summary: ``` * - {py:obj}`safe_cast_float ` - ```{autodoc2-docstring} airsspy.utils.safe_cast_float :summary: ``` * - {py:obj}`safe_cast_int ` - ```{autodoc2-docstring} airsspy.utils.safe_cast_int :summary: ``` * - {py:obj}`extract_number_from_string ` - ```{autodoc2-docstring} airsspy.utils.extract_number_from_string :summary: ``` * - {py:obj}`find_pattern_in_file ` - ```{autodoc2-docstring} airsspy.utils.find_pattern_in_file :summary: ``` * - {py:obj}`count_pattern_in_file ` - ```{autodoc2-docstring} airsspy.utils.count_pattern_in_file :summary: ``` * - {py:obj}`format_time_elapsed ` - ```{autodoc2-docstring} airsspy.utils.format_time_elapsed :summary: ``` ```` ### API ````{py:function} trim_stream(stream: typing.TextIO, start: str, end: str, extra_remove: typing.Optional[typing.List[str]] = None) -> io.StringIO :canonical: airsspy.utils.trim_stream ```{autodoc2-docstring} airsspy.utils.trim_stream ``` ```` ````{py:function} filter_out_stream(stream: typing.TextIO, start: str, end: str) -> io.StringIO :canonical: airsspy.utils.filter_out_stream ```{autodoc2-docstring} airsspy.utils.filter_out_stream ``` ```` ````{py:function} calc_kpt_tuple_recip(structure: ase.Atoms, mp_spacing: float = 0.05, rounding: str = 'up') -> typing.Tuple[int, int, int] :canonical: airsspy.utils.calc_kpt_tuple_recip ```{autodoc2-docstring} airsspy.utils.calc_kpt_tuple_recip ``` ```` ````{py:function} unique(items: typing.List) -> typing.List :canonical: airsspy.utils.unique ```{autodoc2-docstring} airsspy.utils.unique ``` ```` ````{py:function} stream_to_list(stream: typing.TextIO) -> typing.List[str] :canonical: airsspy.utils.stream_to_list ```{autodoc2-docstring} airsspy.utils.stream_to_list ``` ```` ````{py:function} safe_cast_float(value: str, default: float = 0.0) -> float :canonical: airsspy.utils.safe_cast_float ```{autodoc2-docstring} airsspy.utils.safe_cast_float ``` ```` ````{py:function} safe_cast_int(value: str, default: int = 0) -> int :canonical: airsspy.utils.safe_cast_int ```{autodoc2-docstring} airsspy.utils.safe_cast_int ``` ```` ````{py:function} extract_number_from_string(text: str, default: float = 0.0) -> float :canonical: airsspy.utils.extract_number_from_string ```{autodoc2-docstring} airsspy.utils.extract_number_from_string ``` ```` ````{py:function} find_pattern_in_file(filename: str, pattern: str, max_matches: int = 0) -> typing.List[str] :canonical: airsspy.utils.find_pattern_in_file ```{autodoc2-docstring} airsspy.utils.find_pattern_in_file ``` ```` ````{py:function} count_pattern_in_file(filename: str, pattern: str) -> int :canonical: airsspy.utils.count_pattern_in_file ```{autodoc2-docstring} airsspy.utils.count_pattern_in_file ``` ```` ````{py:function} format_time_elapsed(seconds: float) -> str :canonical: airsspy.utils.format_time_elapsed ```{autodoc2-docstring} airsspy.utils.format_time_elapsed ``` ````