Coverage for C: \ Users \ peaco \ OneDrive \ Documents \ GitHub \ mt_metadata \ mt_metadata \ features \ registry.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-10 00:11 -0800

1# -*- coding: utf-8 -*- 

2""" 

3Feature registry module to avoid circular imports. 

4 

5This module defines the SUPPORTED_FEATURE_DICT that maps feature names to their classes. 

6It's separate from __init__.py to prevent circular import issues. 

7""" 

8 

9 

10def get_supported_feature_dict(): 

11 """ 

12 Get the supported feature dictionary with lazy imports to avoid circular dependencies. 

13 

14 Returns 

15 ------- 

16 dict 

17 Dictionary mapping feature names to feature classes 

18 """ 

19 # Import here to avoid circular dependencies 

20 from mt_metadata.features.coherence import Coherence 

21 from mt_metadata.features.cross_powers import CrossPowers 

22 from mt_metadata.features.feature_fc import FeatureFC 

23 from mt_metadata.features.feature_ts import FeatureTS 

24 from mt_metadata.features.striding_window_coherence import StridingWindowCoherence 

25 

26 return { 

27 "coherence": Coherence, 

28 "striding_window_coherence": StridingWindowCoherence, 

29 "cross_powers": CrossPowers, 

30 "feature_ts": FeatureTS, 

31 "feature_fc": FeatureFC, 

32 } 

33 

34 

35# For backward compatibility, we'll create the dictionary when this module is imported 

36# but using lazy imports 

37SUPPORTED_FEATURE_DICT = get_supported_feature_dict()