Coverage for cosmolayer / parser / dmol3.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-11 14:25 +0000

1"""DMol-3 COSMO file parser. 

2 

3This module provides functions to parse COSMO output files from DMol-3. 

4""" 

5 

6import re 

7 

8from .common import ( # noqa: F401 

9 ATOM_INFO_SCHEMA, 

10 ATOM_ROW_REGEX, 

11 SEGMENT_INFO_SCHEMA, 

12 SEGMENT_POSITION_CONVERSION_FACTOR, 

13 SEGMENT_ROW_REGEX, 

14) 

15 

16SEGMENT_SECTION_REGEX = re.compile( 

17 r"Segment information:.*?n\s+atom\s+position.*?potential\s*\n+((?:" 

18 + SEGMENT_ROW_REGEX.pattern 

19 + r"(?:\n|$))+)", 

20 re.MULTILINE | re.DOTALL, 

21) 

22 

23ATOM_SECTION_REGEX = re.compile( 

24 r"Molecular car file\s*:.*?!DATE[^\n]*\n((?:" 

25 + ATOM_ROW_REGEX.pattern 

26 + r"(?:\n|$))+)", 

27 re.MULTILINE | re.DOTALL, 

28) 

29 

30VOLUME_REGEX = re.compile(r"Total volume of cavity \(A\*\*3\)\s*=\s*(\d+(?:\.\d+)?)") 

31 

32ATOM_POSITION_CONVERSION_FACTOR = 1.0 

33VOLUME_CONVERSION_FACTOR = 1.0