Coverage for openxps/bounds/circular.py: 100%
7 statements
« prev ^ index » next coverage.py v7.11.3, created at 2025-11-13 22:08 +0000
« prev ^ index » next coverage.py v7.11.3, created at 2025-11-13 22:08 +0000
1"""
2Circular boundary condition.
4.. module:: openxps.bounds.circular
5 :platform: Linux, MacOS, Windows
6 :synopsis: Circular boundary condition
8.. classauthor:: Charlles Abreu <craabreu@gmail.com>
10"""
12import numpy as np
13from openmm import unit as mmunit
15from .periodic import PeriodicBounds
18class CircularBounds(PeriodicBounds):
19 """
20 A circular boundary condition equivalent to PeriodicBounds(-π, π, radians).
22 This is a convenience class for the common case of a periodic boundary condition
23 spanning from -π to π radians, which corresponds to a full circle.
25 Parameters
26 ----------
27 lower, upper, unit
28 Optional arguments for internal use (e.g., during deserialization).
29 If not provided, defaults to -π, π, radians respectively.
31 Example
32 -------
33 >>> import openxps as xps
34 >>> bounds = xps.bounds.CircularBounds()
35 >>> bounds.lower == -3.141592653589793
36 True
37 >>> bounds.upper == 3.141592653589793
38 True
39 >>> bounds.unit == xps.bounds.CircularBounds().unit
40 True
41 """
43 def __init__(self, *_) -> None:
44 super().__init__(-np.pi, np.pi, mmunit.radians)
47CircularBounds.registerTag("!openxps.bounds.CircularBounds")