Skip to content

Commit

Permalink
test: added test for max ordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
jlerat committed Feb 1, 2024
1 parent 545f2a9 commit da53e82
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/test_pygme_lagroute.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import matplotlib.pyplot as plt

from pygme.models.lagroute import LagRoute, CalibrationLagRoute
from pygme.models.lagroute import LagRoute, CalibrationLagRoute, NORDMAXMAX
from pygme.calibration import Calibration, CalibParamsVector, ObjFunSSE


Expand Down Expand Up @@ -96,6 +96,18 @@ def test_uh2():
assert ck


def test_max_invv():
lr = LagRoute()
# Test if maximum uh length can be set
length, timestep = 100e3, 3600 # 100km / 1hr
lr.config.length = length
lr.config.timestep = timestep

# Umax = NORDMAXMAX/length*timestep
lr.alpha = 1.
# .. creates an error if the max ordinate is not controlled
lr.U = (NORDMAXMAX+1)/length*timestep


def test_massbalance():

Expand All @@ -114,8 +126,8 @@ def test_massbalance():
# Set outputs
lr.allocate(inputs, 4)

print("")
for theta2 in [1, 2]:

lr.config.storage_expon = theta2

# Run
Expand Down Expand Up @@ -152,6 +164,7 @@ def test_massbalance():
' = {1:.5f} ms/yr').format( \
theta2, dta))


def test_lagroute_lag():
''' Test lagroute with pure lag '''
nval = 1000
Expand Down

0 comments on commit da53e82

Please sign in to comment.