Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benchmarks/benchmark_rastermetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
"""

import math

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions benchmarks/benchmark_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
"""

import math

import numpy as np
Expand Down
7 changes: 6 additions & 1 deletion benchmarks/benchmark_solve_q.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
"""

import math

import numpy as np
import pytest

from itzi_core.compute.partial_inertia_q import set_solve_q_tile_size, get_solve_q_tile_size, solve_q
from itzi_core.compute.partial_inertia_q import (
set_solve_q_tile_size,
get_solve_q_tile_size,
solve_q,
)
from itzi_core.data_containers import SurfaceFlowParameters

NUM_CELLS_TO_SHAPE: dict[int, tuple[int, int]] = {
Expand Down
8 changes: 6 additions & 2 deletions benchmarks/benchmark_surface_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def benchmark_surface_flow_n_seconds(eggbox_simulation, n_seconds=30):


@pytest.mark.parametrize("num_cells", num_cells_params, ids=num_cells_ids)
@pytest.mark.parametrize("cell_size", [5], ids=["5m"]) # Set as parameter to get it in the output json
@pytest.mark.parametrize(
"cell_size", [5], ids=["5m"]
) # Set as parameter to get it in the output json
def test_benchmark_surface_flow_n_steps(benchmark, num_cells, cell_size, n_steps=10):
"""Run the benchmark for a given number of cells and cell size"""
eggbox_sim = setup_eggbox_simulation(num_cells=num_cells, cell_size=cell_size)
Expand All @@ -124,7 +126,9 @@ def test_benchmark_surface_flow_n_steps(benchmark, num_cells, cell_size, n_steps

@pytest.mark.parametrize("num_cells", num_cells_params, ids=num_cells_ids)
@pytest.mark.parametrize("cell_size", cell_size_params, ids=cell_size_ids)
@pytest.mark.parametrize("n_seconds", [30], ids=["30s"]) # Set as parameter to get it in the output json
@pytest.mark.parametrize(
"n_seconds", [30], ids=["30s"]
) # Set as parameter to get it in the output json
def test_benchmark_surface_flow_n_seconds(benchmark, num_cells, cell_size, n_seconds):
"""Run the benchmark for a given number of cells and cell size"""
results = []
Expand Down
7 changes: 6 additions & 1 deletion benchmarks/benchmark_update_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
"""

import math

import numpy as np
import pytest

from itzi_core.compute.partial_inertia_h import set_solve_h_tile_size, get_solve_h_tile_size, solve_h
from itzi_core.compute.partial_inertia_h import (
set_solve_h_tile_size,
get_solve_h_tile_size,
solve_h,
)
from itzi_core.data_containers import SurfaceFlowParameters

NUM_CELLS_TO_SHAPE: dict[int, tuple[int, int]] = {
Expand Down
1 change: 1 addition & 0 deletions benchmarks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
"""

pytest_plugins = ["tests.conftest"]
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,16 @@ def build_extensions(self):

extensions = [
Extension(
"itzi_core.compute.partial_inertia_h", sources=["src/itzi_core/compute/partial_inertia_h.pyx"]
"itzi_core.compute.partial_inertia_h",
sources=["src/itzi_core/compute/partial_inertia_h.pyx"],
),
Extension(
"itzi_core.compute.partial_inertia_q", sources=["src/itzi_core/compute/partial_inertia_q.pyx"]
"itzi_core.compute.partial_inertia_q",
sources=["src/itzi_core/compute/partial_inertia_q.pyx"],
),
Extension(
"itzi_core.compute.rastermetrics", sources=["src/itzi_core/compute/rastermetrics.pyx"]
),
Extension("itzi_core.compute.rastermetrics", sources=["src/itzi_core/compute/rastermetrics.pyx"]),
Extension("itzi_core.compute.hydrology", sources=["src/itzi_core/compute/hydrology.pyx"]),
Extension("itzi_core.compute.snippets", sources=["benchmarks/snippets.pyx"]),
]
Expand Down
1 change: 1 addition & 0 deletions src/itzi_core/messenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
"""

from typing import Callable, NoReturn
import sys
import logging
Expand Down
6 changes: 5 additions & 1 deletion src/itzi_core/simulation_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@

if TYPE_CHECKING:
from itzi_core.providers.domain_data import DomainData
from itzi_core.providers.base import RasterInputProvider, RasterOutputProvider, VectorOutputProvider
from itzi_core.providers.base import (
RasterInputProvider,
RasterOutputProvider,
VectorOutputProvider,
)
from itzi_core.data_containers import (
SimulationConfig,
HotstartSimulationState,
Expand Down
Loading