:py:mod:`eelib.utils.simulation_setup.helper_model_overview` ============================================================ .. py:module:: eelib.utils.simulation_setup.helper_model_overview .. autoapi-nested-parse:: Helper functions for the generation of model overview for the eELib. | Author: elenia@TUBS | Copyright 2024 elenia | This file is part of eELib, which is free software under the terms of the GNU GPL Version 3. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: eelib.utils.simulation_setup.helper_model_overview.gen_model_overview eelib.utils.simulation_setup.helper_model_overview.find_specific_files eelib.utils.simulation_setup.helper_model_overview.get_sim_info eelib.utils.simulation_setup.helper_model_overview.get_model_info eelib.utils.simulation_setup.helper_model_overview.model_info_to_valid_params_df eelib.utils.simulation_setup.helper_model_overview.model_info_to_string eelib.utils.simulation_setup.helper_model_overview.string_to_file eelib.utils.simulation_setup.helper_model_overview.find_default_parameters .. py:function:: gen_model_overview(path_rst: str = 'model_overview.rst', path_txt: str = None) -> dict Create overview of models in the eELib with search for all simulators. :param path_rst: Path to save model info in rst-format, if needed. Defaults to "model_overview.rst". :type path_rst: str :param path_txt: Path to save model info in txt-format, if needed. Defaults to None. :type path_txt: str :returns: information about all eELib model, including class and valid parameters :rtype: dict .. py:function:: find_specific_files(directory: str, pattern: str) -> list Recursively search for files matching the pattern (in the filename) in the given directory. :param directory: The root directory to start searching from. :type directory: str :param pattern: The pattern to match files (e.g., '\*.txt' for all text files). :type pattern: str :returns: paths to the matching files :rtype: list .. py:function:: get_sim_info(full_file_path: str) -> dict Load simulator and model module to retrieve data for both into a dict. :param full_file_path: path to the simulator file :type full_file_path: str :returns: information about simulator and list of corresponding models :rtype: dict .. py:function:: get_model_info(model_class: str, sim_dict: dict, eelib_dir: str) -> dict Retrieve data for a model class including valid input parameters. :param model_class: name of the class for the model type :type model_class: str :param sim_dict: information collected from the simulator (file paths etc.) :type sim_dict: dict :param eelib_dir: path to eELib directory :type eelib_dir: str :returns: information about the model, including class and valid parameters :rtype: dict .. py:function:: model_info_to_valid_params_df(model_info: dict) -> pandas.DataFrame From model information print valid input parameters to the console. :param model_info: information about the model, including class and valid parameters :type model_info: dict :returns: Dataframe of valid parameters :rtype: pd.DataFrame .. py:function:: model_info_to_string(model_info: dict, title: str = 'Model Information') -> str Convert the collected information about models into a single string. :param model_info: information about models with class, path, and valid parameters :type model_info: dict :param title: Title for the string. Defaults to "Model Information". :type title: str :returns: the full string with all model information :rtype: str .. py:function:: string_to_file(input: str, file_path: str = 'model_overview.rst') Saves a string in specified format to a file. :param input: The text content to save. :type input: str :param file_path: The full path of the file to save the content in. :type file_path: str .. py:function:: find_default_parameters(class_to_inspect: object) -> dict For a given class, retrieves all parameters with default values. :param class_to_inspect: The class to inspect the parameters of. :type class_to_inspect: object :returns: {param1: default_val, param2: default_val} :rtype: dict