TNO Intern

Commit 484bf07c authored by Hen Brett's avatar Hen Brett 🐔
Browse files

Adding a test for the kestin viscosity calculation

parent 2f012d57
Loading
Loading
Loading
Loading
−86.6 KiB
Loading image diff...
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ class PyThermoGIS(TestCase):
        #
        #   Plotting
        #
        plot = True
        plot = False
        if plot:
            # Plot the transmissivity as a function of pvalue for both the python and Java implementation
            fig, axes = plt.subplots(1, 4, figsize=(20, 10))
+7 −2
Original line number Diff line number Diff line
from os import path
from pathlib import Path
from unittest import TestCase
import xarray as xr

from pythermogis import *

@@ -25,6 +23,13 @@ class UTCBuilder(TestCase):
        # If test reaches here, then parsing of xml's worked, check that the scenarios actually run on a set of test data:
        [self.run_scenario(utc_property) for utc_property in utc_properties]

    def test_set_useKestinViscosity(self):
        """
        An earlier version of the ThermoGIS java code didn't allow the setting of the viscosity mode by parsing the properties; this has been added from v1.7 (of the Java code) onwards
        """

        utc_properties =  instantiate_utc_properties_builder().setUseKestinViscosity(True).build()
        self.run_scenario(utc_properties)

    def run_scenario(self, utc_properties):
        input_data = xr.Dataset({