Loading src/pythermogis/doublet_simulation/deterministic_doublet.py +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ from pythermogis import simulate_doublet from pythermogis.physics.temperature_grid_calculation import calculate_temperature_from_gradient from pythermogis.thermogis_classes.utc_properties import instantiate_utc_properties_builder def calculate_doublet_performance_deterministic(reservoir_properties: xr.Dataset, utc_properties = None, rng_seed = None) -> xr.Dataset: def calculate_doublet_performance(reservoir_properties: xr.Dataset, utc_properties = None, rng_seed = None) -> xr.Dataset: """ """ validate_input(reservoir_properties) Loading src/pythermogis/main.py +2 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import numpy as np import xarray as xr import typer from pythermogis import calculate_doublet_performance_deterministic from pythermogis import calculate_doublet_performance app = typer.Typer(pretty_exceptions_enable=False) Loading Loading @@ -44,7 +44,7 @@ def simulate_doublet( print("\n---simulation input---") print(input_data) output_data = calculate_doublet_performance_deterministic(input_data) output_data = calculate_doublet_performance(input_data) if verbose: print("\n---simulation output---") Loading tests/test_deterministic_doublet.py +22 −24 Original line number Diff line number Diff line from pythermogis import calculate_doublet_performance_deterministic from pythermogis import calculate_doublet_performance import xarray as xr def test_deterministic_doublet(): Loading @@ -11,39 +11,37 @@ def test_deterministic_doublet(): "permeability": 200 }) results1 = calculate_doublet_performance_deterministic(reservoir_properties) results2 = calculate_doublet_performance_deterministic(reservoir_properties) results1 = calculate_doublet_performance(reservoir_properties) results2 = calculate_doublet_performance(reservoir_properties) xr.testing.assert_equal(results1, results2) def test_deterministic_doublet_temperature_provided(): reservoir_properties = xr.Dataset( { "thickness": ((), 10), "porosity": ((), 0.5), "ntg": ((), 0.5), "depth": ((), 2000), "temperature": ((), 89), "permeability": ((), 200) reservoir_properties = xr.Dataset({ "thickness": 10, "porosity": 0.5, "ntg": 0.5, "depth": 2000, "temperature": 89, "permeability": 200 }) results1 = calculate_doublet_performance_deterministic(reservoir_properties) results2 = calculate_doublet_performance_deterministic(reservoir_properties) results1 = calculate_doublet_performance(reservoir_properties) results2 = calculate_doublet_performance(reservoir_properties) xr.testing.assert_equal(results1, results2) # assert that results are equal, showing no stochastic variations def test_deterministic_doublet_transmissivity_provided(): reservoir_properties = xr.Dataset( { "thickness": ((), 10), "porosity": ((), 0.5), "ntg": ((), 0.5), "depth": ((), 2000), "temperature": ((), 89), "transmissivity": ((), 2000), "permeability": ((), 200) reservoir_properties = xr.Dataset({ "thickness": 10, "porosity": 0.5, "ntg": 0.5, "depth": 2000, "temperature": 89, "transmissivity": 2000, "permeability": 200 }) results1 = calculate_doublet_performance_deterministic(reservoir_properties) results2 = calculate_doublet_performance_deterministic(reservoir_properties) results1 = calculate_doublet_performance(reservoir_properties) results2 = calculate_doublet_performance(reservoir_properties) xr.testing.assert_equal(results1, results2) # assert that results are equal, showing no stochastic variations No newline at end of file tests/test_doc_examples.py +1 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ def test_example_5(): output_data_path.mkdir(parents=True, exist_ok=True) # if set to True then simulation is always run, otherwise pre-calculated results are read (if available) run_simulation = False run_simulation = True # grids can be in .nc, .asc, .zmap or .tif format: see pygridsio package new_cellsize = 5000 # in m, this sets the resolution of the model; to speed up calcualtions you can increase the cellsize Loading Loading
src/pythermogis/doublet_simulation/deterministic_doublet.py +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ from pythermogis import simulate_doublet from pythermogis.physics.temperature_grid_calculation import calculate_temperature_from_gradient from pythermogis.thermogis_classes.utc_properties import instantiate_utc_properties_builder def calculate_doublet_performance_deterministic(reservoir_properties: xr.Dataset, utc_properties = None, rng_seed = None) -> xr.Dataset: def calculate_doublet_performance(reservoir_properties: xr.Dataset, utc_properties = None, rng_seed = None) -> xr.Dataset: """ """ validate_input(reservoir_properties) Loading
src/pythermogis/main.py +2 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import numpy as np import xarray as xr import typer from pythermogis import calculate_doublet_performance_deterministic from pythermogis import calculate_doublet_performance app = typer.Typer(pretty_exceptions_enable=False) Loading Loading @@ -44,7 +44,7 @@ def simulate_doublet( print("\n---simulation input---") print(input_data) output_data = calculate_doublet_performance_deterministic(input_data) output_data = calculate_doublet_performance(input_data) if verbose: print("\n---simulation output---") Loading
tests/test_deterministic_doublet.py +22 −24 Original line number Diff line number Diff line from pythermogis import calculate_doublet_performance_deterministic from pythermogis import calculate_doublet_performance import xarray as xr def test_deterministic_doublet(): Loading @@ -11,39 +11,37 @@ def test_deterministic_doublet(): "permeability": 200 }) results1 = calculate_doublet_performance_deterministic(reservoir_properties) results2 = calculate_doublet_performance_deterministic(reservoir_properties) results1 = calculate_doublet_performance(reservoir_properties) results2 = calculate_doublet_performance(reservoir_properties) xr.testing.assert_equal(results1, results2) def test_deterministic_doublet_temperature_provided(): reservoir_properties = xr.Dataset( { "thickness": ((), 10), "porosity": ((), 0.5), "ntg": ((), 0.5), "depth": ((), 2000), "temperature": ((), 89), "permeability": ((), 200) reservoir_properties = xr.Dataset({ "thickness": 10, "porosity": 0.5, "ntg": 0.5, "depth": 2000, "temperature": 89, "permeability": 200 }) results1 = calculate_doublet_performance_deterministic(reservoir_properties) results2 = calculate_doublet_performance_deterministic(reservoir_properties) results1 = calculate_doublet_performance(reservoir_properties) results2 = calculate_doublet_performance(reservoir_properties) xr.testing.assert_equal(results1, results2) # assert that results are equal, showing no stochastic variations def test_deterministic_doublet_transmissivity_provided(): reservoir_properties = xr.Dataset( { "thickness": ((), 10), "porosity": ((), 0.5), "ntg": ((), 0.5), "depth": ((), 2000), "temperature": ((), 89), "transmissivity": ((), 2000), "permeability": ((), 200) reservoir_properties = xr.Dataset({ "thickness": 10, "porosity": 0.5, "ntg": 0.5, "depth": 2000, "temperature": 89, "transmissivity": 2000, "permeability": 200 }) results1 = calculate_doublet_performance_deterministic(reservoir_properties) results2 = calculate_doublet_performance_deterministic(reservoir_properties) results1 = calculate_doublet_performance(reservoir_properties) results2 = calculate_doublet_performance(reservoir_properties) xr.testing.assert_equal(results1, results2) # assert that results are equal, showing no stochastic variations No newline at end of file
tests/test_doc_examples.py +1 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ def test_example_5(): output_data_path.mkdir(parents=True, exist_ok=True) # if set to True then simulation is always run, otherwise pre-calculated results are read (if available) run_simulation = False run_simulation = True # grids can be in .nc, .asc, .zmap or .tif format: see pygridsio package new_cellsize = 5000 # in m, this sets the resolution of the model; to speed up calcualtions you can increase the cellsize Loading