test_retentionPolicy

Regression tests for Monte Carlo variable retention.

class test_retentionPolicy.RetainedVariableModel(*args, **kwargs)[source]

Bases: SysModel

Provide deterministic module variables for retention tests.

getGetterValue()[source]

Return a value exposed through the standard getter convention.

test_retentionPolicy.createVariableSimulation(modelTag='retainedModel', modelPriority=-1, firstStart=0)[source]

Create a short simulation containing one retained-variable model.

test_retentionPolicy.executeSimulation(simulation)[source]

Initialize and execute a configured test simulation.

test_retentionPolicy.retainComputedVariable(simulation)[source]

Return a computed logger value in the standard time-column format.

test_retentionPolicy.test_compatible_duplicate_variable_requests_share_logger()[source]

Verify identical requests across policies use one scheduled logger.

test_retentionPolicy.test_conflicting_duplicate_variable_requests_fail()[source]

Verify conflicting settings fail before any logger is scheduled.

test_retentionPolicy.test_custom_variable_logger_retention()[source]

Verify the documented fallback retains a computed variable history.

test_retentionPolicy.test_variable_logger_is_added_only_to_owning_task()[source]

Verify model-tag lookup schedules a logger on the matching task.

test_retentionPolicy.test_variable_logger_runs_after_negative_priority_model()[source]

Verify retained values are sampled after a low-priority model update.

test_retentionPolicy.test_variable_retention_handles_no_samples()[source]

Verify a logger whose task never runs returns an empty time-column array.

test_retentionPolicy.test_variable_retention_handles_zero_component_value()[source]

Verify sampled empty arrays retain their time column without failing.

test_retentionPolicy.test_variable_retention_honors_deprecated_component_range()[source]

Verify legacy inclusive slicing works during its deprecation period.

test_retentionPolicy.test_variable_retention_records_complete_values()[source]

Verify complete scalar, vector, and matrix values include time.

test_retentionPolicy.test_variable_retention_rejects_duplicate_model_tags()[source]

Verify a variable identifier resolves to exactly one scheduled model.

test_retentionPolicy.test_variable_retention_rejects_invalid_component_range(startIndex, stopIndex, errorType)[source]

Verify deprecated component ranges are valid inclusive indices.

test_retentionPolicy.test_variable_retention_rejects_invalid_identifier_syntax()[source]

Verify invalid identifiers fail before a Monte Carlo run starts.

test_retentionPolicy.test_variable_retention_rejects_invalid_log_rate(logRate, errorType)[source]

Verify recording periods are nonnegative integer nanoseconds.

test_retentionPolicy.test_variable_retention_rejects_nested_variable()[source]

Verify dotted paths below a matching model tag are rejected clearly.

test_retentionPolicy.test_variable_retention_rejects_unavailable_model_or_variable(variableName, errorMatch)[source]

Verify unavailable models and variables fail with actionable errors.

test_retentionPolicy.test_variable_retention_supports_dotted_model_tag()[source]

Verify the last period separates a dotted model tag from its variable.