Skip to content

Commit

Permalink
test: add fixture for parameter mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
hellkite500 committed Aug 27, 2024
1 parent f977915 commit 819f17c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion python/ngen_cal/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

import pytest
from typing import Generator, List
from typing import Generator, List, Mapping
from pathlib import Path
from copy import deepcopy
import json
Expand All @@ -11,6 +13,7 @@
from ngen.cal.calibration_cathment import CalibrationCatchment
from ngen.cal.model import EvaluationOptions
from ngen.cal.agent import Agent
from ngen.cal.parameter import Parameter
from hypy import Nexus

from .utils import *
Expand Down Expand Up @@ -219,3 +222,12 @@ def explicit_catchments(nexus, fabric, workdir) -> Generator[ List[ CalibrationC
cat = CalibrationCatchment(workdir, id, nexus, start, end, fabric, 'Q_Out', eval_options, data)
catchments.append(cat)
yield catchments

@pytest.fixture
def multi_model_shared_params() -> Mapping[str, list[Parameter]]:
p1 = Parameter(name='a', min=0, max=1, init=0)
p2 = Parameter(name='a', min=0, max=1, init=0)

params = {'A':[p1], 'B':[p2]}

return params

0 comments on commit 819f17c

Please sign in to comment.