TNO Intern

Commit 3789dd8f authored by Florian Knappers's avatar Florian Knappers
Browse files

Update after java gui refactor

parent a93c0b60
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
# Change log

## v2.0.0 (27-2-2026)
After an essential rewrite of the java code, parts of the API of pythermoGIS had to be updated. Since these were breaking, non-backward compatible, changes, a version 2.0.0 is released. 
The most important and noticible change is that the method of setting up the input parameters has changed. Please check out the customized properties page for 

## v1.2.5 (26-1-2026)
A java 17 virtual machine is now automatically installed the first time a pythermogis simulation is run. This uses the [install-jdk](https://pypi.org/project/install-jdk/) python project.

+1 −1
Original line number Diff line number Diff line
# API Reference

::: pythermogis.thermogis_classes.utc_properties
 No newline at end of file
::: pythermogis.thermogis_classes.properties
 No newline at end of file
+14 −11
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
To adjust properties of the simulation, you can pass a `utc_properties` instance 
to the calculate_doublet_performance function.
A `utc_properties` instance is a JClass implementation of the Java UTCProperties class. 
It is generated by using the `utc_properties_builder`, upon which custom properties can be set, 
It is generated by using the `thermogis_properties`, upon which custom properties can be set for all calculations in ThermoGIS, 
and used to build an instance of the `utc_properties`.

be aware: The number of parameters is large, and the default values are set to the ThermoGIS base case. 
@@ -11,8 +11,8 @@ A comprehensive list of parameters is given in [UTC properties](../theory/utcpr

There are two ways to set the properties of the simulation, by either:

1. Using the `utc_properties_builder` class to set the properties of the simulation, and then building the `utc_properties` instance.
2. Using the `instantiate_utc_properties_from_xml` function to parse a configuration file, which will return a `utc_properties` instance.
1. Using the `instantiate_thermogis_parameters` class to set the properties of the simulation, and then using the `setupUTCParameters` method.
2. Using the `instantiate_thermogis_properties_from_file` function to parse a configuration file, which will return a `thermogis_properties` method.


!!! info "customizing the thermoGIS techno-economic properties"
@@ -28,18 +28,18 @@ There are two ways to set the properties of the simulation, by either:

Common properties to change include:

- `setUseHeatPump(Boolean)`: if true, include a heat-pump when modelling
- `setUseStimulation(Boolean)`: if true, apply reservoir stimulation when simulating a doublet
- `setUseHeatpump(Boolean)`: if true, include a heat-pump when modelling
- `setUseWellStimulation(Boolean)`: if true, apply reservoir stimulation when simulating a doublet
- `setSurfaceTemperature(float)`: The temperature of the surface
- `setTempGradient(float)`: The gradient at which temperature increases with depth, in C/km
- `setDhReturnTemp(float)`: The goal of the direct heat return temperature
- `setStimKhMax(float)`: The maximum transmissivity above which no stimulation will occur (if UseStimulation = True)

Here is an example, where the default utc_properties is used, but the UseHeatPump option is set to True. this is achievied by instantiating a `utc_properties_builder` class, running `.useHeatPump(True)` on that class, and then building the 
`utc_properties` themselves, with the `.build()` method of the `utc_properties_builder`.
Here is an example, where the default utc_properties is used, but the UseHeatpump option is set to True. this is achievied by instantiating a `thermogis_properties` class, running `.useHeatpump(True)` on that class, and then building the 
`utc_properties` themselves, with the `.setupUTCParameters()` method of the `thermogis_properties`.

```python
from pythermogis import calculate_doublet_performance, instantiate_utc_properties_builder
from pythermogis import calculate_doublet_performance, instantiate_thermogis_parameters
import xarray as xr

input_data = xr.Dataset({
@@ -50,7 +50,9 @@ input_data = xr.Dataset({
    "permeability": 300,
})

utc_properties = instantiate_utc_properties_builder().setUseHeatPump(True).build()
tg_parameters = instantiate_thermogis_parameters()
tg_parameters.setUseHeatpump(True)
utc_properties = tg_parameters.setupUTCParameters()
results = calculate_doublet_performance(input_data, utc_properties=utc_properties)
print(results)
```
@@ -65,7 +67,7 @@ The vast majority of the parameters in the xml are not used by this python API;
unfortunately they are still needed in the xml file to enable parsing.

```python
from src.pythermogis import calculate_doublet_performance_stochastic, instantiate_utc_properties_from_xml
from src.pythermogis import calculate_doublet_performance_stochastic, instantiate_thermogis_properties_from_file
import xarray as xr

input_data = xr.Dataset({
@@ -78,7 +80,8 @@ input_data = xr.Dataset({
    "ln_permeability_sd": 0.5,
})

utc_properties = instantiate_utc_properties_from_xml("path/to/valid/xml/file")
tg_properties = instantiate_thermogis_properties_from_file("path/to/valid/xml/file")
utc_properties = tg_properties.setupUTCParameters()
results = calculate_doublet_performance_stochastic(input_data, utc_properties=utc_properties)
print(results)
```
+2 −2
Original line number Diff line number Diff line
@@ -4933,8 +4933,8 @@ packages:
  timestamp: 1740946648058
- pypi: ./
  name: pythermogis
  version: 1.2.4
  sha256: 4406d3c4da3a9e6ee46a39b7ce7b61063e676db495638f1f9d992ac174589913
  version: 1.2.5
  sha256: f7faf166eaa5141f37e7e96c2fc7f2c01cf26da4be5fc5164aa0c8c784614e2b
  requires_dist:
  - jpype1>=1.5.2,<2
  - xarray==2024.9.0.*
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pythermogis"
version = "1.2.5"
version = "2.0.0"
description = "This repository is used as a python API for the ThermoGIS Doublet simulations"
authors = [
    { name = "Hen Brett", email = "hen.brett@tno.nl" },
Loading