2. i-SAS_BasicVisualizer

2.1. interface

class basic_visualizer.interface.Interface(fig_name, size_ratio, input_names=None, variable_names=None, structural_model_name=None, **kwargs)

Bases: object

interface class

GRID_NUM = 12
DPI = 100
package_name = 'basic_visualizer'
content_type = 'visualizer'
__init__(fig_name, size_ratio, input_names=None, variable_names=None, structural_model_name=None, **kwargs)

initialization. :param fig_name: figure name. :type fig_name: str :param size_ratio: figure size ratio. (1 <= int <= 12) :type size_ratio: tuple(int, int) :param input_names: dict whose keys are names of input quantity and

values are names of input data.

Parameters
  • variable_names (dict, optional) – dict whose keys are names of used quantity and values are names of variables.

  • structural_model_name (str, optional) – structural model name

  • **kwargs – Arbitrary keyword arguments.

set_project(project_name)

set project

Parameters

project_name (str) – project name.

set_model(structural_models)

set model :param structural_models: structural models. :type structural_models: dict

setup(window_width)

create figure canvas in gui mode :param window_width: window width (px) :type window_width: int

Returns

figure canvas

Return type

FigureCanvasQTAgg

update(data, variables, count)

update figure in gui

Parameters
  • data (dict) – calculated data

  • variables (dict) – variables for interactive gui.

  • count (int) – iteration count

__call__(window_width, data, variables)

create figure in visualization

Parameters
  • window_width (int) – window width (px)

  • data (dict) – calculated data

  • variables (dict) – variables for interactive gui.

2.2. model

class basic_visualizer.model.Model(fig_name, cfg)

Bases: object

model class

IMG_DIR = PosixPath('/root/datadrive/gui/basic_visualizer/tmp')
common_data = {}
update_count = {}
__init__(fig_name, cfg)

constructor

Parameters
  • fig_name (str) – figure name.

  • cfg (dict) – config.

set_model(structural_models)

set model

Parameters

structural_models (dict) – structural models.

__call__(ax, data, variables, count=nan)

draw figure

Parameters
  • ax (matplotlib.figure.axes) – axes of matplotlib figure

  • data (dict[pd.DataFrame]) – calculated data

  • variables (dict) – variables for interactive gui.

  • count (int or float, optional) – the number of iterations

Returns

axes after being drawn

Return type

matplotlib.figure.axes

contour(ax)

create figure named contour.

Parameters

ax (matplotlib.figure.axes) – axes of matplotlib figure

Returns

axes after being drawn

Return type

matplotlib.figure.axes

deformation(ax)

create figure named deformation.

Parameters

ax (matplotlib.figure.axes) – axes of matplotlib figure

Returns

axes after being drawn

Return type

matplotlib.figure.axes

stress_hist(ax)

create figure named moment.

Parameters

ax (matplotlib.figure.axes) – axes of matplotlib figure

Returns

axes after being drawn

Return type

matplotlib.figure.axes