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

7 statements  

« prev     ^ index     » next       coverage.py v7.11.3, created at 2025-11-13 22:08 +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 

12from .base import Bounds 

13 

14 

15class NoBounds(Bounds): 

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

17 

18 Parameters 

19 ---------- 

20 lower 

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

22 upper 

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

24 unit 

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

26 ``dimensionless``. 

27 

28 Example 

29 ------- 

30 >>> import openxps as xps 

31 >>> import yaml 

32 >>> from openmm import unit 

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

34 >>> print(bounds) 

35 NoBounds(lower=0, upper=1, unit=dimensionless) 

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

37 """ 

38 

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

40 return f"{variable}" 

41 

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

43 return value, rate 

44 

45 

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