Skip to content

Fix inefficient spatial covariance calculation and parameter mapping in uncertainty SA #3964

@man080107

Description

@man080107

There are two bugs in the codebase:

  1. modules/emulator/R/calcSpatialCov.matrix.R: The calcSpatialCov.matrix function contains a redundant inner loop for (j in seq_len(nl)) which recalculates and assigns the same vector to a matrix row nl times, turning a vectorized element-wise operation into an $O(n^3)$ bottleneck.
    1. modules/uncertainty/R/sensitivity.R: In write.sa.configs (around line 470), do.call is invoked with an unnamed argument for run.id inside the args list. This positional mapping is brittle and can lead to bugs if the target function signature changes. It should explicitly use run.id = run.id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions