geoloop 0.0.1__py3-none-any.whl → 1.0.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. geoloop/axisym/AxisymetricEL.py +751 -0
  2. geoloop/axisym/__init__.py +3 -0
  3. geoloop/bin/Flowdatamain.py +89 -0
  4. geoloop/bin/Lithologymain.py +84 -0
  5. geoloop/bin/Loadprofilemain.py +100 -0
  6. geoloop/bin/Plotmain.py +250 -0
  7. geoloop/bin/Runbatch.py +81 -0
  8. geoloop/bin/Runmain.py +86 -0
  9. geoloop/bin/SingleRunSim.py +928 -0
  10. geoloop/bin/__init__.py +3 -0
  11. geoloop/cli/__init__.py +0 -0
  12. geoloop/cli/batch.py +106 -0
  13. geoloop/cli/main.py +105 -0
  14. geoloop/configuration.py +946 -0
  15. geoloop/constants.py +112 -0
  16. geoloop/geoloopcore/CoaxialPipe.py +503 -0
  17. geoloop/geoloopcore/CustomPipe.py +727 -0
  18. geoloop/geoloopcore/__init__.py +3 -0
  19. geoloop/geoloopcore/b2g.py +739 -0
  20. geoloop/geoloopcore/b2g_ana.py +535 -0
  21. geoloop/geoloopcore/boreholedesign.py +683 -0
  22. geoloop/geoloopcore/getloaddata.py +112 -0
  23. geoloop/geoloopcore/pyg_ana.py +280 -0
  24. geoloop/geoloopcore/pygfield_ana.py +519 -0
  25. geoloop/geoloopcore/simulationparameters.py +130 -0
  26. geoloop/geoloopcore/soilproperties.py +152 -0
  27. geoloop/geoloopcore/strat_interpolator.py +194 -0
  28. geoloop/lithology/__init__.py +3 -0
  29. geoloop/lithology/plot_lithology.py +277 -0
  30. geoloop/lithology/process_lithology.py +697 -0
  31. geoloop/loadflowdata/__init__.py +3 -0
  32. geoloop/loadflowdata/flow_data.py +161 -0
  33. geoloop/loadflowdata/loadprofile.py +325 -0
  34. geoloop/plotting/__init__.py +3 -0
  35. geoloop/plotting/create_plots.py +1137 -0
  36. geoloop/plotting/load_data.py +432 -0
  37. geoloop/utils/RunManager.py +164 -0
  38. geoloop/utils/__init__.py +0 -0
  39. geoloop/utils/helpers.py +841 -0
  40. geoloop-1.0.0b1.dist-info/METADATA +112 -0
  41. geoloop-1.0.0b1.dist-info/RECORD +46 -0
  42. geoloop-1.0.0b1.dist-info/entry_points.txt +2 -0
  43. geoloop-0.0.1.dist-info/licenses/LICENSE → geoloop-1.0.0b1.dist-info/licenses/LICENSE.md +2 -1
  44. geoloop-0.0.1.dist-info/METADATA +0 -10
  45. geoloop-0.0.1.dist-info/RECORD +0 -6
  46. {geoloop-0.0.1.dist-info → geoloop-1.0.0b1.dist-info}/WHEEL +0 -0
  47. {geoloop-0.0.1.dist-info → geoloop-1.0.0b1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,3 @@
1
+ """
2
+ This package contains the main scripts to run for using Geoloop.
3
+ """
File without changes
geoloop/cli/batch.py ADDED
@@ -0,0 +1,106 @@
1
+ import json
2
+ from pathlib import Path
3
+
4
+ import typer
5
+
6
+ from geoloop.bin.Runbatch import run_batch_from_json
7
+
8
+ batch_app = typer.Typer(help="Batch processing commands for geoloop.")
9
+
10
+
11
+ @batch_app.command("run")
12
+ def batch_run(batchfile: Path = typer.Argument(..., help="Path to batch JSON file.")):
13
+ """Run a batch JSON file."""
14
+ run_batch_from_json(str(batchfile))
15
+
16
+
17
+ @batch_app.command("create")
18
+ def batch_create(
19
+ output: Path = typer.Argument(..., help="Where to save the new batch JSON file."),
20
+ stochastic_run: list[str] = typer.Option([], help="Runmain config files."),
21
+ single_run: list[str] = typer.Option([], help="SingleRunSim config files."),
22
+ process_lithology: list[str] = typer.Option([], help="Lithology config files."),
23
+ calculate_loadprofile: list[str] = typer.Option(
24
+ [], help="Loadprofile config files."
25
+ ),
26
+ calculate_flowdata: list[str] = typer.Option([], help="FlowData config files."),
27
+ plot: list[str] = typer.Option([], help="Plotmain config files."),
28
+ ):
29
+ """
30
+ Create a batch JSON non-interactively.
31
+
32
+ Example:
33
+ geoloop batch create batch.json --stochastic-run a.json --plot p.json
34
+ """
35
+
36
+ commands = []
37
+
38
+ for file in stochastic_run:
39
+ commands.append({"command": "Runmain", "args": file})
40
+
41
+ for file in single_run:
42
+ commands.append({"command": "SingleRunSim", "args": file})
43
+
44
+ for file in process_lithology:
45
+ commands.append({"command": "Lithology", "args": file})
46
+
47
+ for file in calculate_loadprofile:
48
+ commands.append({"command": "Loadprofile", "args": file})
49
+
50
+ for file in calculate_flowdata:
51
+ commands.append({"command": "FlowData", "args": file})
52
+
53
+ for file in plot:
54
+ commands.append({"command": "Plotmain", "args": file})
55
+
56
+ output.parent.mkdir(parents=True, exist_ok=True)
57
+ output.write_text(json.dumps({"commands": commands}, indent=2))
58
+
59
+ typer.secho(f"Batch file created: {output}", fg=typer.colors.GREEN)
60
+
61
+
62
+ @batch_app.command("wizard")
63
+ def batch_wizard():
64
+ """
65
+ Interactive wizard to build a batch JSON file.
66
+ """
67
+
68
+ typer.echo("Welcome to the Geoloop Batch Wizard!")
69
+ typer.echo("Let's build your batch sequence.\n")
70
+
71
+ commands = []
72
+ while True:
73
+ typer.echo("\nSelect command to add:")
74
+ choice = typer.prompt(
75
+ "Options: stochastic-run, single-run, process-lithology, calculate-loadprofile, calculate-flowdata, plot, done",
76
+ type=str,
77
+ )
78
+
79
+ if choice.lower() == "done":
80
+ break
81
+
82
+ valid = {
83
+ "stochastic-run": "Runmain",
84
+ "single-run": "SingleRunSim",
85
+ "process-lithology": "Lithology",
86
+ "calculate-loadprofile": "Loadprofile",
87
+ "calculate-flowdata": "FlowData",
88
+ "plot": "Plotmain",
89
+ }
90
+
91
+ if choice.lower() not in valid:
92
+ typer.secho("Invalid command type!", fg=typer.colors.RED)
93
+ continue
94
+
95
+ filepath = typer.prompt("Enter path to the config JSON file:")
96
+
97
+ commands.append({"command": valid[choice.lower()], "args": filepath})
98
+
99
+ typer.secho("Command added!\n", fg=typer.colors.GREEN)
100
+
101
+ output_file = typer.prompt("Where should the batch JSON be saved?")
102
+ output = Path(output_file)
103
+
104
+ output.write_text(json.dumps({"commands": commands}, indent=2))
105
+
106
+ typer.secho(f"\nBatch file saved: {output}", fg=typer.colors.GREEN)
geoloop/cli/main.py ADDED
@@ -0,0 +1,105 @@
1
+ import typer
2
+
3
+ from geoloop.bin.Flowdatamain import main_flow_data
4
+ from geoloop.bin.Lithologymain import main_lithology
5
+ from geoloop.bin.Loadprofilemain import main_load_profile
6
+ from geoloop.bin.Plotmain import main_plotmain
7
+ from geoloop.bin.Runbatch import run_batch_from_json
8
+ from geoloop.bin.Runmain import main_runmain
9
+ from geoloop.bin.SingleRunSim import main_single_run_sim
10
+ from geoloop.cli.batch import batch_app
11
+
12
+ # Set up the main app
13
+ simulation = typer.Typer(help="Geoloop simulation CLI.")
14
+ simulation.add_typer(batch_app, name="batch")
15
+
16
+
17
+ @simulation.command(name="batch-run")
18
+ def batch_run(
19
+ config_file_path: str = typer.Argument(
20
+ ...,
21
+ help="Path to the Json file with a sequence of the command scripts and configuration arguments",
22
+ ),
23
+ ) -> None:
24
+ """
25
+ Run a batch of scripts, in sequence, for BHE simulation.
26
+ """
27
+ run_batch_from_json(config_file_path)
28
+
29
+
30
+ @simulation.command(name="single-run")
31
+ def single_run(
32
+ config_file_path: str = typer.Argument(
33
+ ..., help="Path to the Json file with the main model configuration parameters"
34
+ ),
35
+ ) -> None:
36
+ """
37
+ Run main script for a single BHE simulation.
38
+ """
39
+ main_single_run_sim(config_file_path)
40
+
41
+
42
+ @simulation.command(name="stochastic-run")
43
+ def stochastic_run(
44
+ config_file_path: str = typer.Argument(
45
+ ..., help="Path to the Json file with the main model configuration parameters"
46
+ ),
47
+ ) -> None:
48
+ """
49
+ Run main script for a stochastic BHE simulation.
50
+ """
51
+ main_runmain(config_file_path)
52
+
53
+
54
+ @simulation.command(name="process-lithology")
55
+ def process_lithology(
56
+ config_file_path: str = typer.Argument(
57
+ ...,
58
+ help="Path to the Json file with the subsurface model configuration parameters",
59
+ ),
60
+ ) -> None:
61
+ """
62
+ Run main script for calculating and plotting subsurface thermal properties.
63
+ """
64
+ main_lithology(config_file_path)
65
+
66
+
67
+ @simulation.command(name="calculate-loadprofile")
68
+ def calculate_loadprofile(
69
+ config_file_path: str = typer.Argument(
70
+ ...,
71
+ help="Path to the Json file with the subsurface model configuration parameters",
72
+ ),
73
+ ) -> None:
74
+ """
75
+ Run main script for calculating a time-profile of heat load.
76
+ """
77
+ main_load_profile(config_file_path)
78
+
79
+
80
+ @simulation.command(name="calculate-flowdata")
81
+ def calculate_flowdata(
82
+ config_file_path: str = typer.Argument(
83
+ ..., help="Path to the Json file with the flow data configuration parameters"
84
+ ),
85
+ ) -> None:
86
+ """
87
+ Run main script for calculating a time-profile of flow rate.
88
+ """
89
+ main_flow_data(config_file_path)
90
+
91
+
92
+ @simulation.command(name="plot")
93
+ def plot_results(
94
+ config_file_path: str = typer.Argument(
95
+ ..., help="Path to the Json file with the plotting configuration parameters"
96
+ ),
97
+ ) -> None:
98
+ """
99
+ Run main script for plotting the simulation results.
100
+ """
101
+ main_plotmain(config_file_path)
102
+
103
+
104
+ if __name__ == "__main__":
105
+ simulation()