melkit.toolkit.Toolkit
- class melkit.toolkit.Toolkit(filename: str)
Multi-purpose file manipulator.
- __init__(filename: str)
Methods
__init__(filename)as_dataframe(datafile)Converts an output EDF file to a Pandas dataframe.
available_to_csv(obj_list[, title])Returns a single-column available IDs DataFrame from an object list.
create_submodel(cv_id[, new_file])Creates a submodel related to a given CV.
get_available_ids(obj_list)Returns a sorted list of available IDs from a list of objects.
get_cf(cf_id)Searches for a CF in the input file and returns it as a CF object.
Return the list of CFs in parsed file.
get_connected_cfs(obj_id)Get those CFs directly or indirectly connected to a given Object.
get_connected_cvs(cv_id)Get those CVs connected to a given CV
get_cv(cv_id)Searches for a CV in the input file and returns it as a CV object.
Return the list of CVs in parsed file.
get_duplicated(obj_list)Searches for duplicated objects (CV, FL...) from a list of objects.
Returns a list of variable names based on EDF records in file.
get_fl(fl_id)Searches for a FL in the input file and returns it as a FL object.
get_fl_connections(cv_id)Get those FLs connected to a given CV
Return the list of CVs in parsed file.
get_last_values(datafile)Returns the last values of an EDF output file.
get_last_values_dict(datafile)Returns the last values of an EDF output file with the corresponding variable names.
get_used_ids(obj_list)Returns a sorted list of used IDs from a list of objects.
id_search(obj_list, id)Searches for an input object (CV, FL...) by its ID in a list of input elements.
plot_edf(datafile, y_var)Plot an EDF variable value along time.
remove_comments([overwrite, new_file])Remove comments from input file.
remove_object(obj_id[, overwrite, new_file])Deletes an object from the input file.
update_object(obj[, overwrite, new_file])Updates object input information.
used_to_csv(obj_list[, title])Returns a single-column used IDs DataFrame from an object list.
write_object(obj[, overwrite, new_file])Writes a new object in the input file.
- _read_object(id_regex: str) List[Object]
Looks for objects in the input file according to a given ID regex
- as_dataframe(datafile: str) DataFrame
Converts an output EDF file to a Pandas dataframe.
- available_to_csv(obj_list: List[Object], title='./available.csv') DataFrame
Returns a single-column available IDs DataFrame from an object list. Also exports it as a CSV file.
- create_submodel(cv_id: str, new_file: str = None) List[CV] | List[FL]
Creates a submodel related to a given CV. Those neighbour CVs are made time-independent.
- get_available_ids(obj_list: List[Object]) List[str]
Returns a sorted list of available IDs from a list of objects.
- get_connected_cfs(obj_id: str) List[CF]
Get those CFs directly or indirectly connected to a given Object. - If the Object is an FL, the CF associated with the CFnnnTk record is returned and, recursively, all CFs on which this CF depends are added. - If the object is a CF, that CF and its dependencies are returned.
- get_duplicated(obj_list: List[Object]) List[Object]
Searches for duplicated objects (CV, FL…) from a list of objects.
- get_edf_vars() List[str]
Returns a list of variable names based on EDF records in file.
- get_last_values(datafile: str) List[float]
Returns the last values of an EDF output file.
- get_last_values_dict(datafile: str) List[float]
Returns the last values of an EDF output file with the corresponding variable names.
- get_used_ids(obj_list: List[Object]) List[str]
Returns a sorted list of used IDs from a list of objects.
- id_search(obj_list: List[Object], id: str) Object
Searches for an input object (CV, FL…) by its ID in a list of input elements.
- plot_edf(datafile: str, y_var: str) None
Plot an EDF variable value along time.
- remove_comments(overwrite=False, new_file: str = None) None
Remove comments from input file.
- remove_object(obj_id: str, overwrite: bool = False, new_file: str = None) None
Deletes an object from the input file.
- update_object(obj: Object, overwrite: bool = False, new_file: str = None) None
Updates object input information.