TNO Intern

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

Updating the README.md

parent cbd1098b
Loading
Loading
Loading
Loading
+42 −18
Original line number Diff line number Diff line
# pyThermoGIS

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
pyThermoGIS is a Python package that provides API access to the [ThermoGIS](https://www.thermogis.nl/en) Geothermal simulation. 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
It uses [xarray](https://docs.xarray.dev/en/stable/index.html) Datasets as input to the simulation and can be combined with the [pygridsio](https://pypi.org/project/pygridsio/) package  to read in and process 2D rasters
   
## Installation for usage in your own python project

@@ -20,20 +20,8 @@ Follow these steps:
- Create a new token with the **read_api** and **read_package_registry** scopes.
- Copy the token and store it securely, as it will not be visible again.

### 2. Set Up Authentication with `.pypirc`

Create a `.pypirc` file in your home directory (`~/.pypirc` on Linux/macOS or `%USERPROFILE%\.pypirc` on Windows) with the following content:

```ini
[gitlab]
repository = https://ci.tno.nl/gitlab/api/v4/projects/18271/packages/pypi
username = __token__
password = <your_personal_token>
```

Replace `<your_personal_token>` with your actual GitLab PAT. Ensure the token has the necessary permissions to access the repository.

### 3. Install the Package
### 2. Install the Package

Once the `.pypirc` file is set up, install `pyThermoGIS` using:

@@ -54,7 +42,7 @@ This will fetch the package from the specified GitLab package repository.
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
from pythermogis import calculate_doublet_performance
import xarray as xr

# Initialize an input Dataset with the required input variables:
@@ -79,7 +67,7 @@ The API utilizes xarray's ability to efficiently calculate over multiple dimensi
dimensions:

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

@@ -107,7 +95,7 @@ print(doublet_simulation_results)

Consider utilizing the pypi package pygridsio to read in and write out 2D raster grids (with either .asc, .zmap, .nc, .tif file formats) to a xarray dataset, before applying the calculate_doublet_performance code:
```python
from pythermogis.pythermogis import calculate_doublet_performance
from pythermogis import calculate_doublet_performance
from pygridsio.pygridsio import read_grid

# Initialize an input Dataset with the required input variables:
@@ -159,3 +147,39 @@ To install `pyThermoGIS` from source using Pixi, follow these steps:
   ```sh
   pixi run python
   ```

### Publish to ci.tno.nl/gitlab

### 1. Set Up Authentication with `.pypirc`

Create a `.pypirc` file in your home directory (`~/.pypirc` on Linux/macOS or `%USERPROFILE%\.pypirc` on Windows) with the following content:

```ini
[distutils]
index-servers =
    gitlab-pythermogis

[gitlab-pythermogis]
repository = https://ci.tno.nl/gitlab/api/v4/projects/18271/packages/pypi
username = __token__
password = <your_personal_token>
```

Replace `<your_personal_token>` with your actual GitLab PAT. Ensure the token has the necessary permissions to write to repositories

### 2. download packages and build project

Using Pixi download build and twine, then run:
   ```sh
   pixi run python -m build
   ```

this will then build a .whl and a .tar.gz file and place it in the /build directory

### 3. upload to gitlab

Then run:
   ```sh
   pixi run twine upload -r gitlab-pythermogis dist/*
   ```
If the credentials have been successfully updated in the `~/.pypirc` file, this should upload the python package to the gitlab pypi package repository
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -326,7 +326,7 @@ packages:
  version: 8.1.8
  sha256: 63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2
  requires_dist:
  - colorama ; platform_system == 'Windows'
  - colorama ; sys_platform == 'win32'
  - importlib-metadata ; python_full_version < '3.8'
  requires_python: '>=3.7'
- pypi: https://files.pythonhosted.org/packages/e9/da/824b92d9942f4e472702488857914bdd50f73021efea15b4cad9aca8ecef/click_plugins-1.1.1-py2.py3-none-any.whl