1. i-SAS_Visualizer-template¶
1.1. interface¶
-
class
visualizer.interface.Interface(fig_name, size_ratio, input_names=None, variable_names=None, structural_model_name=None, **kwargs)¶ Bases:
objectinterface class
-
GRID_NUM= 12¶
-
DPI= 100¶
-
package_name= 'visualizer'¶
-
content_type= 'visualizer'¶
-
__init__(fig_name, size_ratio, input_names=None, variable_names=None, structural_model_name=None, **kwargs)¶ initialization.
- Parameters
fig_name (str) – figure name.
size_ratio (tuple(int, int)) – figure size ratio. (1 <= int <= 12)
input_names (dict. optional) – dict whose keys are names of input quantity and values are names of input data.
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.
Examples
>>> fig_name = 'example' >>> size_ratio = (1, 1) >>> data_names = {stress: ['ifem_stress_x', 'ifem_stress_y', 'ifem_stress_xy']} >>> model_name = 'test_model' >>> Interface(fig_name, size_ratio, data_names, model_name)
-
set_project(project_name)¶ set project
- Parameters
project_name (str) – project name.
-
set_model(structural_models)¶ set model
- Parameters
structural_models (dict) – structural models.
-
setup(window_width)¶ create figure canvas in gui
- Parameters
window_width (int) – window width (px)
- 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.
-
1.2. model¶
-
class
visualizer.model.Model(fig_name, cfg)¶ Bases:
objectmodel class
-
IMG_DIR= PosixPath('/root/datadrive/gui/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 (pandas.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
-
example(ax)¶ create figure named example.
- Parameters
ax (matplotlib.figure.axes) – axes of matplotlib figure
- Returns
axes after being drawn
- Return type
matplotlib.figure.axes
-