Skip to content

Commit 848e961

Browse files
committed
fix for circular imports in type checking
1 parent 6a0b3b9 commit 848e961

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

py_replay_bg/model/t1d_model_multi_meal.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# This fixes circular imports for type checking
2+
from __future__ import annotations
3+
from typing import TYPE_CHECKING
4+
if TYPE_CHECKING:
5+
from py_replay_bg.replay.custom_ra import CustomRaBase
6+
17
import numpy as np
28
import pandas as pd
39

@@ -19,7 +25,6 @@
1925
from py_replay_bg.data import ReplayBGData
2026
from py_replay_bg.environment import Environment
2127
from py_replay_bg.dss import DSS
22-
from py_replay_bg.replay.custom_ra import CustomRaBase
2328
from py_replay_bg.sensors import Sensors
2429

2530

@@ -414,7 +419,7 @@ def simulate(self,
414419
environment: Environment | None,
415420
dss: DSS | None,
416421
sensors: Sensors = None,
417-
forcing_Ra: CustomRaBase = None
422+
forcing_Ra: CustomRaBase | None = None
418423
) -> np.ndarray | tuple[
419424
np.ndarray,
420425
np.ndarray,

0 commit comments

Comments
 (0)