Visualization
Инструменты визуализации
from svetlanna.visualization import ...Классы
StepwiseForwardWidget
Наследует:anywidget.AnyWidget
SpecsWidget
Наследует:anywidget.AnyWidget
ElementHTML
Representation of an element in HTML format.
Функции
default_widget_html_method(index: int, name: str, element_type: str | None, subelements: list[ElementHTML]) -> str
Default _widget_html_ method used for rendering Specsable elements.
📥 Параметры
| Параметр | Тип | Описание |
|---|---|---|
index | int | The unique index of the element. Should be used as an id of HTML element containing the element. |
name | str | Human readable name of the element |
element_type | `str | None` |
subelements | list[ElementHTML] | Subelements of the element. |
📤 Возвращает
str
rendered HTML
generate_structure_html(subelements: list[_ElementInTree]) -> str
Generate HTML for a setup structure.
📥 Параметры
| Параметр | Тип | Описание |
|---|---|---|
subelements | list[_ElementInTree] | Elements tree |
📤 Возвращает
str
Rendered HTML
show_structure(*specsable: Specsable)
Display a setup structure using IPython’s HTML display. Useful for previewing specs hierarchies in notebooks.
show_specs(*specsable: Specsable) -> SpecsWidget
Display a setup structure with interactive specs preview
📤 Возвращает
SpecsWidget
The widget
draw_wavefront(wavefront: torch.Tensor, simulation_parameters: SimulationParameters, types_to_plot: tuple[StepwisePlotTypes, ...] = ('I', 'phase')) -> bytes
Show field propagation in the setup via widget.
Currently only wavefronts of shape (W, H) are supported.
📥 Параметры
| Параметр | Тип | Описание |
|---|---|---|
wavefront | Tensor | The Input wavefront |
simulation_parameters | SimulationParameters | Simulation parameters |
types_to_plot | tuple[StepwisePlotTypes, ...], optional | Field properties to plot, by default (‘I’, ‘phase’) |
📤 Возвращает
bytes
byte-coded image
show_stepwise_forward(*specsable: Specsable) -> StepwiseForwardWidget
Display the wavefront propagation through a setup structure
using a widget interface. Currently only wavefronts
of shape (W, H) are supported.
📥 Параметры
| Параметр | Тип | Описание |
|---|---|---|
input | torch.Tensor | The Input wavefront |
simulation_parameters | SimulationParameters | Simulation parameters |
types_to_plot | tuple[StepwisePlotTypes, ...], optional | Field properties to plot, by default (‘I’, ‘phase’) |
📤 Возвращает
StepwiseForwardWidget
The widget