roxieapi.cadata.CableDatabase module¶
- class roxieapi.cadata.CableDatabase.CableDatabase(insul_defs: List[InsulationDefinition], remfit_defs: List[RemFitDefinition], filament_defs: List[FilamentDefinition], strand_defs: List[StrandDefinition], transient_defs: List[TransientDefinition], quench_defs: List[QuenchDefinition], cable_defs: List[CableDefinition], conductor_defs: List[ConductorDefinition])[source]¶
Bases:
object
Class providing an interface to read, write, and access cable database definitions.
- get_cable_definition(condname: str) CableDefinition [source]¶
Method returning an insulation definition for a given conductor name
- Parameters:
condname – conductor name
- Returns:
insulation definition if match, otherwise a KeyError is thrown
- get_cable_df() DataFrame [source]¶
Method returning a dataframe table with cable definitions.
- Returns:
a dataframe table with cable definitions.
- get_conductor_definition(condname: str) ConductorDefinition [source]¶
Method returning an insulation definition for a given conductor name
- Parameters:
condname – conductor name
- Returns:
insulation definition if match, otherwise a KeyError is thrown
- get_conductor_df() DataFrame [source]¶
Method returning a dataframe table with conductor definitions.
- Returns:
a dataframe table with conductor definitions.
- get_filament_definition(condname: str) FilamentDefinition [source]¶
Method returning a filament definition for a given conductor name
- Parameters:
condname – conductor name
- Returns:
filament definition if match, otherwise a KeyError is thrown
- get_filament_df() DataFrame [source]¶
Method returning a dataframe table with filament definitions.
- Returns:
a dataframe table with filament definitions.
- get_insul_definition(condname: str) InsulationDefinition [source]¶
Method returning an insulation definition for a given conductor name
- Parameters:
condname – conductor name
- Returns:
insulation definition if match, otherwise a KeyError is thrown
- get_insul_df() DataFrame [source]¶
Method returning a dataframe table with insulation definitions.
- Returns:
a dataframe table with insulation definitions.
- get_quench_definition(condname: str) QuenchDefinition [source]¶
Method returning a quench definition for a given conductor name. If there is no quench definition for a given condname, then an empty quench definition is returned.
- Parameters:
condname – conductor name
- Returns:
quench definition if match, otherwise a KeyError is thrown
- get_quench_df() DataFrame [source]¶
Method returning a dataframe table with quench definitions.
- Returns:
a dataframe table with quench definitions.
- get_remfit_definition(condname: str) RemFitDefinition [source]¶
Method returning a remfit definition for a given conductor name
- Parameters:
condname – conductor name
- Returns:
remfit definition if match, otherwise a KeyError is thrown
- get_remfit_df() DataFrame [source]¶
Method returning a dataframe table with remfit definitions.
- Returns:
a dataframe table with remfit definitions.
- get_strand_definition(condname: str) StrandDefinition [source]¶
Method returning a strand definition for a given conductor name
- Parameters:
condname – conductor name
- Returns:
strand definition if match, otherwise a KeyError is thrown
- get_strand_df() DataFrame [source]¶
Method returning a dataframe table with strand definitions.
- Returns:
a dataframe table with strand definitions.
- get_transient_definition(condname: str) TransientDefinition [source]¶
Method returning a transient definition for a given conductor name. If there is no transient definition for a given condname, then an empty transient definition is returned.
- Parameters:
condname – conductor name
- Returns:
transient definition if match, otherwise a KeyError is thrown
- get_transient_df() DataFrame [source]¶
Method returning a dataframe table with transient definitions.
- Returns:
a dataframe table with transient definitions.
- classmethod initialize_definitions(cadata_file_path: str, keyword: str) List[TDefinition] [source]¶
Method initializing a list of definitions of a given type from a given cadata file. Method reads a cadata file and returns a dictionary, which is converted into a list of dictionaries. The list of dictionaries is converted into a list of definitions.
- Parameters:
cadata_file_path – a path to a cadata file
keyword – a cadata table name
- Returns:
a list of cadata definitions for a given table name
- keyword_to_class = {'CABLE': <class 'roxieapi.cadata.CableDefinition.CableDefinition'>, 'CONDUCTOR': <class 'roxieapi.cadata.ConductorDefinition.ConductorDefinition'>, 'FILAMENT': <class 'roxieapi.cadata.FilamentDefinition.FilamentDefinition'>, 'INSUL': <class 'roxieapi.cadata.InsulationDefinition.InsulationDefinition'>, 'QUENCH': <class 'roxieapi.cadata.QuenchDefinition.QuenchDefinition'>, 'REMFIT': <class 'roxieapi.cadata.RemFitDefinition.RemFitDefinition'>, 'STRAND': <class 'roxieapi.cadata.StrandDefinition.StrandDefinition'>, 'TRANSIENT': <class 'roxieapi.cadata.TransientDefinition.TransientDefinition'>}¶
- classmethod read_cadata(cadata_file_path: str) CableDatabase [source]¶
Method reading a cadata file and returns an initialized CableDatabase instance with a list of definitions.
- Parameters:
cadata_file_path – a path to a cadata file
- Returns:
a CableDatabase instance with initialized lists of definitions
- classmethod read_json(json_file_path: str) CableDatabase [source]¶
Method reading a json file and returning an initialized CableDatabase instance. Some definitions are optional. In this case, the
- Parameters:
json_file_path – a path
- Returns:
a CableDatabase instance with initialized lists of definitions