Inherits _ApoObject.
Public Member Functions | |
| None | __init__ (self, FilePaths paths) |
| Constructs an owning wrapper from one or more parameter files. | |
Owns a parsed native CHARMM parameter set.
Construct the wrapper from one path or from an ordered list or tuple of paths. Each path may be str, bytes, os.PathLike[str], or os.PathLike[bytes]. Arbitrary sequence types are not treated as multiple files. Path values are converted with os.fsencode, copied through the C ABI, and are not retained by the wrapper. File-name extensions are not validated.
The wrapper owns one C handle. close() and context-manager exit release that handle and are idempotent. Accessing handle, or passing the closed wrapper to an API that accesses it, raises RuntimeError. A native ForceManager created from this wrapper retains independent shared ownership of the parameter set.
The Python layer currently exposes construction and lifetime only; native parameter maps and incremental file loading are not exposed. Native status failures are raised as ApoCharmmError. The wrapper provides no internal synchronization for concurrent host access or closure.
| None apocharmm.charmm_parameters.CharmmParameters.__init__ | ( | self, | |
| FilePaths | paths | ||
| ) |
Constructs an owning wrapper from one or more parameter files.
A list or tuple is interpreted as an ordered file list. Every other accepted path object is interpreted as one file. All path values are encoded and copied before native parsing; this object does not retain the original Python path objects. File-name extensions are not validated.
| [in] | paths | One path, or a non-empty list or tuple of paths. Each path must be str, bytes, os.PathLike[str], or os.PathLike[bytes] and must encode to a non-empty native path. |
| TypeError | If paths, or an element of a list or tuple, cannot be converted by os.fsencode. |
| ApoCharmmError | If the native C ABI rejects an empty path or file list, cannot open or parse a file, or reports another native construction failure. |
| RuntimeError | If APOCHARMM_LIBRARY_PATH is unset or empty, or if the native function reports success but returns a NULL handle. |
| OSError | If the configured apoCHARMM C ABI shared library cannot be loaded. |