Coverage for openxps/bounds/no_bounds.py: 100%

9 statements  

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

1""" 

2No boundary condition. 

3 

4.. module:: openxps.bounds.no_bounds 

5 :platform: Linux, MacOS, Windows 

6 :synopsis: No boundary condition 

7 

8.. classauthor:: Charlles Abreu <craabreu@gmail.com> 

9 

10""" 

11 

12import typing as t 

13 

14from .base import Bounds 

15 

16 

17class NoBounds(Bounds): 

18 """Boundary condition indicating no confinement for a dynamical variable. 

19 

20 Parameters 

21 ---------- 

22 lower 

23 A typical low value for the dynamical variable, not an actual bound. 

24 upper 

25 A typical high value for the dynamical variable, not an actual bound. 

26 unit 

27 The unit of measurement of the bounds. If the bounds do not have a unit, use 

28 ``dimensionless``. 

29 

30 Example 

31 ------- 

32 >>> import openxps as xps 

33 >>> import yaml 

34 >>> from openmm import unit 

35 >>> bounds = xps.NoBounds(0, 1, unit.dimensionless) 

36 >>> print(bounds) 

37 NoBounds(lower=0.0, upper=1.0, unit=dimensionless) 

38 >>> assert yaml.safe_load(yaml.safe_dump(bounds)) == bounds 

39 """ 

40 

41 kind: t.ClassVar[str] = "none" 

42 

43 def leptonExpression(self, variable: str) -> str: 

44 return f"{variable}" 

45 

46 def wrap(self, value: float, rate: float) -> tuple[float, float]: 

47 return value, rate 

48 

49 

50NoBounds.registerTag("!openxps.bounds.NoBounds")