Skip to content

Fault-position queries fail when no fault traces were recorded #74

Description

@sylvesterkaczmarek

Reproduction

History({'s.x': [1., 2.], 'time': [10., 20.]}).get_fault_time('earliest') raises ValueError: Calling nonzero on 0d arrays is not allowed on current dev at a7f4c3e866d57d6020e83c24d376d8858ac155c5.

latest and times fail in the same way. The empty reduction is scalar zero, which NumPy rejects in np.where. total already returns zero. This also occurs for an empty history and an actual simulation history configured to record state variables only.

Expected behavior

Use the existing no-recorded-fault result (nan) for the position metrics, consistently with an all-false recorded trace. Preserve zero for total, index-based positions, nested histories and unchanged inputs.

The result describes recorded history only. Without fault tracking it does not establish whether the model experienced a fault. Regression controls should verify that recorded fault positions remain unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions