TNO Intern

Commit a6f27e11 authored by Hen Brett's avatar Hen Brett 🐔
Browse files

moving files adding extra benchmark files

parent fad64165
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ from jpype import JClass

from pythermogis.physics.temperature_grid_calculation import calculate_temperature_from_gradient
from pythermogis.statistics.calculate_pvalues import generate_thickness_permeability_transmissivity_for_pvalue
from pythermogis.thermogis_classes.java_start import start_jvm
from pythermogis.thermogis_classes.java_start import start_jvm, close_jvm


def calculate_performance_of_single_location(hydrocarbons: float, depth: float, thickness: float, porosity: float, ntg: float, temperature: float, transmissivity: float, transmissivity_with_ntg: float, doublet=None,
@@ -179,6 +179,9 @@ def calculate_performance_across_dimensions(input_data: xr.Dataset,
        flow_rate_data.append(output_data_arrays[10])
        welld_data.append(output_data_arrays[11])

    # close the jvm
    close_jvm()

    output_data["power"] = (output_data.coords, power_data)
    output_data["heat_pump_power"] = (output_data.coords, heat_pump_power_data)
    output_data["capex"] = (output_data.coords, capex_data)
+9 −0
Original line number Diff line number Diff line
@@ -25,6 +25,15 @@ def start_jvm():
    if not jpype.isJVMStarted():
        jpype.startJVM(get_jvm_path(), classpath=[get_thermogis_jar_path()])

def close_jvm():
    """
    To use the JPype package a java .jar file has to be instantiated with a java virtual machine (jvm)
    This method ensures a clean startup of the jvm packaged with this repo
    :return:
    """
    if jpype.isJVMStarted():
        jpype.shutdownJVM()


if __name__ == "__main__":
    start_jvm()
 No newline at end of file
(2.31 KiB)

File moved.

(2.31 KiB)

File changed and moved.

No diff preview for this file type.

(2.31 KiB)

File moved.

Loading