12.8. pyVig - cablings
- class nettoolkit.pyVig.cablings.ADevCablings(self_device, **kwargs)[source]
Bases:
objectA single Device Cabling details
- Parameters:
self_device (str) – device hostname (self)
12.9. pyVig - mathamatics
- class nettoolkit.pyVig.maths.CalculateXY(dev_df, default_x_spacing, default_y_spacing, cbl_df, sheet_filter_dict)[source]
Bases:
objectCo-ordinate calculator
- Parameters:
dev_df (DataFrame) – Device DataFrame
default_x_spacing (int, float) – horizontal spacing between two devices
default_y_spacing (int, float) – vertical spacing between two devices
cbl_df (DataFrame) – Cabling DataFrame
sheet_filter_dict (dict) – sheet filters for multi tab drawing
- calc_xs(ho_dict)[source]
calculate x-axis refereances with respect to high order dictionary
- Parameters:
ho_dict (dict) – high order devices dictionary
- Returns:
high order dictionary with x-axis reference values
- Return type:
dict
- calc_ys(ho_dict)[source]
calculate y-axis refereances with respect to high order dictionary
- Parameters:
ho_dict (dict) – high order devices dictionary
- Returns:
high order dictionary with y-axis reference values
- Return type:
dict
- count_of_ho(df)[source]
counts hierarchical_order items for given dataframe and stores it in local dict
- Parameters:
df (DataFrame) – Device Dataframe with hierarchical_order column
- Returns:
_description_
- Return type:
_type_
- get_x(ho)[source]
get the x axis value for a device from given hierarchical order number
- Parameters:
ho (int) – hierarchical order number
- Returns:
x axis value
- Return type:
int, float
- get_y(ho)[source]
get the y axis value for the given hierarchical_order
- Parameters:
ho (int) – hierarchical order number
- Returns:
y axis value
- Return type:
int, float
- inverse_y(y)[source]
inverses the y axis values (turn upside down)
- Parameters:
y (dict) – dictionary with y axis placement values based on hierarchical_order
- Returns:
inversed dictionary with y axis placement values based on reversed hierarchical_order
- Return type:
dict
- merge_xy_filter_dfs_with_dev_df()[source]
merge sheet filter x,y column information with main device dataframe
- update_xs(df, x_axis, ho_dict)[source]
update x-axis column to given df Device DataFrame
- Parameters:
df (DataFrame) – Device DataFrame
x_axis (str) – column name for x_axis
ho_dict (dict) – high order devices dictionary
- class nettoolkit.pyVig.maths.CalculateXYNative(ddf, cdf, sfd)[source]
Bases:
objectCalculate co-ordinate default Native way
- Parameters:
ddf (DataFrame) – Devices DataFrame
cdf (DataFrame) – Cabling DataFrame
- add(item, x, y)[source]
add an item to provided co-ordinates
- Parameters:
item (str) – device hostname
x (int) – x-coordinate
y (int) – y-coordinate
- count_of_devices(dev)[source]
identify devices from cable matrix and provide its occurances number.
- Parameters:
dev (str) – Device hostname to match with
- Returns:
number of occurances
- Return type:
int
- device_add(device, root)[source]
check if device and its childs is added or not and add its co-ordinates.
- Parameters:
device (str) – hostname of device
root (bool) – is it root path or not
- Returns:
No return
- Return type:
None
- get_nbr_devices(device)[source]
get set of neighbor devices for provided host/device
- Parameters:
device (str) – device hostname
- Returns:
set of devices
- Return type:
set
- nettoolkit.pyVig.maths.df_with_slops_and_angles(df, x1_col, x2_col, y1_col, y2_col)[source]
add the dataframe with slop and angle for the given co-ordinates on plane.
- Parameters:
df (DataFrame) – Input DataFrame
x1_col (str) – column name for point 1 - x axis
x2_col (str) – column name for point 2 - x axis
y1_col (str) – column name for point 1 - y axis
y2_col (str) – column name for point 2 - y axis
- Returns:
Updated Output DataFrame
- Return type:
DataFrame