Skip to content

[Code scan] Short Simpson HTI ranges swap statistical and integration errors #129

Open

Description

@njzjz

Source: Codex global repository scan of deepmodeling/dpti at commit b719828.
Project: DeepModeling Agent Code Scan

Problem
integrate_range_simpson() normally returns (x, integral, integration_error, statistical_error), and the long-range branch follows that order. However, the len(xx) < 5 branch returns (x, integral, stat_err, zeros). integrate_range_hti() then reads the returned values as i_e and s_e, so short Simpson ranges can report zero statistical error and put propagated statistical error in the systematic/integration-error slot.

Code references

def integrate_range_simpson(xx, yy, ye):

if len(xx) < 5:

return xx0, inte0, inte_err0, stat_err0

def integrate_range_hti(all_lambda, de, de_err, scheme='s'):

diff_e = i[-1]

Reproduction
Use three lambda points with nonzero de_err and call integrate_range_hti(..., scheme='s'). The reported statistical error should be nonzero, but the current short-range branch returns it through sys_err while stt_err becomes zero.

Expected result
The short-range branch should preserve the same return order as the long-range branch.

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions