TNO Intern

Commit 137dcd6a authored by Hen Brett's avatar Hen Brett 🐔
Browse files

Updating the README.md

parent 7a273002
Loading
Loading
Loading
Loading
+74 −2
Original line number Diff line number Diff line
# PyThermoGIS
# pyThermoGIS

This is a python API to the ThermoGIS Java code calculations
pyThermoGIS is a Python package that provides API access to the ThermoGIS Geothermal simulation (https://www.thermogis.nl/en). The simulations are conducted in java and this code uses the JPype package as a python-java
binding.

It uses xarray (https://docs.xarray.dev/en/stable/index.html) Datasets as input to the simulation and can be combined with the pygridsio package (https://pypi.org/project/pygridsio/) to read in and process 2D rasters
   
### Install via pip from GitLab

To install `pyThermoGIS` into your own project directly from GitLab, run:

```sh
pip install git+https://gitlab.com/your-repo/pythermogis.git
```

This will fetch the latest version from the public GitLab repository.

## Usage

Here’s a simple example demonstrating how to use `pyThermoGIS` for a single set of input values:

```python
from pythermogis.pythermogis import calculate_doublet_performance
import xarray as xr

# Initialize an input Dataset with the required input variables:
input_data = xr.Dataset({
         "thickness_mean": ((), 300),
         "thickness_sd": ((), 50),
         "ntg": ((), 0.5),
         "porosity": ((), 0.5),
         "depth": ((), 5000),
         "ln_permeability_mean": ((), 5),
         "ln_permeability_sd": ((), 0.5),
     })

# Simulate a Geothermal doublet using the ThermoGIS methodology
doublet_simulation_results = calculate_doublet_performance(input_data)

# Display results
print(doublet_simulation_results)
```

## Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

## License

This project is licensed under the MIT License. See `LICENSE` for details.


## Installation for further development

### Install from Source with Pixi for further Development

To install `pyThermoGIS` from source using Pixi, follow these steps:

1. Clone the repository:
   ```sh
   git clone https://gitlab.com/your-repo/pythermogis.git
   cd pythermogis
   ```
2. Ensure Pixi is installed:
   ```sh
   curl -sSL https://pixi.sh/install.sh | bash
   ```
3. Install dependencies and create an isolated environment:
   ```sh
   pixi install
   ```
4. Activate the environment:
   ```sh
   pixi run python
   ```
+12 −4
Original line number Diff line number Diff line
from pythermogis.thermogis_classes.doublet import calculate_doublet_performance
from typing import List

from pythermogis.thermogis_classes.doublet import calculate_doublet_performance_across_dimensions
import xarray as xr

def calculate_doublet_performance(input_data):
    """Testing API"""
    return calculate_doublet_performance(input_data)

def calculate_doublet_performance(input_data: xr.Dataset,
                                  input_params: dict = None,
                                  rng_seed: int = None,
                                  p_values: List[float] = None) -> xr.Dataset:
    """
    An access point to the calculate_doublet_performance_across_dimensions function in pythermogis.thermogis_classes.doublet, see that method for more detailed instruction
    """
    return calculate_doublet_performance_across_dimensions(input_data, input_params=input_params, rng_seed=rng_seed, p_values=p_values)
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes
        "cophp"], output_values["pres"], output_values["flow_rate"], output_values["welld"]


def calculate_doublet_performance(input_data: xr.Dataset,
def calculate_doublet_performance_across_dimensions(input_data: xr.Dataset,
                                  input_params: dict =None,
                                  rng_seed: int =None,
                                  p_values: List[float] =None) -> xr.Dataset: