AFL.automation.shared.DataLabelerWidget#

Functions

sqrt(x, /)

Return the square root of x.

Classes

DataLabelerModel(dataset)

DataLabelerView()

DataLabelerWidget(input_dataset, ...[, ...])

OrdinalEncoder(*[, categories, dtype, ...])

Encode categorical features as an integer array.

class AFL.automation.shared.DataLabelerWidget.DataLabelerWidget(input_dataset: Dataset, sas_variable: str, composition_variable: str | List[str], sample_dim: str = 'sample', fit_variable: str | None = None)[source]#
__init__(input_dataset: Dataset, sas_variable: str, composition_variable: str | List[str], sample_dim: str = 'sample', fit_variable: str | None = None)[source]#
Parameters:
  • dataset (xr.Dataset) – Dataset from AFL

  • sas_variable (str) – Name of data variable in the xarray.Dataset that holds the scattering data

  • composition_variable (str | List[str]) – Name of data variable in the xarray.Dataset that holds the composition. If the composition is split across multiple variables, pass in a list of variables.

  • sample_dim (str) – The name of the xarray dimension corresponding to each sample or measurement. This is typically named ‘sample’ in much of the AFL agent codebase.

  • fit_variable (Optional[str]) – If not none, this data will be plotted along with the sas_variable data. This data variable should have the same shape as sas_variable.

next_button_callback(click)[source]#
prev_button_callback(click)[source]#
goto_callback(click)[source]#
composition_click_callback(figure, location, click)[source]#
update_plot()[source]#
draw_peaks(peaks)[source]#
change_qstar_callback(figure, location, click)[source]#
change_model_callback(data)[source]#
change_norder_callback(data)[source]#
label(label)[source]#
run()[source]#
class AFL.automation.shared.DataLabelerWidget.DataLabelerModel(dataset: Dataset)[source]#
__init__(dataset: Dataset)[source]#
ordinal_phase_labels()[source]#
init_models()[source]#
get_peaks(model, qstar=None, max_order=4)[source]#
class AFL.automation.shared.DataLabelerWidget.DataLabelerView[source]#
__init__()[source]#
update_plot(x, y, composition)[source]#
remove_vertical_lines()[source]#
add_vertical_line(x, y0=0, y1=128, row=1, col=1, line_kw=None)[source]#
update_composition_colors(colors)[source]#
run(x, y, all_compositions, composition, models, ternary, components)[source]#