TNO Intern

Commit 6b4669fb authored by Hen Brett's avatar Hen Brett 🐔
Browse files

Merge branch '26-add-typer-cli-2' into 'main'

Resolve "Add Typer CLI"

Closes #26

See merge request AGS/pythermogis!27
parents e36c7d70 162f4d97
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/tests/tests" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
      <excludeFolder url="file://$MODULE_DIR$/.venv" />
    </content>
    <orderEntry type="jdk" jdkName="Python 3.13 (2)" jdkType="Python SDK" />
@@ -13,7 +14,7 @@
    <option name="namespacePackageFolders">
      <list>
        <option value="$MODULE_DIR$/resources" />
        <option value="$MODULE_DIR$/pythermogis" />
        <option value="$MODULE_DIR$/src" />
      </list>
    </option>
  </component>
+47 −17
Original line number Diff line number Diff line
@@ -48,7 +48,10 @@ This package provides a narrow access point to the doublet simulations and UTC e

---

## Installation for use in your own projects
# Installation

PyThermoGIS has been designed to be used in one of two ways; either as a python package you import into your own python projects, or as a standalone package where you can access the calculations via a CLI.
Either way, you need to Install a Java 17 VM and store the ThermoGIS Jar:

### 1. Install Java 17 and Download the ThermoGIS JAR

@@ -65,7 +68,7 @@ This package requires a Java 17 VM (we recommend using [Amazon Corretto 17](http

---

### 2. Install pyThermoGIS from TNO GitLab
### 2a) import pyThermoGIS into your own python projects

This repository is currently hosted privately on [ci.tno.nl](https://ci.tno.nl) and will become publicly available in the future. 

@@ -92,7 +95,45 @@ pip install pythermogis --index-url https://__token__:<your_personal_token>@ci.t

---

## Usage
### 2b) Installation for further development or Standalone usage

Clone and install from source with Pixi:

```bash
git clone https://gitlab.com/your-repo/pythermogis.git
cd pythermogis
pixi install
```
(Make sure you have followed the step installing a Java17 VM and saving the ThermoGIS Jar)

---

# Usage

PyThermoGIS has been designed to be used in one of two ways; either as a python package you import into your own python projects, or as a standalone package where you can access the calculations via a CLI.


## 1. Running the PyThermoGIS CLI

PyThermogis supports a Command Line Interface (CLI), to see the available commands run the following:

```bash
pixi run pytg --help
```

Currently the main command that can be run is to run a doublet simulation on single values (no grid or arrays) for a P50 simulation. To view the help documentation run:

```bash
pixi run pytg simulate-doublet --help
```

And as an example:

```bash
pixi run pytg simulate-doublet --depth 500 --temperature 150 --thickness 200 --ntg 0.45 --porosity 0.45 --permeability 200 --output-file test.csv
```

## 2. Usage in your own python projects

### 🧪 Basic Example

@@ -174,6 +215,7 @@ Common properties to change include:

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

```python
from pythermogis import calculate_doublet_performance, instantiate_utc_properties_builder
import xarray as xr
@@ -228,19 +270,7 @@ This project is licensed under the MIT License. See the `LICENSE` file for detai

---

## 🪛 Installation for Development

### 🛠️ Install from Source with Pixi

```bash
git clone https://gitlab.com/your-repo/pythermogis.git
cd pythermogis
pixi install
```

---

### 📦 Publish to ci.tno.nl/gitlab
### 📦 Publish to ci.tno.nl/gitlab (For developers only)

#### 1. Configure `.pypirc`

+1479 −243

File changed.

Preview size limit exceeded, changes collapsed.

pixi.toml

deleted100644 → 0
+0 −32
Original line number Diff line number Diff line
[project]
authors = ["Brett <hen.brett@tno.nl>"]
channels = ["conda-forge"]
description = "This is a python API to the ThermoGIS java code"
name = "pythermogis"
platforms = ["win-64"]
version = "0.1.0"

[tasks]

[dependencies]
python = ">=3.13.2,<3.14"
jpype1 = ">=1.5.2,<2"
xarray = "2024.9.0.*"
pandas = ">=2.2.3,<3"
pytz = ">=2024.1,<2025"
setuptools = ">=75.8.2,<76"
wheel = ">=0.45.1,<0.46"
twine = ">=6.1.0,<7"
pip = ">=25.0.1,<26"
sphinx = ">=8.2.3,<9"
sphinx_rtd_theme = ">=3.0.1,<4"

[tool.pixi]
pypi_index_url = "https://pypi.org/simple"
pypi_extra_index_urls = ["https://ci.tno.nl/gitlab/api/v4/projects/18271/packages/pypi"]

[pypi-dependencies]
pygridsio = ">=0.3.11, <0.4"
build = "*"

+46 −8
Original line number Diff line number Diff line
@@ -3,10 +3,13 @@ requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "pythermogis"
version = "0.1.16"
description = "This is a Python API to the ThermoGIS Java code"
authors = [{ name = "Brett", email = "hen.brett@tno.nl" }]
name = "pythermoGIS"
version = "0.1.17"
description = "This repository is used as a python API for the ThermoGIS Doublet simulations"
authors = [
    { name = "Hen Brett", email = "hen.brett@tno.nl" },
    { name = "Florian Knappers", email = "florian.knappers@tno.nl" },
]
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.11"
@@ -16,11 +19,46 @@ dependencies = [
    "pandas>=2.2.3,<3",
    "pytz>=2024.1,<2025",
    "pygridsio>=0.3.11,<0.4"
, "build>=1.2.2.post1,<2"]


[tool.pytest.ini_options]
minversion = "7.0"
addopts = "--strict-markers -ra"
testpaths = ["."]
markers = [
    "integration: Marks integration tests (deselect with '-m \"not integration\"')"
]

[tool.setuptools]
package-dir = {"" = "src"}

[tool.setuptools.packages.find]
where = ["."]
include = ["pythermogis*"]  # Ensure all submodules are included
where = ["src"]

[project.scripts]
pytg = "main:app"

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64"]

[tool.pixi.pypi-dependencies]
pythermogis = { path = ".", editable = true }

[tool.pixi.tasks]

[tool.twine]
repository = "pypi"
[tool.pixi.dependencies]
python = ">=3.13.2,<3.14"
jpype1 = ">=1.5.2,<2"
xarray = "2024.9.0.*"
pandas = ">=2.2.3,<3"
pytz = ">=2024.1,<2025"
setuptools = ">=75.8.2,<76"
wheel = ">=0.45.1,<0.46"
twine = ">=6.1.0,<7"
pip = ">=25.0.1,<26"
sphinx = ">=8.2.3,<9"
sphinx_rtd_theme = ">=3.0.1,<4"
openpyxl = ">=3.1.5,<4"
typer = ">=0.15.4,<0.16"
Loading