DHI / mikepluspy

MIKE+Py is the official python interface for MIKE+
Apache License 2.0
7 stars 1 forks source link

Some field names in the sqlite database have Nullable types that's awkward to handle in Python #20

Closed ryan-kipawa closed 4 months ago

ryan-kipawa commented 8 months ago

Here's an example of the issue: https://github.com/DHI/mikepluspy/blob/891dfbec466b20ec3267a68232a0464766bdd9f2/notebooks/run_multiple_rainfall_events.ipynb#L200-L202 The preferred syntax would be for python integers to work, without needing to wrap them in System.Nullable.

ecomodeller commented 6 months ago

Isn't that the job of this library. The user supplies a value, either an int or None, and mikepluspy translates it to a .NET nullable int if if goes through a .NET DAL?

ryan-kipawa commented 6 months ago

Hi @ecomodeller, yes it should be. Users should not have to wrap python integers in .NET objects - that should happen automatically. This issue shows that is not happening and it is something we should fix.

PanDan0620 commented 6 months ago

Verify pass with MIKE+ Development branch 2004.03.29. Now we can modify the test script: " VariationNo = 3, # set temporal variation to timeseries\n", " FlowTypeNo = 5, # set boundary condition type to Rainfall\n", " LoadTypeNo = 1, # set load type to stormwater runoff\n",