kromatography.ui package

Submodules

kromatography.ui.akta_file_setting_selector module

UI to allow a user to select the settings of the AKTA reader to parser successfully an AKTA file.

class kromatography.ui.akta_file_setting_selector.NamePattern[source]

Bases: traits.has_traits.HasStrictTraits

Proxy class to display the AKTAFileSettingSelector.col_name_patterns in a table.

dataset_type = Enum(DATA_TYPES)

Type of a column if it confirms to the regex type_regex

type_regex = Regex

Regex a column name must conform to to be of type dataset_type

matching_col_name = Str

Name(s) of the actual columns in the file that match the regex

akta_reader = Instance(AKTAReader)

reader with all default settings

collision = Bool

True if the regex leads to more than 1 column matching the data type

update_col_name()[source]
class kromatography.ui.akta_file_setting_selector.AKTAFileSettingSelector(**kwargs)[source]

Bases: traits.has_traits.HasStrictTraits

UI to customize how to import experiment continuous data.

This has 3 components:
  1. Whether to apply a time shift to the time information of the AKTA file
  2. How to map AKTA column names to column types the app is looking for
  3. How to handle mass balance discrepancy if any, between the UV data and the experiment method data.
akta_filepath = Str

AKTA file to parse

target_experiment = Instance(Experiment)

Experiment the AKTA data is loaded for (used to study mass balance)

experiment_name = Property(Str, depends_on='target_experiment')

Name of the target experiment

akta_start_method_step = Enum(values='_all_step_names')

Name of the step the AKTA time of origin is the beginning of

pure_protein_exp = Property(Bool, depends_on='target_experiment')

Whether the target experiment is about a single product component

akta_reader = Instance(AKTAReader)

reader with current settings

file_preview = Property(Str, depends_on='akta_filepath, length_of_preview')

Raw content of the file

length_of_preview = Int(100)

Number of lines from the AKTA file to show in preview

time_of_origin = Instance(UnitScalar)

Value of AKTA recorded time that should become the time origin

col_name_patterns = Dict(DATA_NAME_SEARCH_PATTERNS)

Regex that a column name must conform to be of a certain type.

all_col_names = Property(List(Str), depends_on='akta_reader')

List of all column names found in the AKTA file

patterns_as_list = List(NamePattern)

Proxy for col_name_patterns to be displayed as a table

import_settings = Dict

Stored AKTA import settings for use to import experiment

mass_bal_analyzer = Instance(MassBalanceAnalyzer)

Analyze if the experiment data is compatible from a mass balance POV

mass_balanced = Bool(True)

Is experiment data is compatible from a mass balance POV

pattern_error_msg = Str

Error message if regex patterns don’t find a required type or find more than 1 columns.

origin_error_msg = Str

Error message if the time of origin chosen isn’t in the logbook time.

mass_bal_msg = Str

Error message if the mass data isn’t consistent

mass_bal_strategy = Enum([DO_NOTHING, UPDATE_LOAD_VOL, UPDATE_LOAD_CONC])

Name of the possible mass balance strategies

mass_bal_strategy_msg = Str(DO_NOTHING_OUTPUT)

Description of the consequence of the selected strategy

initialize_settings()[source]

Initialize models and messages to display from default settings.

traits_view()[source]
evaluate_mass_balance()[source]

Compare the loaded product mass from the method and UV information.

update_mass_balance_msg()[source]
apply_strategy()[source]
reanalyze_mass_balance()[source]

Recollect data and launch mass balance analysis with new settings.

FIXME: no need to recompute both values: only the UV one is needed. We should invalidate just the one that needs re-computation

update_pattern_error_msg()[source]

The error message should be empty unless a needed curve hasn’t been found.

update_settings()[source]
rebuild_col_name_patterns()[source]
kromatography.ui.akta_file_setting_selector.build_col_name_editor(all_col_names)[source]

Build a table editor to edit a list of NamePatterns.

kromatography.ui.animation_plot_view module

Central pane view for the animation plot.

class kromatography.ui.animation_plot_view.AnimationPlotView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

The view class for a AnimationPlot model.

model = Instance(AnimationPlot)

AnimationPlot model containing the Chaco plot container and data

time_description = Str

Description of the selected time slot

default_traits_view()[source]
update_plot_title()[source]

kromatography.ui.api module

kromatography.ui.api.register_all_data_views()[source]

Register all ModelView classes for all data models.

kromatography.ui.base_model_view_with_component_array module

Base ModelView class for binding and transport ModelView classes.

class kromatography.ui.base_model_view_with_component_array.BaseModelViewWithComponentArray(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

Base ModelView for a model containing a list of arrays that should be displayed as 1 table (since all same length, 1 value per component).

The setting of values in the arrays is done automatically by the TabularAdapter since component_array is just a list of the model’s properties.

Subclass to implement the initialization of vector_attributes and how the model is connected to the component_array.

vector_attributes = List

list of attributes to display in the tabular editor

component_array = List

Proxy array that allows to display all properties together in 1 table

kromatography.ui.branding module

A module for all branding text content.

kromatography.ui.brute_force_optimizer_builder module

UI to select a set of target experiments, and design a parameter optimizer.

class kromatography.ui.brute_force_optimizer_builder.OptimizerBuilderHandler[source]

Bases: traitsui.handler.Handler

Have the create button just close the window, like the OK button.

class kromatography.ui.brute_force_optimizer_builder.BruteForceOptimizerBuilder(**traits)[source]

Bases: traits.has_traits.HasStrictTraits

Class to support building a brute force optimizer targetting one of more experiments.

optimizer_type = Enum(ALL_OPTIMIZERS)

Type of the new optimizer being created

optimizer_name = Str

Name of the new instance of optimizer being created

cost_function_name = Enum(ALL_COST_FUNCTIONS)

Target cost function to minimize

component_selector = Instance(ComponentSelector)

List of product components to compute the cost for

component_selected = DelegatesTo('component_selector')

List of all available product components

experiment_selector = Instance(ExperimentSelector)

Sub-object to select a list of experiment names

experiment_selected = DelegatesTo('experiment_selector')

List of experiment names to be targeted for the fitting

target_study = Instance(Study)

Study and its datasource (with known sims, binding & transport models)

can_create = Property(Bool, depends_on= 'experiment_selected, starting_point_simulation_name, parameter_scans')

Can an optimizer be created from the current setup?

starting_point_simulation_name = Str

Name of the simulation to build center point simulations from

initial_buffer_name = Enum(values='_all_buffers')

Name of the solution the resin was in at the start of the simulation

initial_buffer = Property(depends_on='initial_buffer_name')

Buffer instance or None, as set by the initial_buffer_name

starting_point_simulations = List(Instance(Simulation))

Starting point simulations, one for each target experiment

allowed_parameters = Property(List(Str), depends_on='starting_point_simulations, param_name_filter')

List of parameter names that can be selected to be in parameter_scans

param_name_filter = Str

Filter the list of possible parameters to scan

new_parameter_button = Button('New parameter scan')

Quick access to add a new parameter to scan

do_refine = Bool(True)

Switch to allow/disallow the refinement steps after the constant scan

refining_step_spacing = Enum('Best', 'Linear', 'Log')

Spacing for step 1 and up (which refine component parameters)

refining_step_num_values = Int(DEFAULT_REFINING_GRID_NUM_VALUES)

Size of scanning grid for refining step

refining_factor = Range(value=DEFAULT_REFINING_GRID_SIZE_FACTOR, low=1, high=100)

Factor in percentage to control size of the refined grid: larger means larger grid

traits_view()[source]
parameter_scans = List(ParameterScanDescription)

List of parameters to scan

update_starting_point_simulations()[source]
kromatography.ui.brute_force_optimizer_builder.build_general_optim_view_items(sim_to_scan=None, parameter_table_editor=None)[source]

Returns the list of items to display in the optimizer builder view when the general grid based optimizer is selected.

kromatography.ui.brute_force_optimizer_builder.build_2step_view_items(sim_to_scan=None)[source]

Returns the list of items to display in the optimizer builder view when the 2step cross-component optimizer is selected.

kromatography.ui.brute_force_optimizer_model_view module

class kromatography.ui.brute_force_optimizer_model_view.BruteForceOptimizerView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a brute-force binding model optimizer object.

model = Instance(BruteForceOptimizer)

Optimizer to display

export_data_to_csv_button = Button('Export Data To CSV')

Button to export the optimization data to CSV

run_button = Button('Launch optimizer')

Button to launch a run of all optimizer steps

sort_by = Enum(values='sort_by_possible')

Column name along which to sort the optimizer data

sort_by_possible = List

List of possible values to sort the optimizer data by

view_edit_cost_function_button = Button('View/Edit cost function')

Button to open cost function controls: displays the parameters and costs

traits_view()[source]
do_export_data(path)[source]

Export optimizer data to provided file path.

kromatography.ui.brute_force_optimizer_step_model_view module

class kromatography.ui.brute_force_optimizer_step_model_view.BruteForceOptimizerStepView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a brute force optimizer step object.

model = Instance(BruteForceOptimizerStep)

SimulationGroup to display

export_data_to_csv_button = Button('Export Data To CSV')

Button to export the optimization data to CSV

traits_view()[source]
do_export_data(path)[source]

kromatography.ui.buffer_model_view module

class kromatography.ui.buffer_model_view.BufferComponent(**traits)[source]

Bases: kromatography.model.component.Component

Proxy class to adapt a list of Components and a concentrations array to a table editor.

FIXME: Display the component’s pka and charge too, for completion?

class kromatography.ui.buffer_model_view.BufferView(model, **traits)[source]

Bases: traitsui.handler.ModelView

View for a Buffer.

model = Instance(Buffer)

Buffer to edit

buffer_components = List(Instance(BufferComponent))

Proxy for the list of components in the buffer. Needed to display them in a TableEditor.

datasource = Instance(DataSource)

(multi-study) Datasource to access known data

known_components = List

List of known components to create a buffer from. Populated from the datasource or specified directly.

default_traits_view()[source]
update_buffer_components()[source]

Returns a list of BufferComponents, constructed from the model’s chemical_component data

update_model()[source]

Updates the model when traits in the ProductComponents change

kromatography.ui.buffer_model_view.build_buffer_component_table_editor(known_component_names)[source]

Build an editor for a list of BufferComponent instances.

kromatography.ui.chemical_model_view module

class kromatography.ui.chemical_model_view.ChemicalComponent(**traits)[source]

Bases: kromatography.model.component.Component

Proxy class to adapt a list of Components and a concentrations array to a table editor.

FIXME: Display the component’s pka and charge too, for completion?

class kromatography.ui.chemical_model_view.ChemicalView(model, **traits)[source]

Bases: traitsui.handler.ModelView

View for Chemical model.

FIXME: In the current state, this view is built with the proper datasource when a new Chemical is created from data explorer context menu, but not when a model is edited in the central pane. Therefore, temporary code is contained in the __init__ to populate self.known_components from the model’s components.

model = Instance(Chemical)

Chemical to edit

chemical_components = List(Instance(ChemicalComponent))

Proxy for the list of components in the chemical. Needed to display them in a TableEditor.

datasource = Instance(DataSource)

(multi-study) Datasource to access known data

known_components = List

List of known components to create a buffer from. Populated from the datasource or specified directly.

default_traits_view()[source]
update_chemical_components()[source]

Returns a list of BufferComponents, constructed from the model’s chemical_component data

update_model()[source]

Updates the model when traits in the Components change

kromatography.ui.chemical_model_view.build_chemical_component_table_editor(known_component_names)[source]

Build an editor for a list of chemical components.

kromatography.ui.chrom_data_crud_editor module

class kromatography.ui.chrom_data_crud_editor.ChromatographyDataCRUDEditor[source]

Bases: traits.has_traits.HasStrictTraits

Editor that handles Creating/Read/Update/Delete operations for a model.

default_traits_view()[source]

kromatography.ui.chromatogram_model_view module

class kromatography.ui.chromatogram_model_view.ChromatogramModelView(**traits)[source]

Bases: traits.has_traits.HasTraits

The view class for a ChromatogramModel model.

chromatogram_model = Instance(ChromatogramModel)

Model containing chromatography data in appropriate units.

displayed_log_collection_names = List()

Names for log collections (experiments/simulations) used in the plot.

color_editor = Button('Edit plot styles')

Launcher for editor tool to control collection colors

disconnected_plots = Bool(False)

Simulations originating from the same experiment colored like the exp?

open_uv_on_open = Bool(True)

Open all UV curves on plot creation?

select_all_collections = Bool(True)

Control to select/unselect all experiments/simulations to be displayed

displayed_log_family_names = List()

The names for the log families (‘UV’ / ‘Cond’ etc.) to be plotted.

default_traits_view()[source]
add_all_uv_curves()[source]

Add to the ChromatogramPlot provided all logs that contain UV data by initializing the displayed_log_collection_names list.

apply_new_colors(modified_colors)[source]

Apply the colors selected by the editor.

Parameters:modified_colors (dict) – Dictionary mapping collection names to the color to change to.
class kromatography.ui.chromatogram_model_view.PlotColorEditor(**traits)[source]

Bases: traits.has_traits.HasTraits

Tool to edit the colors of the log collections.

collection_list = Dict

Map of LogCollections that may be editable

collection_map = Dict

Maps the collection name to the trait storing its color

modified_colors = Dict

Map the name of the collection to the user modified color attribute

disconnected_plots = Bool(False)

Simulations originating from the same experiment colored like the exp?

default_traits_view()[source]
color_modified(name, new)[source]

Store the new colors for the modified collections.

Also apply changes to connected collections.

kromatography.ui.column_model_view module

class kromatography.ui.column_model_view.ColumnView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a Column model.

FIXME: The Resin Name should be chosen from the set of resins available in the system. The resin lot should be from a list of resin lots of the resin type. FIXME: If you are not loading any experiments, use a simplified default view, if an experiment has been loaded, then use a detailed view similar to the one below

default_traits_view()[source]

kromatography.ui.column_prep_view module

class kromatography.ui.column_prep_view.ColumnPrepView[source]

Bases: traits.has_traits.HasStrictTraits

UI for selecting components to make a column object.

traits_view()[source]

kromatography.ui.column_type_model_view module

class kromatography.ui.column_type_model_view.ColumnTypeView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a ColumnType model.

default_traits_view()[source]

kromatography.ui.component_model_view module

class kromatography.ui.component_model_view.ComponentView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for Component model.

default_traits_view()[source]

kromatography.ui.component_selector module

class kromatography.ui.component_selector.ComponentSelector[source]

Bases: traits.has_traits.HasStrictTraits

Class to support select a set of experiments from a study

kromatography.ui.discretization_model_view module

class kromatography.ui.discretization_model_view.DiscretizationView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for the Discretization Parameters.

default_traits_view()[source]

kromatography.ui.experiment_selector module

class kromatography.ui.experiment_selector.ExperimentSelector[source]

Bases: traits.has_traits.HasStrictTraits

Class to support select a set of experiments from a study

kromatography.ui.external_langmuir_model_view module

class kromatography.ui.external_langmuir_model_view.ExternalLangmuirView(model=None, **metadata)[source]

Bases: kromatography.ui.base_model_view_with_component_array.BaseModelViewWithComponentArray

View for the External Langmuir Model.

param_formula_str = Str

Explanations for the component parameter table (if any)

default_traits_view()[source]

kromatography.ui.general_rate_model_view module

class kromatography.ui.general_rate_model_view.GeneralRateModelView(model=None, **metadata)[source]

Bases: kromatography.ui.base_model_view_with_component_array.BaseModelViewWithComponentArray

View for the General Rate Model.

default_traits_view()[source]

kromatography.ui.gui_model_factory module

kromatography.ui.gui_model_factory.request_new_method(study, kind='livemodal', **traits)[source]

Build a new instance of a data model invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • study (Study) – Study that this load solution configuration tool will be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object. Used to override the defaults.
kromatography.ui.gui_model_factory.request_new_load_solution(study, kind='livemodal', **traits)[source]

Build a new instance of a data model invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • study (Study) – Study that this load solution configuration tool will be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object. Used to override the defaults.
kromatography.ui.gui_model_factory.request_new_buffer(study, kind='livemodal', **traits)[source]

Build a new instance of a buffer invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • study (Study) – Study that this load solution configuration tool will be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object. Used to override the defaults.
kromatography.ui.gui_model_factory.request_new_system(study, kind='livemodal', **traits)[source]

Build a new instance of a System invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • study (Study) – Study that this load solution configuration tool will be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object. Used to override the defaults.
kromatography.ui.gui_model_factory.request_new_column(study, kind='livemodal', **traits)[source]

Build a new instance of a column invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • study (Study) – Study that this load solution configuration tool will be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object, as well as the column_prep to build the column from. Other traits used to override the defaults.
kromatography.ui.gui_model_factory.request_transport_model(study, kind='livemodal', **traits)[source]

Build a new instance of a transport_model invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • study (Study) – Study that this transport_model configuration tool will be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object. Used to override the defaults.
kromatography.ui.gui_model_factory.request_binding_model(study, kind='livemodal', **traits)[source]

Build a new instance of a binding_model invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • study (Study) – Study that this binding_model configuration tool will be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object. Used to override the defaults.
kromatography.ui.gui_model_factory.request_new_chemical(datasource, kind='livemodal', **traits)[source]

Build a new instance of a component invoking its UI editor.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (str) – Should be set to None to make it non-blocking (only useful for testing purposes).
  • traits (dict) – Attributes of the created object. Used to override the defaults.
Returns:

  • Tuple with the object created and the data to create it since it is to be
  • contributed to the SimpleDataSource.

kromatography.ui.gui_model_factory.request_new_resin(datasource, kind='livemodal', **traits)[source]

Build a new instance of a component invoking its UI editor.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (str) – Should be set to None to make it non-blocking (only useful for testing purposes).
  • traits (dict) – Attributes of the created object. Used to override the defaults.
Returns:

  • Tuple with the object created and the data to create it since it is to be
  • contributed to the SimpleDataSource.

kromatography.ui.gui_model_factory.request_new_column_type(datasource, kind='livemodal', **traits)[source]

Build a new instance of a ColumnType invoking its UI editor.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (str) – Should be set to None to make it non-blocking (only useful for testing purposes).
  • traits (dict) – Attributes of the created object. Used to override the defaults.
Returns:

  • Tuple with the object created and the data to create it since it is to be
  • contributed to the SimpleDataSource.

kromatography.ui.gui_model_factory.request_new_system_type(datasource, kind='livemodal', **traits)[source]

Build a new instance of a SystemType invoking its UI editor.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (str) – Should be set to None to make it non-blocking (only useful for testing purposes).
  • traits (dict) – Attributes of the created object. Used to override the defaults.
Returns:

  • Tuple with the object created and the data to create it since it is to be
  • contributed to the SimpleDataSource.

kromatography.ui.gui_model_factory.request_new_component(datasource, kind='livemodal', **traits)[source]

Build a new instance of a chemical component invoking its UI editor.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (str) – Should be set to None to make it non-blocking (only useful for testing purposes).
  • traits (dict) – Attributes of the created object. Used to override the defaults.
Returns:

  • Tuple with the object created and the data to create it since it is to be
  • contributed to the SimpleDataSource.

kromatography.ui.gui_model_factory.request_new_product(datasource, kind='livemodal', **traits)[source]

Build a new instance of a Product invoking its UI editor. This method returns both the object created and the data to create it since it is to be contributed to the SimpleDataSource which contains both a data and an object catalog.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (str) – Should be set to None to make it non-blocking (only useful for testing purposes).
  • traits (dict) – Attributes of the created object. Used to override the defaults.
Returns:

  • Tuple with the object created and the data to create it since it is to be
  • contributed to the SimpleDataSource.

kromatography.ui.gui_model_factory.request_new_product_component(datasource, kind='livemodal', **traits)[source]

Build a new instance of a ProdutComponent invoking its UI editor.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (str) – Should be set to None to make it non-blocking (only useful for testing purposes).
  • traits (dict) – Attributes of the created object. Used to override the defaults.
Returns:

  • Tuple with the object created and the data to create it since it is to be
  • contributed to the SimpleDataSource.

kromatography.ui.gui_model_factory.request_transport_model_ds(datasource, kind='livemodal', **traits)[source]

Build a new instance of a transport_model invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object. Used to override the defaults.
kromatography.ui.gui_model_factory.request_binding_model_ds(datasource, kind='livemodal', **traits)[source]

Build a new instance of a binding_model invoking its UI editor.

The provided study may contain data necessary to create the model.

Parameters:
  • datasource (Instance(SimpleDataSource)) – User datasource targeted to be contributed to.
  • kind (None or str) – Kind of the dialog. Set to None to make it non-blocking. Useful for testing purposes.
  • traits (dict) – Attributes of the created object. Used to override the defaults.

kromatography.ui.image_resources module

Pre-built image resources so the time to search for them is spent only once.

kromatography.ui.krom_view module

class kromatography.ui.krom_view.KromView(*values, **traits)[source]

Bases: traitsui.view.View

Common view which sets arguments that are common to all app views.

kromatography.ui.langmuir_model_view module

class kromatography.ui.langmuir_model_view.LangmuirView(model=None, **metadata)[source]

Bases: kromatography.ui.base_model_view_with_component_array.BaseModelViewWithComponentArray

View for the Langmuir Model.

model = Instance(Langmuir)

Model to display

default_traits_view()[source]

kromatography.ui.menu_entry_names module

Names of menu entries, so that they can be imported and consistent across the entire application.

kromatography.ui.method_model_view module

class kromatography.ui.method_model_view.MethodModelView(model, **traits)[source]

Bases: traitsui.handler.ModelView

View for the Method, Method Step and Collection Criteria Models.

model = Instance(Method)

Method to be viewed

datasource = Instance(InStudyDataSource)

(study)datasource containing all known solutions

initial_buffer_name = Property(Str, depends_on='model.initial_buffer')

Button to display the details about the initial buffer:

default_traits_view()[source]
update_solutions(obj, trait, new)[source]
kromatography.ui.method_model_view.build_method_step_table_editor(known_solution_names=None)[source]

Build a custom table editor to control a list of MethodSteps

kromatography.ui.method_model_view.extract_list_of_solutions(method_steps)[source]

Extract the list of unique solutions involved in a list of MethodStep.

kromatography.ui.multi_experim_strip_fraction_calculator_view module

Assistant to display and override Experiments’ strip fractions.

class kromatography.ui.multi_experim_strip_fraction_calculator_view.MultiExpStripFractionCalculatorHandler[source]

Bases: traitsui.handler.Handler

Controller for the StripFractionCalculatorEditor, controlling the custom buttons.

do_apply(info)[source]
do_reset(info)[source]
close(info, is_ok, skip_reset=False)[source]

Closing the window or Cancel button requested. Reset the model.

class kromatography.ui.multi_experim_strip_fraction_calculator_view.MultiExpStripFractionCalculatorView[source]

Bases: traits.has_traits.HasStrictTraits

Editor for interactive computation of strip fraction for a list of experiments.

target_experiments = List(Instance(Experiment))

List of experiments to build strip fraction calculators for

fraction_calculators = List(Instance(StripFractionCalculator))

List of strip fraction calculators for each target experiment

default_traits_view()[source]

kromatography.ui.optimizer_cost_function_explorer module

Tool to explore and ultimately optimize the cost function used by an optimizer.

class kromatography.ui.optimizer_cost_function_explorer.OptimizerCostFunctionExplorer(**traits)[source]

Bases: traits.has_traits.HasTraits

Viewer and editor for the default brute force optimizer cost function.

FIXME: Refactor the plot part into an nD dataframe viewer FIXME: Make it more general by not assume what component the cost function is made of.

optimizer = Instance(BruteForceOptimizer)

Optimizer whose cost function is being being edited/viewed

peak_time_weight = Float

Proxy weight (relative importance) of the peak time location

peak_height_weight = Float

Proxy weight (relative importance) of the height of the peak

peak_slope_weight = Float

Proxy weight (relative importance) of the peak’s back slope

cost_func_weights = Property(Array, depends_on= 'peak_time_weight, peak_height_weight, peak_slope_weight')

Array of proxy weights

edit_weights_button = Button('Edit weights/View weights')

Toggle the weight edit mode

can_change_weights = Property(Bool)

Is there enough data to recompute costs

weight_edit_mode = Bool

Allow to edit the weights of the cost function?

cost_data = Instance(pd.DataFrame)

Complete cost data computed by the cost function

filtered_cost_data = Instance(pd.DataFrame)

Cost data, filtered on all the parameters that are not plotted

simulations = List(Simulation)

List of simulation objects the cost data is computed for.

show_cost_data_nd = Enum(['1D', '2D'])

Selector to see the cost data in a 2D plot.

plot1_2d_container = Instance(HPlotContainer)

1d or 2d view of cost data

cost_plot_data = Instance(ArrayPlotData)

Data for 2d plot

x_axis_param = Str

What parameter to see along x

y_axis_param = Str(ALL_COST_COL_NAME)

What parameter to see along y

color_axis_param = Str(ALL_COST_COL_NAME)

What parameter to see along color

colorbar = Instance(ColorBar)

2D visualization colorbar

colorbar_range = Property(Instance(DataRange1D), depends_on='cost_data')

Range of the color bar for the 2D visualization.

color_bar_max_percentile = Int(DEFAULT_PERCENT_LOW_COST_VALUES)

Percentile of max value on colorbar (for 2D vis only)

param_list = Property(List(Str))

List of parameters being scanned

trait_name_param_name_map = Dict

Mapping trait controlling value of a param -> param name

no_cost_data = Property(Bool)

Whether there is cost data to display

traits_view()[source]
rebuild_all()[source]
rebuild_renderer(container=None)[source]

Remove and rebuild all renderers of the cost data plot container.

rebuild_1d_renderer(container)[source]

Remove all renderers & view costs with a scatter plot.

rebuild_2d_renderer(container)[source]

Remove all renderers & view costs with a image plot.

remove_existing_renderers(container)[source]

Remove all existing renderers.

recompute_colorbar(plot)[source]

Create a colorbar for the image plot provided, and add to plot1_2d_container

pivot_filtered_data()[source]

Pivot the cost values into a 2d matrix with x_axis_name along x (columns) and y_axis_name changing along y (index)

reset_filtered_cost_data()[source]

Recompute the filtered cost data from the cost_data and the list of plotted parameters as opposed to not.

update_filtered_cost_data()[source]

A parameter that isn’t plotted has changed: modify the section of filtered_cost_data that will be plotted

update_plot_data()[source]
update_1D_cost_plot_data()[source]

Reset the arrays of the 1D ArrayPlotData based on new x and y axis choices.

update_2D_cost_plot_data()[source]
update_on_param_change()[source]
cost_data_changed()[source]

Optimizer cost data changed: update all ArrayPlotData entries.

update_colorbar_range()[source]
recompute_cost_data()[source]

kromatography.ui.ph_dependent_steric_mass_action_model_view module

class kromatography.ui.ph_dependent_steric_mass_action_model_view.PhDependentStericMassActionModelView(model=None, **metadata)[source]

Bases: kromatography.ui.steric_mass_action_model_view.StericMassActionModelView

View for the pH-dependent Steric Mass Action Model.

model = Instance(PhDependentStericMassAction)

SMA model to display

kromatography.ui.product_chooser_view module

class kromatography.ui.product_chooser_view.ProductChooser[source]

Bases: traits.has_traits.HasStrictTraits

Small modal UI to select a product from the ones contained in the provided Datasource.

traits_view()[source]

kromatography.ui.product_component_model_view module

class kromatography.ui.product_component_model_view.ProductComponentView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for ProductComponent model.

default_traits_view()[source]

kromatography.ui.product_model_view module

class kromatography.ui.product_model_view.ProductView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a Product

product_component_assays = List(ProductComponentAssay)

Proxy for product’s assays data since TableEditor works with Lists of objects.

default_traits_view()[source]
get_product_component_assays()[source]
update_model_product_component_assays()[source]

kromatography.ui.project_file_selector module

class kromatography.ui.project_file_selector.ProjectFileSelector[source]

Bases: traits.has_traits.HasStrictTraits

kromatography.ui.regular_parameter_list_selector module

class kromatography.ui.regular_parameter_list_selector.RegularParameterListSelector[source]

Bases: traits.has_traits.HasStrictTraits

Tool and UI to select a list of parameter scans.

Can be used to build a simulation group, an optimizer, or a select a list of scans to do in parallel.

center_sim = Instance(Simulation)

Target simulation that will be scanned. Used to set the list of scan-able parameters

param_names_to_ignore = Tuple

Parameters to remove from the list of options

allow_parallel_params = Bool

Include editor to set parallel parameters

num_values_fixed = Int

Value to fix the number of values for each scan if any.

parameter_scans = List(ParameterScanDescription)

List of parameters to scan

param_name_filter = Str

Filter the list of possible parameters to scan

allowed_parameters = Property(List(Str), depends_on= 'center_sim, param_name_filter, param_names_to_ignore')

List of parameter names that can be selected to be in parameter_scans

new_parameter_button = Button('New parameter scan')

Button to trigger the addition of a new parameter to scan

title = Str

Optional title if the component is drawn in its own window

traits_view()[source]

kromatography.ui.resin_model_view module

class kromatography.ui.resin_model_view.ResinView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a Resin model.

default_traits_view()[source]

kromatography.ui.simulation_builder module

class kromatography.ui.simulation_builder.SimulationBuilder[source]

Bases: traits.has_traits.HasStrictTraits

Base class to build a simulation from datasource or experiment.

simulation_name = Str('New Simulation')

Name of the future simulation

study_datasource = Instance(DataSource)

Target study datasource w/ custom objects (solutions, binding, ...)

first_simulated_step_name = Enum(values='step_names')

Name of the first simulated step

last_simulated_step_name = Enum(values='step_names')

Name of the last simulated step

step_names = Property(depends_on='method')

List of all the names of the steps in the source method

initial_buffer_name = Enum(values='all_buffers')

Name of the solution the resin was in at the start of the simulation

all_buffers = List

All buffers to pick from for the initial condition state:

initial_buffer = Property(depends_on='initial_buffer_name')

Solution that the resin is in at the start of the simulation

transport_model_name = Str

Name of the transport model to use in the simulation

transport_model = Property(depends_on='transport_model_name')

Instance of the TransportModel the output simulation should get

binding_model_name = Str

Name of the binding model to use in the simulation

binding_model = Property(depends_on='binding_model_name')

Instance of the BindingModel the output simulation should get

solver_type = Enum(SOLVER_TYPES)

Type of solver to create the simulation with

discretization_type = Enum(DISCRETIZATION_TYPES)

Type of discretization model to build the simulation from

kromatography.ui.simulation_from_datasource_builder module

class kromatography.ui.simulation_from_datasource_builder.SimulationFromDatasourceBuilder(**traits)[source]

Bases: kromatography.ui.simulation_builder.SimulationBuilder

Build a simulation from datasource components.

Class to support selecting all attributes to build a Simulation purely from both study and user datasource elements, as well as binding and transport models.

datasource = Instance(DataSource)

User Datasource to pull standard data from

product_name = Str

Product this simulation is for. Must be valid product name in dataSource

product = Property(depends_on='product_name')

Instance of the product the output simulation should get

column_name = Str

Name of the column to use in the simulation

column = Property(depends_on='column_name')

Instance of the column the output simulation should get

method_name = Str

Name of the source method to build the simulation’s method from

method = Property(depends_on='method_name')

Datasource method the output simulation’s method is built from

product_change_allowed = Bool(True)

Can the product be changed?

traits_view()[source]

Build the valid values for each parameters, and build the view.

to_simulation()[source]

Returns a new Simulation object from current builder.

kromatography.ui.simulation_from_experiment_builder module

UI to select a set of experiments, transport and binding models and build simulations from them.

class kromatography.ui.simulation_from_experiment_builder.SimulationGroupBuilderHandler[source]

Bases: traitsui.handler.Handler

Have the create button just close the window, like the OK button. The actual create will happen in the calling code.

class kromatography.ui.simulation_from_experiment_builder.SimulationFromExperimentBuilder(**traits)[source]

Bases: kromatography.ui.simulation_builder.SimulationBuilder

Build a list of simulations from experiments and models from datasource

Unlike its parent class, this builder is capable of building 1 or more simulations, and builds them from experiments selected as well as common parameters: binding model, transport model, first and last simulated steps, initial buffer, solver, discretization model.

The output simulation names are automatically generated from their source experiment, but avoiding collisions with existing simulations in the target study.

simulation_names = List(Str)

The list of target simulations to be created

experiment_selector = Instance(ExperimentSelector, ())

UI to select a list of Experiments

experiment_selected = DelegatesTo('experiment_selector')

List of experiments to create simulations from

target_study = Instance(Study)

Study and its datasource (with known sims, binding & transport models)

can_create = Property(Bool, depends_on='experiment_selected, transport_model, binding_model' )

Can an optimizer be created from the current setup?

traits_view()[source]
to_simulations()[source]

Returns a list of simulations built from each experiment selected.

update_simulation_names()[source]

Generate some default simulation names that don’t conflict with existing simulations in target study.

kromatography.ui.simulation_from_experiment_builder.generate_sim_names(expt_names, study)[source]

Generate a list of simulation names for experiment names provided which are not already present in the study’s existing simulations.

kromatography.ui.simulation_group_builder module

Classes and utilities to create a SimulationGroup around a center point simulation.

class kromatography.ui.simulation_group_builder.SimulationGroupBuilderHandler[source]

Bases: traitsui.handler.Handler

Have the create button just close the window, like the OK button. The actual create will happen in the calling code.

class kromatography.ui.simulation_group_builder.SimulationGroupBuilder(**traits)[source]

Bases: traits.has_traits.HasStrictTraits

Class to build a SimulationGroup around a Simulation object.

target_study = Instance(Study)

Study and its datasource (with known sims, binding & transport models)

group_name = Str(DEFAULT_NEW_GROUP_NAME)

Name of the future simulation group

group_type = Enum(GROUP_TYPES)

Type of simulation group to create

center_point_simulation_name = Enum(values='_sim_names')

Name of the source simulation (center_point_simulation)

param_klass = Property(depends_on='group_type')

Type of parameter descriptions based the group type (grid vs random)

param_name_filter = Str

Filter the list of possible parameters to scan

allowed_parameters = Property(List(Str), depends_on= 'center_point_simulation_name, param_name_filter')

List of parameter names that can be selected to be in parameter_scans

new_parameter_button = Button('New parameter scan')

Button to trigger the addition of a new parameter to scan

lazy_loading = Bool(True)

Store simulations on disk rather than in memory?

auto_delete_run_sims = Bool()

Delete simulation and CADET file once a simulation is run?

can_create = Property(Bool, depends_on='center_point_simulation, allowed_parameters')

Can an optimizer be created from the current setup?

center_point_simulation = Property(Instance(Simulation), depends_on='center_point_simulation_name')

Simulation to clone and modify to create all simulations in future group

parameter_scans = List(BaseParameterScanDescription)

List of parameters to scan

traits_view()[source]

Build the valid values for each parameters, and build the view.

build_group()[source]

Build the SimulationGroup.

kromatography.ui.simulation_group_model_view module

class kromatography.ui.simulation_group_model_view.SimulationGroupView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a SimulationGroup object.

model = Instance(SimulationGroup)

SimulationGroup to display

export_data_to_csv_button = Button('Export Data To CSV')

Button to export the data to CSV

analyze_button = Button('Analyze Data')

Button to open the DataFrame analyzer tool

run_button = Button('Run Simulation Group')

Button to launch a run of all simulations

traits_view()[source]
do_export_data(file_path)[source]
kromatography.ui.simulation_group_model_view.build_df_editor_grid_data(group_data, num_outputs)[source]

Build a dataframe editor for grid data.

kromatography.ui.simulation_selector module

class kromatography.ui.simulation_selector.BaseSimulationSelector[source]

Bases: traits.has_traits.HasStrictTraits

Base class to support selecting 1 or more simulations from a study.

study = Instance(Study)

Study containing the simulations to choose from

class kromatography.ui.simulation_selector.SimulationSelector[source]

Bases: kromatography.ui.simulation_selector.BaseSimulationSelector

Selector for a set of Simulations and SimulationGroups from a study.

Flexible title and description since it is used for multiple tools:

simulations_selected = List(Str)

List of simulation names selected

title = Str('Select Simulations')

Title of the window

description = Str('To select more than 1 simulation, press the Ctrl key:')

Text displayed above the simulation selector, to guide user:

default_traits_view()[source]
class kromatography.ui.simulation_selector.SingleSimulationSelector[source]

Bases: kromatography.ui.simulation_selector.BaseSimulationSelector

Class to support select a single simulation from a study.

simulation_selected = Str

List of simulation names selected

default_traits_view()[source]
class kromatography.ui.simulation_selector.SingleSimulationGroupSelector[source]

Bases: kromatography.ui.simulation_selector.BaseSimulationSelector

Class to support select a single SimulationGroup from a study.

default_traits_view()[source]
class kromatography.ui.simulation_selector.RanSimulationChooser[source]

Bases: kromatography.ui.simulation_selector.SingleSimulationSelector

Class to support select an already ran simulation from a study.

kromatography.ui.simulation_view module

class kromatography.ui.simulation_view.SimulationView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a Simulation object.

model = Instance(Simulation)

Simulation model to display

transport_model_view = Property(depends_on='model')

ModelView for the model’s transport model

binding_model_view = Property(depends_on='model')

ModelView for the model’s binding model

show_advanced_parameters = Button('Show Advanced Parameters')

Button to expose all remaining parameters of a simulation

simulation_details = Property(depends_on='model')

Container of the additional advanced simulation parameters

default_traits_view()[source]

kromatography.ui.solution_with_product_view module

class kromatography.ui.solution_with_product_view.SolutionWithProductView(model, **traits)[source]

Bases: traitsui.handler.ModelView

ModelView for a SolutionWithProduct.

This view proxies the model’s chemical component array, with a list of ChemicalComponent instances so that they can all be displayed in a table. Changes to the view automatically triggers an update to the model, but not the other way around, since nothing should be modifying the model, other than the view. The view can be updated by calling update_chemical_components() explicitly. The same holds for the the model’s product_assays, proxied by a list of ProductAssays.

Note that the strip fraction is displayed separately from the other assays values though these quantities are very similar, and stored together in the same UnitArray. That’s because the other components assay sum up to 100%, whereas the strip fraction is designed to be applying a global factor reducing the total amount of all other components.

model = Instance(SolutionWithProduct)

Model to display the data of:

product_assays = List(Instance(ProductAssay))

All regular component product assay, that is excluding the Strip if any:

default_traits_view()[source]
update_product_assays()[source]

Returns a list of ProductAssays for all comps but strip

It is constructed from the model’s assay data.

update_model_product_assays()[source]

Updates the model when traits in the ProductAssays change

update_chemical_components()[source]

Returns a list of ChemicalComponents, constructed from the model’s chemical_component data

update_model_chemical_components()[source]

Updates the model when traits in the ChemicalComponents change

kromatography.ui.solver_model_view module

class kromatography.ui.solver_model_view.SolverView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for Solver Parameters.

default_traits_view()[source]

kromatography.ui.steric_mass_action_model_view module

class kromatography.ui.steric_mass_action_model_view.StericMassActionModelView(model=None, **metadata)[source]

Bases: kromatography.ui.base_model_view_with_component_array.BaseModelViewWithComponentArray

View for the Steric Mass Action Model.

model = Instance(StericMassAction)

SMA model to display

param_formula_str = Str

Explanations for the component parameter table (if any)

default_traits_view()[source]

kromatography.ui.strip_fraction_calculator_view module

Assistant to display and override Experiments’ strip fractions.

class kromatography.ui.strip_fraction_calculator_view.StripFractionCalculatorHandler[source]

Bases: traitsui.handler.Handler

Controller for the StripFractionCalculatorEditor, controlling the custom buttons.

do_apply(info)[source]
do_reset(info)[source]
close(info, is_ok, skip_reset=False)[source]

Closing the window or Cancel button requested. Reset the model.

class kromatography.ui.strip_fraction_calculator_view.StripFractionCalculatorView[source]

Bases: traits.has_traits.HasStrictTraits

Editor for interactive computation of the strip fraction in experiment.

default_traits_view()[source]

kromatography.ui.study_model_view module

class kromatography.ui.study_model_view.StudyView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a (modeling) Study model.

model = Instance(Study)

Model this view is about

product_name = Property(depends_on='model.product.name')

Name of the product the model is about

new_study_button = Button(NEW_BLANK_PROJECT_MENU_NAME)

Button to create a new study from scratch on welcome screen

load_study_from_exp_button = Button(NEW_PROJECT_FROM_EXPERIMENT_MENU_NAME)

Button to load a new study on welcome screen

open_project_button = Button(OPEN_PROJECT_MENU_NAME)

Button to load an existing project

default_traits_view()[source]

kromatography.ui.system_model_view module

class kromatography.ui.system_model_view.SystemView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a System model.

model = Instance(System)

Model being edited

datasource = Instance(DataSource)

Multi-study datasource

default_traits_view()[source]
class kromatography.ui.system_model_view.SystemTypeSelector[source]

Bases: traits.has_traits.HasStrictTraits

Utility view to select a SystemType among the existing ones.

datasource = Instance(DataSource)

Multi-study datasource to find all available system types

system_type_name = Str

Selected system type name

selected_system_type = Property(Instance(SystemType), depends_on='system_type_name')

Selected system type

default_traits_view()[source]

kromatography.ui.system_type_model_view module

View for a SystemType.

class kromatography.ui.system_type_model_view.SystemTypeView(model=None, **metadata)[source]

Bases: traitsui.handler.ModelView

View for a SystemTypeView

default_traits_view()[source]