TNO Intern

Commit 3b437020 authored by Hen Brett's avatar Hen Brett 🐔
Browse files

Merge branch '2-implement-the-tg-python-api-using-jpypes-2' into 'main'

Resolve "implement the TG python api using jPypes"

Closes #2

See merge request AGS/pythermogis!3
parents f9549c1f 41343b43
Loading
Loading
Loading
Loading

models/.gitignore

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
**/*
 No newline at end of file

pythermogis.py

deleted100644 → 0
+0 −23
Original line number Diff line number Diff line
import sys

import yaml

from src.thermogis.TechnoEconomicWrapper import edit_wp5_configuration_file, run_wp5_docker_image
from src.datamodels.configuration import Config


def run(config_file):
    with open(config_file, "r") as f:
        config_dict = yaml.load(f,Loader=yaml.FullLoader)
    config = Config(**config_dict)
    xml_file = config.model_path / "xml" / "doublet.xml"

    # edit the xml file that the ThermoGIS docker image will be run on
    edit_wp5_configuration_file(config, xml_file)

    # run the ThermoGIS docker image
    run_wp5_docker_image(config)


if __name__ == '__main__':
    run(sys.argv[1])
 No newline at end of file
+0 −0

Empty file added.

+28 −0
Original line number Diff line number Diff line
import os
from pathlib import Path

from git import Repo
from pydantic import BaseModel, model_validator


class DoubletParameters(BaseModel):
    use_stimulation: bool = False
    use_heat_pump: bool = False
    hp_minimum_injection_temperature: float = 15
    max_cooling_temperature_range: float = 100
    stimKhMax: float = 20
    return_temperature: float = 30
    surface_temperature: float = 10
class Config(BaseModel):
    input_data_path: Path | None
    results_path: Path | None

    DoubletParameters : DoubletParameters


    @model_validator(mode="after")
    def set_paths(self):
        if not self.output_path:
            repo_path = Path(Repo(".", search_parent_directories=True).working_tree_dir)
            self.output_path = repo_path / "models" / self.model_name
        return self
+0 −0

Empty file added.

Loading