TNO Intern

Commit 463ec8e9 authored by Hen Brett's avatar Hen Brett 🐔
Browse files

Resolve "trial use of install-jdk"

parent 606f8cb3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,3 +10,4 @@ dist

tests/resources/test_output

/src/pythermogis/jvm/JVM17
 No newline at end of file
+1 −3
Original line number Diff line number Diff line
@@ -12,9 +12,7 @@ Run tests:
    - export TZ=Europe/Amsterdam
    - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
    - apt-get update
    - apt-get install -y build-essential gcc tk openjdk-17-jdk
    - export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
    - export PATH=$JAVA_HOME/bin:$PATH
    - apt-get install -y build-essential gcc tk
    - pixi install
    - pixi run pytest -rx tests/
    - rm -rf /var/lib/apt/lists/*
+9 −25
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

Read the full documenation [here](https://pythermogis-15909e.ci.tno.nl/).

If you wish to build the documentation locally, follow the installation steps and run:
If you wish to build the documentation locally, follow the installation from source step and run:

```bash
pixi run mkdocs serve
@@ -15,33 +15,18 @@ pixi run mkdocs serve
# Installation

pythermogis has been designed to be used as a python package you import into your own python projects.
It works by creating a python API access to the ThermoGIS techno-economic application, which is written in Java. 
Because of this dependency you need to Install a Java 17 VM.
It works by creating a python API access to the Core ThermoGIS techno-economic application, which is written in Java. 

### 1. Install Java 17
The ThermoGIS techno-economic Core application is packaged within pythermogis, this is the reason the package is quite large (~150mb).
Additionally the first time you run a simulation with pythermogis, a Java 17 Virtual machine (JVM) will be automatically installed (using the package [install-jdk](https://pypi.org/project/install-jdk/)).

This package requires a Java 17 VM (we recommend using [Amazon Corretto 17](https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/downloads-list.html)).
The Java 17 virtual machine is an additional ~350mb so there should be at least 500mb of space on any machine you install pythermogis on (and preferably more).

*(You can find the JAR in this repository's resources folder: /resources/thermogis_jar)*
Installation of the JVM can take some time (0.5 - 2 minutes) depending on the speed of your internet connection, but will only be done once per pythermogis installation.

### 2. Ensure JAVA_HOME is set
pythermogis has been tested on Windows and Linux operating systems.

When installing the Java 17 Virtual Machine (JVM), a global environment variable _should_ have been set: `JAVA_HOME`. This stores the path to the JVM that was installed in step 1 and enables pythermogis to read the core Java code.

If, for some reason, this was not done during installation you can either set it yourself or create a ``.env`` file in your project root folder. 

This `.env` file should contain the following variable:

- `JAVA_HOME`: Path to the Java 17 installation
  *(e.g., on Windows: `C:\Program Files\Amazon Corretto\jdk17.0.0_0`)*


Example `.env` contents (The specific path could be different depending on your OS, or file architecture):
```
JAVA_HOME = C:\Program Files \Amazon Corretto\jdk17.0.0_0
```

### 3. Import pythermogis into your own python projects
### 1. Import pythermogis into your own python projects

You can use pip to install the package directly from the gitlab project:
```
@@ -58,7 +43,7 @@ If you are using uv as your dependency manager:
uv add pythermogis --default-index https://ci.tno.nl/gitlab/api/v4/projects/18271/packages/pypi/simple
```

### Installation from source
### 2. Installation from source

Clone and install from source with Pixi:

@@ -67,7 +52,6 @@ git clone git@ci.tno.nl:ags_public/pythermogis.git
cd pythermogis
pixi install
```
(Make sure you have followed step 1 and 2: installing a Java 17 VM)

---

+3 −0
Original line number Diff line number Diff line
# Change log

## 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.

## v1.2.4 (23-1-2026)
The ThermoGIS Jar is now packaged within pythermogis, this reduces the number of installation steps from users (no longer having to set a THERMOGIS_JAR environment variable) and means that multiple installations of pythermogis on the same 
system won't break each-other (previously two or more pythermogis installations would use the same Jar, which could cause version conflicts). 
+17 −20
Original line number Diff line number Diff line
# Installation
**pythermogis** is a Python package that provides API access to the [ThermoGIS](https://www.thermogis.nl/en) doublet simulations and economic calculations,  ThermoGIS is developed and maintained by the [Geological Survey of the Netherlands](https://www.geologischedienst.nl/en/) which is part of [TNO](https://www.tno.nl/en/), additionally, pythermogis was also partially developed by and for the [GoForward](https://go-forward-project.eu/) project.

pythermogis has been designed to be used as a python package you import into your own python projects.
It works by creating a python API access to the ThermoGIS techno-economic application, which is written in Java. 
Because of this dependency you need to Install a Java 17 VM.

### 1. Install Java 17
Read the full documenation [here](https://pythermogis-15909e.ci.tno.nl/).

This package requires a Java 17 VM (we recommend using [Amazon Corretto 17](https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/downloads-list.html)).
If you wish to build the documentation locally, follow the installation from source step and run:

*(You can find the JAR in this repository's resources folder: /resources/thermogis_jar)*
```bash
pixi run mkdocs serve
```

### 2. Ensure JAVA_HOME is set
---

When installing the Java 17 Virtual Machine (JVM), a global environment variable _should_ have been set: `JAVA_HOME`. This stores the path to the JVM that was installed in step 1 and enables pythermogis to read the core Java code.
# Installation

If, for some reason, this was not done during installation you can either set it yourself or create a ``.env`` file in your project root folder. 
pythermogis has been designed to be used as a python package you import into your own python projects.
It works by creating a python API access to the Core ThermoGIS techno-economic application, which is written in Java. 

This `.env` file should contain the following variable:
The ThermoGIS techno-economic Core application is packaged within pythermogis, this is the reason the package is quite large (~150mb).
Additionally the first time you run a simulation with pythermogis, a Java 17 Virtual machine (JVM) will be automatically installed (using the package [install-jdk](https://pypi.org/project/install-jdk/)).

- `JAVA_HOME`: Path to the Java 17 installation
  *(e.g., on Windows: `C:\Program Files\Amazon Corretto\jdk17.0.0_0`)*
The Java 17 virtual machine is an additional ~350mb so there should be at least 500mb of space on any machine you install pythermogis on (and preferably more).

Installation of the JVM can take some time (0.5 - 2 minutes) depending on the speed of your internet connection, but will only be done once per pythermogis installation.

Example `.env` contents (The specific path could be different depending on your OS, or file architecture):
```
JAVA_HOME = C:\Program Files \Amazon Corretto\jdk17.0.0_0
```
pythermogis has been tested on Windows and Linux operating systems.

### 3. Import pythermogis into your own python projects
### 1. Import pythermogis into your own python projects

You can use pip to install the package directly from the gitlab project:
```
@@ -44,7 +42,7 @@ If you are using uv as your dependency manager:
uv add pythermogis --default-index https://ci.tno.nl/gitlab/api/v4/projects/18271/packages/pypi/simple
```

### Installation from source
### 2. Installation from source

Clone and install from source with Pixi:

@@ -53,6 +51,5 @@ git clone git@ci.tno.nl:ags_public/pythermogis.git
cd pythermogis
pixi install
```
(Make sure you have followed step 1 and 2: installing a Java 17 VM)

---
Loading