Model Properties

Model-level UI/calculation flags and import defaults attached to a ConfigurationBuilder via set_model_property().

ModelProperty — model-level UI/calculation flags and import options.

class ModelProperty(calculate_on_load=False, calculation_enabled=True, ignore_formula=False, import_options=None, overlay_config=None)[source]

Model-level UI and calculation flags.

Parameters:
  • calculate_on_load (bool) – Run formulas immediately after a model loads.

  • calculation_enabled (bool) – Master toggle for all formula calculations.

  • ignore_formula (bool) – Skip formulas during evaluation (data passes through untransformed).

  • import_options (ModelImportOptions | None) – Default ModelImportOptions applied to imports.

  • overlay_config (OverlayConfig | None) – OverlayConfig controlling solver-result overlays.

ModelImportOptions — model-level import defaults.

class ModelImportOptions[source]

Default import behaviour applied to every data source on the model.

Construct with default flags, then customise via the chained set_* methods.

set_match_column_count(match_column_count)[source]

Reject imports whose column count differs from the target.

Return type:

ModelImportOptions

set_expected_column_count(expected_column_count)[source]

Set the column count enforced when match_column_count is True.

Return type:

ModelImportOptions

set_match_column_headers(match_column_headers)[source]

Reject imports whose column headers differ from the target.

Return type:

ModelImportOptions

set_preserve_ordering(preserve_ordering)[source]

Preserve source row order in the target.

Return type:

ModelImportOptions

set_match_existing_rows(match_existing_rows)[source]

Match incoming rows against existing rows by key_column.

Return type:

ModelImportOptions

set_clear_sheet(clear_sheet)[source]

Clear the sheet before writing imported rows.

Return type:

ModelImportOptions

set_reset_decisions(reset_decisions)[source]

Reset decision-variable values on matched rows.

Return type:

ModelImportOptions

set_close_on_success(close_on_success)[source]

Auto-close the import dialog on successful import.

Return type:

ModelImportOptions

set_skip_pre_processors(skip_pre_processors)[source]

Skip configured pre-processors during import.

Return type:

ModelImportOptions

set_key_column(key_column)[source]

Set the column used to match incoming rows against existing ones.

Return type:

ModelImportOptions

set_locale_key(locale_key)[source]

Set the locale used to parse incoming numbers, dates, and currency.

Return type:

ModelImportOptions

set_sync_key(sync_key)[source]

Set the per-user synchronisation key used by generate_sync_key().

Return type:

ModelImportOptions

get_sync_key()[source]

Return the sync key, or an empty string if unset or whitespace.

Return type:

str

generate_sync_key(user)[source]

Build a per-user sync key in the form "<user_id>/<sync_key>".

Parameters:

user – Object exposing an id attribute.

Return type:

str

OverlayConfig — toggles for spreadsheet result overlays.

class OverlayConfig(show_decision_overlay=False, show_lock_overlay=False, show_objective_overlay=False, show_constraint_overlay=False)[source]

Toggles for spreadsheet overlays that surface solver state in the UI.

Parameters:
  • show_decision_overlay (bool) – Highlight cells driven by decision variables.

  • show_lock_overlay (bool) – Highlight cells locked at their seed value.

  • show_objective_overlay (bool) – Highlight cells contributing to objectives.

  • show_constraint_overlay (bool) – Highlight cells contributing to constraints.