apoCHARMM 1.0.0
High-performance molecular dynamics simulations on GPUs
 
Loading...
Searching...
No Matches
apocharmm.charmm_parameters.CharmmParameters Class Reference

More...

Inherits _ApoObject.

Public Member Functions

None __init__ (self, FilePaths paths)
 Constructs an owning wrapper from one or more parameter files.
 

Detailed Description

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.

See also
charmm_parameters

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
[in]pathsOne 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.
Exceptions
TypeErrorIf paths, or an element of a list or tuple, cannot be converted by os.fsencode.
ApoCharmmErrorIf the native C ABI rejects an empty path or file list, cannot open or parse a file, or reports another native construction failure.
RuntimeErrorIf APOCHARMM_LIBRARY_PATH is unset or empty, or if the native function reports success but returns a NULL handle.
OSErrorIf the configured apoCHARMM C ABI shared library cannot be loaded.
Postcondition
On success, this wrapper owns a live native parameter handle.
Warning
An encoded path containing an embedded null byte is currently truncated at that byte by the C-string boundary instead of being rejected; see CharmmParameters.