Skip to content

setcurve not correctly wrapped #57

Closed

Activity

  1. samhatchett commented on Feb 10, 2020

    @samhatchett
    MemberAuthor

    the fix is in this commit: b552db1

    ... to use the function, follow the test as an example:

    def test_setcurve():
        def make_array(values):
            dbl_arr = en.doubleArray(len(values))
            for i in range(len(values)):
                dbl_arr[i] = values[i]
            return dbl_arr
    
    
        epanet_proj = en.createproject()
        en.open(ph=epanet_proj, inpFile=example_1_path, rptFile='report.rpt', outFile='output.out')
        ok = en.addcurve(ph=epanet_proj, id="my_curve")
        curve_index = en.getcurveindex(ph=epanet_proj, id="my_curve")
        xvalues = make_array([1,2,3,4,5])
        yvalues = make_array([1,2,3,4,5])
        en.setcurve(ph=epanet_proj, index=curve_index, xValues=xvalues, yValues=yvalues, nPoints=5)
        count = en.getcurvelen(ph=epanet_proj, index=curve_index)
        assert count == 5
    
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