TNO Intern

Commit 7c0ce179 authored by Hen Brett's avatar Hen Brett 🐔
Browse files

Using a JCLASS utcproperties instance instead of a python dictionary to handle...

Using a JCLASS utcproperties instance instead of a python dictionary to handle the properties of the simulation
parent 1c1db822
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ from jpype import JClass
from pythermogis.physics.temperature_grid_calculation import calculate_temperature_from_gradient
from pythermogis.statistics.calculate_thick_perm_trans import generate_thickness_permeability_transmissivity_for_pvalues
from pythermogis.thermogis_classes.jvm_start import start_jvm
from pythermogis.thermogis_classes.utc_properties import instantiate_utc_properties


def calculate_doublet_performance(input_data: xr.Dataset,
@@ -195,25 +196,6 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes
        "cophp"], output_values["pres"], output_values["flow_rate"], output_values["welld"]


def instantiate_utc_properties_builder() -> JClass:
    """
    The UTCPropertiesBuilder is a java class which builds the utc_properties instance; the builder itself can be used to parse scenario xml files or to change specific parameters to the scenario you wish to simulate
    :return: (JClass, UTCPropertiesBuilder) utc_properties_builder
    """
    start_jvm()
    return JClass("thermogis.properties.builders.UTCPropertiesBuilder")()

def instantiate_utc_properties() -> JClass:
    """
    Start the JVM (if necessary) and return a baseCase UTC properties instance by instantiating the UTC Properties Builder and building
    :return:  (JClass, UTCProperties) utc_properties
    """
    utc_properties_builder = instantiate_utc_properties_builder()

    utc_properties = utc_properties_builder.build()

    return utc_properties

def instantiate_thermogis_doublet(utc_properties, rng_seed = None) -> JClass:
    """
    Instantiate a ThermoGIS Doublet class, with a set random seed if provided
+23 −0
Original line number Diff line number Diff line
from pythermogis.thermogis_classes.jvm_start import start_jvm
from jpype import JClass

def instantiate_utc_properties_from_xml() ->

def instantiate_utc_properties_builder() -> JClass:
    """
    The UTCPropertiesBuilder is a java class which builds the utc_properties instance; the builder itself can be used to parse scenario xml files or to change specific parameters to the scenario you wish to simulate
    :return: (JClass, UTCPropertiesBuilder) utc_properties_builder
    """
    start_jvm()
    return JClass("thermogis.properties.builders.UTCPropertiesBuilder")()

def instantiate_utc_properties() -> JClass:
    """
    Start the JVM (if necessary) and return a baseCase UTC properties instance by instantiating the UTC Properties Builder and building
    :return:  (JClass, UTCProperties) utc_properties
    """
    utc_properties_builder = instantiate_utc_properties_builder()

    utc_properties = utc_properties_builder.build()

    return utc_properties
 No newline at end of file