idstools.machinedescription

Module Contents

class idstools.machinedescription.MachineDescription(summary_yaml_file: str = '')[source]
md_summary_yaml
check_if_exist(pulse: int, run: int)[source]

The function checks if a given pulse and run combination exists in a yaml dictionary.

Parameters:
pulse: int

The “pulse” parameter is an integer representing the number.

run: int

The parameter “run” is an integer representing the number.

Returns:

a boolean value. If the pulserun key is present in the yaml object dictionary, it will return True. Otherwise, it will return False.

get_children(pulse: int, run: int, dict_to_fill={})[source]

The function get_children recursively retrieves information about replaced pulses and runs from a dictionary and stores it in a new dictionary.

Parameters:
pulse: int

The “pulse” parameter is an integer that represents a pulse number.

run: int

The run parameter in the get_children method represents the run number.

dict_to_fill={}

The dict_to_fill parameter is a dictionary that is used to store the information about the children of a given pulse and run. It is initially an empty dictionary and is passed as an argument to the function to accumulate the information about the children.

Returns:

a dictionary dict_to_fill that contains information about the children of a given pulse and run. The dictionary has keys “pulse”, “run”, “status”, and “reason_for_replacement”, and the corresponding values are lists that store the information for each child.

get_family(pulse: int, run: int)[source]

The function “get_family” returns a dictionary containing the parents and children of a given pulse and run.

Parameters:
pulse: int

The “pulse” parameter represents the pulse number

run: int

The “run” parameter is an integer that represents the run number.

Returns:

“parents” and “children”. The values associated with these keys are the results of calling the get_parents and get_children methods with the given pulse and run parameters.

Return type:

a dictionary called famly_dict which contains two keys

get_latest_ids_data(ids_name: str, backend='MDSPLUS', user='public', database='ITER_MD', version=3)[source]
get_md_data_by_ids(ids_name: str)[source]
get_md_data_by_ids_list(md_ids_list=[])[source]
get_md_summary(ids_names: list | str = '', add_obsoelete=False, check_validity=False)[source]
get_pandas_data_frame()[source]

The function get_pandas_data_frame converts a dictionary into a pandas DataFrame.

Returns:

a pandas DataFrame object.

get_parents(pulse: int, run: int, dict_to_fill={})[source]

The get_parents function recursively retrieves the parent information for a given pulse and run, populating a dictionary with the parent pulse, parent run, status, and reason for replacement.

Parameters:
pulse: int

The pulse parameter is an integer that represents a pulse number.

run: int

The run parameter is an integer that represents the run number.

dict_to_fill={}

The dictToFill parameter is a dictionary that is used to store the information about the parents of a given pulse and run. It is initially an empty dictionary and is passed as an argument to the get_parents function. The function fills this dictionary with the parent information and returns it.

Returns:

a dictionary dict_to_fill that contains information about the parents of a given pulse and run.

get_reason_for_replacement(pulse: int, run: int)[source]

The function get_reason_for_replacement takes in two parameters, pulse and run, and returns the value of the key “reason_for_replacement” from the yaml object dictionary using the pulse and run as keys.

Parameters:
pulse: int

The “pulse” parameter represents the number of pulses taken.

run: int

The “run” parameter represents the number of runs in a particular pulse.

Returns:

The method get_reason_for_replacement returns the value of “reason_for_replacement” if yaml object is not None, otherwise it returns None.

get_replaced_by(pulse: int, run: int)[source]

The function get_replaced_by takes in two parameters, pulse and run, and returns the value of the key “replaced_by” from the yaml object dictionary using the pulse and run as keys.

Parameters:
pulse: int

The “pulse” parameter represents the number of pulses taken.

run: int

The “run” parameter represents the number of runs in a particular pulse.

Returns:

The method get_replaced_by returns the value of “replaced_by” if yaml object is not None, otherwise it returns None.

get_replaces(pulse: int, run: int)[source]

The function get_replaces takes in two parameters, pulse and run, and returns the value of the key “replaces” from the yaml object dictionary using the pulse and run as keys.

Parameters:
pulse: int

The “pulse” parameter represents the number of pulses taken.

run: int

The “run” parameter represents the number of runs in a particular pulse.

Returns:

The method get_replaces returns the value of “replaces” if yaml object is not None, otherwise it returns None.

get_status(pulse: int, run: int)[source]

The function get_status takes in two parameters, pulse and run, and returns the value of the key “status” from the yaml object dictionary using the pulse and run as keys.

Parameters:
pulse: int

The “pulse” parameter represents the number of pulses taken.

run: int

The “run” parameter represents the number of runs in a particular pulse.

Returns:

The method get_status returns the value of “status” if yaml object is not None, otherwise it returns None.

idstools.machinedescription.get_md_data(uri_list, dd_update=False, idses=MD_IDSES)[source]
idstools.machinedescription.MD_IDSES = "'tf,wall,pf_passive,pf_active,magnetics'"
idstools.machinedescription.logger