TNO Intern

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

Merge branch '87-optimize-the-utc-scropts' into 'python-rewrite-of-java-code'

Resolve "Optimize the UTC scropts"

See merge request !104
parents 00721824 06b82bd4
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,3 +10,4 @@ dist

tests/resources/test_output

pydoubletcalc_install
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ Run tests:
    - export PATH=$JAVA_HOME/bin:$PATH
    - export THERMOGIS_JAR=$CI_PROJECT_DIR/resources/thermogis_jar/thermogis-1.7.0-shaded.jar
    - pixi install
    - pixi run pip install pydoubletcalc --index-url https://gitlab-ci-token:$PYDOUBLETCALC_READ@ci.tno.nl/gitlab/api/v4/projects/19719/packages/pypi/simple
    - pixi run pytest -rx tests/
    - rm -rf /var/lib/apt/lists/*
  only:
+21 −0
Original line number Diff line number Diff line
@@ -18,6 +18,27 @@ PyThermoGIS has been designed to be used as a python package you import into you
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 and store the ThermoGIS Jar (a Java executable file) on your computer:

## Installing pydoubletcalc

[pydoubletcalc](https://ci.tno.nl/gitlab/AGS/Geothermal/thermogis/pydoubletcalc) is the python backend we are writing to replace the java backend for pythermogis.

It is not yet public, until then you can install the latest version of the code using the following command:

```bash
pixi run pip install pydoubletcalc --index-url https://token_name:token_password@ci.tno.nl/gitlab/api/v4/projects/19719/packages/pypi/simple
```
replace token_name and token_password with the credentials from a Personal Access Token, with read access.
(If you don't have a PAT then: Login to gitlab > preferences > Access Tokens)

To update pydoubletcalc you will first need to uninstall it and then reinstall using the above method.


## Installing pydoubletcalc locally

```bash
 pixi add --editable pydoubletcalc@file:C:path\to\pydoubletcalc --pypi
```

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

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)) and a [ThermoGIS Jar file](https://ci.tno.nl/gitlab/ags_public/pythermogis/-/blob/main/resources/thermogis_jar/thermogis-1.7.0-shaded.jar?ref_type=heads) (Version >=1.7).
+1 −41
Original line number Diff line number Diff line
@@ -252,7 +252,6 @@ environments:
      - pypi: https://files.pythonhosted.org/packages/8f/e9/6a7d025d8da8c4931522922cd706105aa32b3291d1add8c5427cdcd66e63/kiwisolver-1.4.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/f5/64/41c4367bcaecbc03ef0d2a3ecee58a7065d0a36ae1aa817fe573a2da66d4/matplotlib-3.10.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/d1/80/b9c19f1bb4ac6c5fa6f94a4f278bc68a778473d1814a86a375d7cffa193a/netCDF4-1.7.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/78/f9/690a8600b93c332de3ab4a344a4ac34f00c8f104917061f779db6a918ed6/pathlib-1.0.1-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/02/65/ad2bc85f7377f5cfba5d4466d5474423a3fb7f6a97fd807c06f92dd3e721/plotly-6.0.1-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/c9/58/c3bc54c0fad9a82899e9a2703e04ee6e8eaa76caa90c0689fd1b468a4427/pygridsio-1.0-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/ea/00/d815833441d8c52bf4a6930952e77d3de77d0bf67b3202ccc12dabdae279/pykrige-1.7.2.tar.gz
@@ -264,9 +263,7 @@ environments:
      - pypi: https://files.pythonhosted.org/packages/2a/2f/63d2cacc0e525f8e3398bcf32bd3620385f22cd1600834ec49d7f3597a7b/rioxarray-0.19.0-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/21/f6/4bfb5695d8941e5c570a04d9fcd0d36bce7511b7d78e6e75c8f9791f82d0/scipy-1.16.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/d1/a7/5c9cb413e4e2ce52c16be717e94abd40ce91b1f8974624d5d56154c5d40b/shapely-2.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl
      - pypi: ./
      - pypi: C:/Users/knappersfy/work/thermogis/pydoubletcalc
      win-64:
      - conda: https://conda.anaconda.org/conda-forge/win-64/_openmp_mutex-4.5-2_gnu.conda
      - conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_2.conda
@@ -489,7 +486,6 @@ environments:
      - pypi: https://files.pythonhosted.org/packages/d0/dc/c1abe38c37c071d0fc71c9a474fd0b9ede05d42f5a458d584619cfd2371a/kiwisolver-1.4.8-cp313-cp313-win_amd64.whl
      - pypi: https://files.pythonhosted.org/packages/b1/0f/eed564407bd4d935ffabf561ed31099ed609e19287409a27b6d336848653/matplotlib-3.10.3-cp313-cp313-win_amd64.whl
      - pypi: https://files.pythonhosted.org/packages/66/b5/e04550fd53de57001dbd5a87242da7ff784c80790adc48897977b6ccf891/netCDF4-1.7.2-cp313-cp313-win_amd64.whl
      - pypi: https://files.pythonhosted.org/packages/78/f9/690a8600b93c332de3ab4a344a4ac34f00c8f104917061f779db6a918ed6/pathlib-1.0.1-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/02/65/ad2bc85f7377f5cfba5d4466d5474423a3fb7f6a97fd807c06f92dd3e721/plotly-6.0.1-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/c9/58/c3bc54c0fad9a82899e9a2703e04ee6e8eaa76caa90c0689fd1b468a4427/pygridsio-1.0-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/ea/00/d815833441d8c52bf4a6930952e77d3de77d0bf67b3202ccc12dabdae279/pykrige-1.7.2.tar.gz
@@ -501,9 +497,7 @@ environments:
      - pypi: https://files.pythonhosted.org/packages/2a/2f/63d2cacc0e525f8e3398bcf32bd3620385f22cd1600834ec49d7f3597a7b/rioxarray-0.19.0-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/cd/01/1204382461fcbfeb05b6161b594f4007e78b6eba9b375382f79153172b4d/scipy-1.16.3-cp313-cp313-win_amd64.whl
      - pypi: https://files.pythonhosted.org/packages/e3/f0/9f8cdf2258d7aed742459cea51c70d184de92f5d2d6f5f7f1ded90a18c31/shapely-2.1.0-cp313-cp313-win_amd64.whl
      - pypi: https://files.pythonhosted.org/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl
      - pypi: ./
      - pypi: C:/Users/knappersfy/work/thermogis/pydoubletcalc
packages:
- conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
  sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726
@@ -4477,10 +4471,6 @@ packages:
  - pkg:pypi/partd?source=hash-mapping
  size: 20884
  timestamp: 1715026639309
- pypi: https://files.pythonhosted.org/packages/78/f9/690a8600b93c332de3ab4a344a4ac34f00c8f104917061f779db6a918ed6/pathlib-1.0.1-py3-none-any.whl
  name: pathlib
  version: 1.0.1
  sha256: f35f95ab8b0f59e6d354090350b44a80a80635d22efdedfa84c7ad1cf0a74147
- conda: https://conda.anaconda.org/conda-forge/noarch/pathspec-0.12.1-pyhd8ed1ab_1.conda
  sha256: 9f64009cdf5b8e529995f18e03665b03f5d07c0b17445b8badef45bde76249ee
  md5: 617f15191456cc6a13db418a275435e5
@@ -4762,20 +4752,6 @@ packages:
  - pkg:pypi/pycparser?source=hash-mapping
  size: 110100
  timestamp: 1733195786147
- pypi: C:/Users/knappersfy/work/thermogis/pydoubletcalc
  name: pydoubletcalc
  version: 0.0.1
  sha256: af6852e94daff598f382da9a04e74eb8649592424d163653d66a833bc140c065
  requires_dist:
  - pandas
  - matplotlib
  - pathlib
  - xarray
  - tqdm>=4.67.1
  - scipy>=1.16.2
  - numba>=0.62.1
  requires_python: '>=3.13,<3.14'
  editable: true
- conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.19.1-pyhd8ed1ab_0.conda
  sha256: 28a3e3161390a9d23bc02b4419448f8d27679d9e2c250e29849e37749c8de86b
  md5: 232fb4577b6687b2d503ef8e254270c9
@@ -4943,7 +4919,7 @@ packages:
- pypi: ./
  name: pythermogis
  version: 1.2.0
  sha256: f25432777c09250f39cf8019497063cc9860feeb7207723ab5ec7783781125d6
  sha256: f484b4cf939f0f4b0cccabf53e301e4ab4b85f1f4d96b533dbee0e63dfeb1415
  requires_dist:
  - jpype1>=1.5.2,<2
  - xarray==2024.9.0.*
@@ -5640,22 +5616,6 @@ packages:
  - pkg:pypi/tornado?source=hash-mapping
  size: 878044
  timestamp: 1748003914685
- pypi: https://files.pythonhosted.org/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl
  name: tqdm
  version: 4.67.1
  sha256: 26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2
  requires_dist:
  - colorama ; sys_platform == 'win32'
  - pytest>=6 ; extra == 'dev'
  - pytest-cov ; extra == 'dev'
  - pytest-timeout ; extra == 'dev'
  - pytest-asyncio>=0.24 ; extra == 'dev'
  - nbval ; extra == 'dev'
  - requests ; extra == 'discord'
  - slack-sdk ; extra == 'slack'
  - requests ; extra == 'telegram'
  - ipywidgets>=6 ; extra == 'notebook'
  requires_python: '>=3.7'
- conda: https://conda.anaconda.org/conda-forge/noarch/twine-6.1.0-pyh29332c3_0.conda
  sha256: c5b373f6512b96324c9607d7d91a76bb53c1056cb1012b4f9c86900c6b7f8898
  md5: d319066fad04e07a0223bf9936090161
+1 −2
Original line number Diff line number Diff line
@@ -36,13 +36,12 @@ markers = [
[tool.setuptools]
package-dir = {"" = "src"}

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

[tool.pixi.pypi-dependencies]
pythermogis = { path = ".", editable = true }
pydoubletcalc = { path = 'C:\Users\knappersfy\work\thermogis\pydoubletcalc', editable = true }

[tool.pixi.tasks]
test = "PYTHONPATH=src/pythermogis pytest -s tests/"
Loading