Skip to content

Xsection models - check for correct length of z array #103

@MattBrst

Description

@MattBrst

In Xsection, when I change the topboundary from confined to semi, the error message is not very informative (IndexError: index 0 is out of bounds for axis 0 with size 0). What goes wrong is that I need to add a z-value to the array.

I think that we created a check for this in the transient model in mbakker7/ttim#119, but it seems not to have landed in the steady part yet.

Code to reproduce:

import numpy as np
import timflow.steady as tfs

ml = tfs.ModelXsection(naq=1)
tfs.XsectionMaq(
    ml,
    x1=-np.inf,
    x2=0,
    kaq=10,
    z=[1, 0],
    topboundary="semi",
    c=100,
    hstar=3
)
tfs.XsectionMaq(
    ml,
    x1=0,
    x2=np.inf,
    kaq=10,
    z=[1, 0],
)


ml.solve()

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