Coverage for python/gsfit/database_readers/st40_mdsplus/setup_pressure_sensors.py: 0%

7 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-14 15:25 +0000

1import typing 

2from typing import TYPE_CHECKING 

3 

4from gsfit_rs import Pressure 

5 

6# The Thomson scattering (TS) tree reading and the PPTS `BAD_MA` "good time-slice" logic live in the 

7# `st40_mdsplus_with_digital_filter` reader. It is reused here so that the pressure-sensor set-up is 

8# defined in a single place (it depends only on `sensor_weights_pressure.json`, not on the digital 

9# filter), which keeps both ST40 readers consistent and avoids duplicated boiler-plate. 

10from ..st40_mdsplus_with_digital_filter.setup_pressure_sensors import get_good_pressure_sensor_times as get_good_pressure_sensor_times 

11from ..st40_mdsplus_with_digital_filter.setup_pressure_sensors import setup_pressure_sensors as _setup_pressure_sensors 

12 

13if TYPE_CHECKING: 

14 from ..st40_mdsplus_with_digital_filter import DatabaseReader 

15 

16 

17def setup_pressure_sensors( 

18 self: "DatabaseReader", 

19 pulseNo: int, 

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

21) -> Pressure: 

22 """ 

23 This method initialises the Rust `Pressure` class using ST40's Thomson scattering (TS) data. 

24 

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

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

27 

28 **This method is specific to ST40's experimental MDSplus database.** 

29 

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

31 """ 

32 

33 return _setup_pressure_sensors(self, pulseNo, settings)