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
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-22 22:23 +0000
1"""
2No boundary condition.
4.. module:: openxps.bounds.no_bounds
5 :platform: Linux, MacOS, Windows
6 :synopsis: No boundary condition
8.. classauthor:: Charlles Abreu <craabreu@gmail.com>
10"""
12import typing as t
14from .base import Bounds
17class NoBounds(Bounds):
18 """Boundary condition indicating no confinement for a dynamical variable.
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``.
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 """
41 kind: t.ClassVar[str] = "none"
43 def leptonExpression(self, variable: str) -> str:
44 return f"{variable}"
46 def wrap(self, value: float, rate: float) -> tuple[float, float]:
47 return value, rate
50NoBounds.registerTag("!openxps.bounds.NoBounds")