Coverage for python/gsfit/database_readers/freegs/setup_passives.py: 0%

10 statements  

« prev     ^ index     » next       coverage.py v7.15.0, created at 2026-07-07 13:12 +0000

1import typing 

2from typing import TYPE_CHECKING 

3 

4import freegs 

5import numpy as np 

6import numpy.typing as npt 

7from gsfit_rs import Passives 

8from st40_database import GetData 

9 

10if TYPE_CHECKING: 

11 from . import DatabaseReader 

12 

13 

14def setup_passives( 

15 self: "DatabaseReader", 

16 pulseNo: int, 

17 settings: dict[str, typing.Any], 

18 time: npt.NDArray[np.float64], 

19 freegs_eqs: list[freegs.equilibrium.Equilibrium], 

20) -> Passives: 

21 """ 

22 This method initialises the Rust `Passives` class. 

23 

24 :param pulseNo: Pulse number, used to read from the database 

25 :param settings: Dictionary containing the JSON settings read from the `settings` directory 

26 :param time: Measured time vector 

27 :param freegs_eqs: List of FreeGS equilibrium objects, one for each time-slice 

28 

29 **This method is specific to FreeGS.** 

30 

31 See `python/gsfit/database_readers/interface.py` for more details on how a new database_reader should be implemented. 

32 """ 

33 

34 # Initialise the Passives Rust class 

35 passives = Passives() 

36 

37 return passives