Skip to content

Commit

Permalink
fix: fixed max ordinate in lagroute
Browse files Browse the repository at this point in the history
  • Loading branch information
jlerat committed Feb 1, 2024
1 parent 7227887 commit 545f2a9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pygme/models/lagroute.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd

from hydrodiy.data.containers import Vector
from pygme.model import Model, ParamsVector
from pygme.model import Model, ParamsVector, NORDMAXMAX
from pygme.calibration import Calibration, CalibParamsVector, ObjFunBCSSE

from pygme import has_c_module
Expand Down Expand Up @@ -49,7 +49,10 @@ def compute_delta(params):
# Compute Lag = alpha * U * L / dt
delta = config.length * params.U * params.alpha
delta /= config.timestep
delta = np.float64(delta)

# Set maximum for delta based on maximum
# number of uh ordinates
delta = min(NORDMAXMAX-2, np.float64(delta))

if np.isnan(delta):
raise ValueError("Expected non nan value for delta. "+\
Expand All @@ -71,8 +74,7 @@ def compute_delta(params):
noutputsmax=4)

self.inputs_names = ["Inflow"]
self.outputs_names = ["Q", "Q1lag", \
"VR", "V1"]
self.outputs_names = ["Q", "Q1lag", "VR", "V1"]


def run(self):
Expand Down Expand Up @@ -111,7 +113,7 @@ def __init__(self, objfun=ObjFunBCSSE(0.5), \

cp = Vector(["tU", "talpha"], \
mins=params.mins,
maxs=params.maxs,
maxs=params.maxs, \
defaults=params.defaults)

# no parameter transformation
Expand Down

0 comments on commit 545f2a9

Please sign in to comment.