TNO Intern

Commit 4870b836 authored by Hen Brett's avatar Hen Brett 🐔
Browse files

Adding information on the CLI to the README.md

parent d9edaddd
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ This project is licensed under the MIT License. See the `LICENSE` file for detai

---

## 🪛 Installation for Development
## 🪛 Installation for Development and Usage outside of a python package

### 🛠️ Install from Source with Pixi

@@ -240,6 +240,27 @@ pixi install
```

---
### Running the PyThermoGIS CLI

PyThermogis supports a Command Line Interface 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
```



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

@@ -278,7 +299,7 @@ This will generate `.whl` and `.tar.gz` files in the `dist/` directory.
#### 3. Upload to GitLab

```bash
pixi run twine upload -r gitlab-src dist/*
pixi run twine upload -r gitlab-pythermogis dist/*
```

If `.pypirc` is set up correctly, this will upload the package to the GitLab registry.
+40 −40
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ environments:
      - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2025.4.26-pyhd8ed1ab_0.conda
      - conda: https://conda.anaconda.org/conda-forge/linux-64/cffi-1.17.1-py313hfab6e84_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.2-pyhd8ed1ab_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.2.0-pyh707e725_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.1.8-pyh707e725_0.conda
      - conda: https://conda.anaconda.org/conda-forge/linux-64/cmarkgfm-2024.11.20-py313h536fd9c_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.13.3-py313hd8ed1ab_101.conda
@@ -109,9 +109,9 @@ environments:
      - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-serializinghtml-1.1.10-pyhd8ed1ab_1.conda
      - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/twine-6.1.0-pyh29332c3_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.2-pyhff008b6_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.2-pyh29332c3_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.2-h801b22e_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.4-pyh9571d03_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.4-pyhe01879c_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.4-haa4fddc_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.13.2-pyh29332c3_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025b-h78e105d_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.4.0-pyhd8ed1ab_0.conda
@@ -158,7 +158,7 @@ environments:
      - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2025.4.26-pyhd8ed1ab_0.conda
      - conda: https://conda.anaconda.org/conda-forge/win-64/cffi-1.17.1-py313ha7868ed_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.2-pyhd8ed1ab_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.2.0-pyh7428d3b_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.1.8-pyh7428d3b_0.conda
      - conda: https://conda.anaconda.org/conda-forge/win-64/cmarkgfm-2024.11.20-py313ha7868ed_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.13.3-py313hd8ed1ab_101.conda
@@ -236,9 +236,9 @@ environments:
      - conda: https://conda.anaconda.org/conda-forge/win-64/tbb-2021.13.0-h62715c5_1.conda
      - conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h5226925_1.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/twine-6.1.0-pyh29332c3_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.2-pyhff008b6_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.2-pyh29332c3_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.2-h801b22e_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.4-pyh9571d03_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.4-pyhe01879c_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.4-haa4fddc_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.13.2-pyh29332c3_0.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025b-h78e105d_0.conda
      - conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.22621.0-h57928b3_1.conda
@@ -591,31 +591,31 @@ packages:
  - pkg:pypi/charset-normalizer?source=compressed-mapping
  size: 50481
  timestamp: 1746214981991
- conda: https://conda.anaconda.org/conda-forge/noarch/click-8.2.0-pyh707e725_0.conda
  sha256: 910f0e5e74a75f6e270b9dedd0f8ac55830250b0874f9f67605816fd069af283
  md5: 4d4f33c3d9e5a23a7f4795d327a5d1f0
- conda: https://conda.anaconda.org/conda-forge/noarch/click-8.1.8-pyh707e725_0.conda
  sha256: c920d23cd1fcf565031c679adb62d848af60d6fbb0edc2d50ba475cea4f0d8ab
  md5: f22f4d4970e09d68a10b922cbb0408d3
  depends:
  - __unix
  - python >=3.10
  - python >=3.9
  license: BSD-3-Clause
  license_family: BSD
  purls:
  - pkg:pypi/click?source=hash-mapping
  size: 87705
  timestamp: 1746951781787
- conda: https://conda.anaconda.org/conda-forge/noarch/click-8.2.0-pyh7428d3b_0.conda
  sha256: cfde6568dedb1726b4cd9f2f8204caee745cf972d25a3ebc8b75a2349c5e7205
  md5: 8fac1fede8f5ea11cf93235463c8a045
  size: 84705
  timestamp: 1734858922844
- conda: https://conda.anaconda.org/conda-forge/noarch/click-8.1.8-pyh7428d3b_0.conda
  sha256: c889ed359ae47eead4ffe8927b7206b22c55e67d6e74a9044c23736919d61e8d
  md5: 90e5571556f7a45db92ee51cb8f97af6
  depends:
  - __win
  - colorama
  - python >=3.10
  - python >=3.9
  license: BSD-3-Clause
  license_family: BSD
  purls:
  - pkg:pypi/click?source=hash-mapping
  size: 88276
  timestamp: 1746951775467
  size: 85169
  timestamp: 1734858972635
- pypi: https://files.pythonhosted.org/packages/e9/da/824b92d9942f4e472702488857914bdd50f73021efea15b4cad9aca8ecef/click_plugins-1.1.1-py2.py3-none-any.whl
  name: click-plugins
  version: 1.1.1
@@ -2232,7 +2232,7 @@ packages:
- pypi: .
  name: pythermogis
  version: 0.1.17
  sha256: 5aec9090956f597c4828067c119075520d5b00a307212f15f16c05349cc09b43
  sha256: 227e817db5677adbb70ebfa8e4a0164a587f042329513a6c994a36dd55930fe9
  requires_dist:
  - jpype1>=1.5.2,<2
  - xarray==2024.9.0.*
@@ -2909,49 +2909,49 @@ packages:
  - pkg:pypi/twine?source=hash-mapping
  size: 40401
  timestamp: 1737553658703
- conda: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.2-pyhff008b6_0.conda
  sha256: fa6eeb42e3bddff74126dd61b01b21a3f4f4791368e93bc5a5775563542b2d4e
  md5: 1152565b06e3dc27794c3c11f1050005
- conda: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.4-pyh9571d03_0.conda
  sha256: b70f0d7892d81e1e2fd0c581c6d85e6e3c3683752e1fb2cef8f75a994c0a379b
  md5: 962bae3826ede4349263e6e027280724
  depends:
  - typer-slim-standard ==0.15.2 h801b22e_0
  - typer-slim-standard ==0.15.4 haa4fddc_0
  - python >=3.9
  - python
  license: MIT
  license_family: MIT
  purls:
  - pkg:pypi/typer?source=hash-mapping
  size: 76158
  timestamp: 1740697495168
- conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.2-pyh29332c3_0.conda
  sha256: c094713560bfacab0539c863010a5223171d9980cbd419cc799e474ae15aca08
  md5: 7c8d9609e2cfe08dd7672e10fe7e7de9
  size: 77100
  timestamp: 1747243737598
- conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.4-pyhe01879c_0.conda
  sha256: ccd7fe2719899bc766a9a7215f307ef48dc67c227e2006a6a9b5a2c882fadba0
  md5: 845a20742ceeec7c193a2ed448b3c3b2
  depends:
  - python >=3.9
  - click >=8.0.0
  - click >=8.0.0,<8.2
  - typing_extensions >=3.7.4.3
  - python
  constrains:
  - typer 0.15.2.*
  - typer 0.15.4.*
  - rich >=10.11.0
  - shellingham >=1.3.0
  license: MIT
  license_family: MIT
  purls:
  - pkg:pypi/typer-slim?source=hash-mapping
  size: 45866
  timestamp: 1740697495167
- conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.2-h801b22e_0.conda
  sha256: 79b6b34e90e50e041908939d53053f69285714b0082a0370fba6ab3b38315c8d
  md5: ea164fc4e03f61f7ff3c1166001969af
  size: 46236
  timestamp: 1747243737598
- conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.4-haa4fddc_0.conda
  sha256: 1d1c779d381667e367345469a5fdb97cc3c175453cb1dcd5ed7cd5e7810c5d38
  md5: 235d77753dc869548f22292b872bb0ab
  depends:
  - typer-slim ==0.15.2 pyh29332c3_0
  - typer-slim ==0.15.4 pyhe01879c_0
  - rich
  - shellingham
  license: MIT
  license_family: MIT
  purls: []
  size: 5409
  timestamp: 1740697495168
  size: 5471
  timestamp: 1747243737598
- conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.13.2-pyh29332c3_0.conda
  sha256: a8aaf351e6461de0d5d47e4911257e25eec2fa409d71f3b643bb2f748bde1c08
  md5: 83fc6ae00127671e301c9f44254c31b8
+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ package-dir = {"" = "src"}
where = ["src"]

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

[tool.pixi.project]
channels = ["conda-forge"]
@@ -61,4 +61,4 @@ 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.2"
typer = ">=0.15.4,<0.16"
+61.6 KiB
Loading image diff...
+3 −5
Original line number Diff line number Diff line
@@ -9,24 +9,22 @@ import typer
from thermogis_classes.doublet import calculate_doublet_performance

app = typer.Typer(pretty_exceptions_enable=False)
calculate = typer.Typer(pretty_exceptions_enable=False)
app.add_typer(calculate, name="calculate")


@calculate.command()
@app.command()
def info():
    print("This is the pyThermoGIS Repository; it is a python API to the ThermoGIS Simulation code.")
    print("You can run commands by typing:\n")
    print("\t tg simulate-doublet")

@calculate.command()
@app.command()
def simulate_doublet(
        depth: float = typer.Option(500, help="The depth of the aquifer, +ive downwards, units: [m]"),
        temperature: float = typer.Option(None, help="The temperature of the aquifer, if not provided this will be calculated using a Temperature gradient of 8°C + 31°C/km with the depth parameter,"),
        thickness: float = typer.Option(500, help="The thickness of the aquifer, units: [m]"),
        ntg: float = typer.Option(0.5, help="The net-to-gross of the aquifer, units: [0-1]"),
        porosity: float = typer.Option(0.5, help="The porosity of the aquifer, between 0-1 (1 = 100%), units: [0-1]"),
        permeability:float = typer.Option(0.5, help="The permeability of the aquifer, units: [mD]"),
        permeability:float = typer.Option(150, help="The permeability of the aquifer, units: [mD]"),
        output_file: Path = typer.Option(None, help="A file to output the data to, accepted filetypes are: .nc, .csv, .xlsx, .json"),
        verbose: bool = typer.Option(False, help="print the input data and output data to terminal")
) -> None:
Loading