HTPolyNet 2.10.2__py3-none-any.whl → 2.10.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ libraries keep working rather than silently re-parameterizing wholesale.
18
18
  Author: Cameron F. Abrams <cfa22@drexel.edu>
19
19
  """
20
20
  import hashlib
21
+ import re
21
22
  import json
22
23
  import logging
23
24
  import os
@@ -34,6 +35,15 @@ _KEY_FIELDS = (
34
35
  )
35
36
  """Fields that determine the parameters, with human-readable labels."""
36
37
 
38
+ VERSION_FIELD = 'ambertools_version'
39
+ """Record field holding the AmberTools version that produced the parameters.
40
+
41
+ The same directives give different numbers under different AmberTools
42
+ releases, and htpolynet's CPU and CUDA images have not always shipped the same
43
+ one. Compared only when both the record and the current run know it, so
44
+ records written before it existed, or runs that cannot tell, still match.
45
+ """
46
+
37
47
  FRCMOD_FIELD = 'frcmod'
38
48
  """Record field holding a digest of the user frcmod files loaded after parmchk2's.
39
49
 
@@ -59,7 +69,19 @@ def frcmod_digest(frcmods):
59
69
  return h.hexdigest()[:16]
60
70
 
61
71
 
62
- def build_key(ambertools=None):
72
+ def ambertools_version():
73
+ """Returns the AmberTools version of the running installation, or None if unknown.
74
+
75
+ Returns:
76
+ str or None: version string, e.g. '26.0'
77
+ """
78
+ from ..external import software
79
+ v = software.versions.get('ambertools', '')
80
+ m = re.search(r'ver\.\s*([0-9][0-9A-Za-z.\-]*)', v or '')
81
+ return m.group(1) if m else None
82
+
83
+
84
+ def build_key(ambertools=None, version='detect'):
63
85
  """Returns the provenance record describing a parameterization run under
64
86
  the given AmberTools directives.
65
87
 
@@ -68,6 +90,8 @@ def build_key(ambertools=None):
68
90
 
69
91
  Args:
70
92
  ambertools (dict, optional): ambertools configuration directives
93
+ version (str, optional): AmberTools version to record; 'detect' (the default) asks the
94
+ running installation, and None records none
71
95
 
72
96
  Returns:
73
97
  dict: provenance record
@@ -79,6 +103,10 @@ def build_key(ambertools=None):
79
103
  digest = frcmod_digest(ambertools.get(FRCMOD_FIELD))
80
104
  if digest:
81
105
  key[FRCMOD_FIELD] = digest
106
+ if version == 'detect':
107
+ version = ambertools_version()
108
+ if version:
109
+ key[VERSION_FIELD] = version
82
110
  return key
83
111
 
84
112
 
@@ -158,6 +186,9 @@ def describe_mismatch(stored, requested):
158
186
  continue
159
187
  if stored[field] != requested.get(field):
160
188
  diffs.append(f'{label} {stored[field]!r} cached, {requested.get(field)!r} requested')
189
+ stored_v, requested_v = stored.get(VERSION_FIELD), requested.get(VERSION_FIELD)
190
+ if stored_v and requested_v and stored_v != requested_v:
191
+ diffs.append(f'AmberTools {stored_v} cached, {requested_v} running')
161
192
  # unlike the fields above, an absent frcmod digest is a statement: none was loaded
162
193
  if stored.get(FRCMOD_FIELD) != requested.get(FRCMOD_FIELD):
163
194
  diffs.append(f'user frcmod {stored.get(FRCMOD_FIELD) or "none"} cached, '
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: htpolynet
3
- Version: 2.10.2
3
+ Version: 2.10.3
4
4
  Summary: Automated MD System Builder for Amorphous Network Polymers
5
5
  Project-URL: Source, https://github.com/cameronabrams/htpolynet
6
6
  Project-URL: Documentation, https://htpolynet.readthedocs.io/
@@ -10,7 +10,7 @@ htpolynet/core/bondtemplate.py,sha256=_1vYMugonDuogysu15IsbpthvxYb6uJKC5ao7pQcWv
10
10
  htpolynet/core/configuration.py,sha256=RKnsVz_SX7GrCxuL-1rXP9AQ23EcFyiQSYeLiG6CHc4,5191
11
11
  htpolynet/core/coordinates.py,sha256=CGTHkdfw2ikc2ANacA5akRhZ9tOyM2IbELwQ2FVcKRw,23878
12
12
  htpolynet/core/molecule.py,sha256=M2IgRZrSqFFLzMvdk4qZLYo1veiWXkEhjN1uX8C4i-w,55359
13
- htpolynet/core/paramcache.py,sha256=A99VVqf1SdcdzoW5tEkRnN_GEPMjnw-1yy0J-S6FzJI,5660
13
+ htpolynet/core/paramcache.py,sha256=37S88gRXZ5_xAdWyUE-Q3Etxc5HMv8L_RHrykkq9YAs,6966
14
14
  htpolynet/core/projectfilesystem.py,sha256=2U_EToZxN7yUGWu9BIRABVsYdp1AKkOuManwuFBz89k,20983
15
15
  htpolynet/core/runtime.py,sha256=FQUHlU0SUPxAqcUnMZHhpLgNu8fa5zRmPy8kv5pv72w,62251
16
16
  htpolynet/core/topocoord.py,sha256=GfxOf04jAMYB6_vgj87kG9lXR0LVXwDHWetG5sv5AIA,109249
@@ -98,8 +98,8 @@ htpolynet/utils/logsetup.py,sha256=o0mlVXNzqcfua2SAlJPkGSh4lM_bmI10gWwpb9gqYu8,1
98
98
  htpolynet/utils/profiling.py,sha256=su7qpGEz6FXVU4KT2HQDWG82bc1sgsfpDQBbAfPpsHc,7331
99
99
  htpolynet/utils/stringthings.py,sha256=Mr6o55EM8o4YAaVYpjIJj2IxDToNdbPzb-lpQ3w3jFk,1176
100
100
  htpolynet/utils/vmd_viz.py,sha256=Crk3Ln88PKiJ9X7DMMkFEVh2Ru6a1y0RUgj3w6EIgFc,10867
101
- htpolynet-2.10.2.dist-info/METADATA,sha256=M2phMgBpu4Ry-usT-iLjtO6hhBfHhaVtMN5BlhAW6fc,6589
102
- htpolynet-2.10.2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
103
- htpolynet-2.10.2.dist-info/entry_points.txt,sha256=G5tx55llJf-IV9dIe7J8myGdyrhCVggCAhKrVNGP_s0,48
104
- htpolynet-2.10.2.dist-info/licenses/LICENSE,sha256=piPSGqJdmTGyzF9HOnjlO2KvgOKT8NHwhCuGYM778tY,1071
105
- htpolynet-2.10.2.dist-info/RECORD,,
101
+ htpolynet-2.10.3.dist-info/METADATA,sha256=dI_QAlcWsLtR57W9jXTcJN7sPOQ6xjmQFcsMc2qgmrw,6589
102
+ htpolynet-2.10.3.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
103
+ htpolynet-2.10.3.dist-info/entry_points.txt,sha256=G5tx55llJf-IV9dIe7J8myGdyrhCVggCAhKrVNGP_s0,48
104
+ htpolynet-2.10.3.dist-info/licenses/LICENSE,sha256=piPSGqJdmTGyzF9HOnjlO2KvgOKT8NHwhCuGYM778tY,1071
105
+ htpolynet-2.10.3.dist-info/RECORD,,