Coverage for physped/core/distribution_approximator.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-01 09:28 +0000

1"""Module for a with distribution approximation classes.""" 

2 

3import logging 

4from dataclasses import dataclass 

5from typing import Callable, Tuple 

6 

7from scipy.stats import norm 

8 

9log = logging.getLogger(__name__) 

10 

11 

12@dataclass 

13class DistApproximation: 

14 """A class for the distribution approximation of the potential.""" 

15 

16 fit_dimensions: Tuple[str, ...] 

17 fit_parameters: Tuple[str, ...] 

18 function: Callable 

19 

20 

21class GaussianApproximation(DistApproximation): 

22 def __init__(self): 

23 predefined_kwargs = { 

24 "fit_dimensions": ("x", "y", "u", "v"), 

25 "fit_parameters": ("mu", "sigma"), 

26 "function": norm.fit, 

27 } 

28 super().__init__(**predefined_kwargs)