diffusivity-step 2026.3.1__tar.gz → 2026.3.26__tar.gz

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.
Files changed (51) hide show
  1. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/HISTORY.rst +11 -0
  2. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/PKG-INFO +12 -1
  3. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/_version.py +3 -3
  4. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/diffusivity.py +71 -40
  5. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step.egg-info/PKG-INFO +12 -1
  6. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/AUTHORS.rst +0 -0
  7. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/CONTRIBUTING.rst +0 -0
  8. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/LICENSE +0 -0
  9. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/MANIFEST.in +0 -0
  10. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/README.rst +0 -0
  11. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/__init__.py +0 -0
  12. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/analysis.py +0 -0
  13. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/data/properties.csv +0 -0
  14. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/data/references.bib +0 -0
  15. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/diffusivity_parameters.py +0 -0
  16. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/diffusivity_step.py +0 -0
  17. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/metadata.py +0 -0
  18. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step/tk_diffusivity.py +0 -0
  19. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step.egg-info/SOURCES.txt +0 -0
  20. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step.egg-info/dependency_links.txt +0 -0
  21. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step.egg-info/entry_points.txt +0 -0
  22. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step.egg-info/requires.txt +0 -0
  23. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step.egg-info/top_level.txt +0 -0
  24. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/diffusivity_step.egg-info/zip-safe +0 -0
  25. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/Makefile +0 -0
  26. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/_static/SEAMM Inverted 288x181.png +0 -0
  27. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/_static/SEAMM logo.png +0 -0
  28. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/_static/molssi_main_logo.png +0 -0
  29. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/_static/molssi_main_logo_inverted_white.png +0 -0
  30. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/_static/molssi_square.png +0 -0
  31. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/_static/nsf.png +0 -0
  32. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/api/index.rst +0 -0
  33. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/authors.rst +0 -0
  34. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/conf.py +0 -0
  35. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/developer_guide/contributing.rst +0 -0
  36. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/developer_guide/index.rst +0 -0
  37. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/developer_guide/installation.rst +0 -0
  38. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/developer_guide/usage.rst +0 -0
  39. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/getting_started/index.rst +0 -0
  40. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/history.rst +0 -0
  41. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/index.rst +0 -0
  42. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/make.bat +0 -0
  43. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/docs/user_guide/index.rst +0 -0
  44. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/requirements.txt +0 -0
  45. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/requirements_dev.txt +0 -0
  46. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/requirements_install.txt +0 -0
  47. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/setup.cfg +0 -0
  48. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/setup.py +0 -0
  49. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/tests/__init__.py +0 -0
  50. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/tests/test_diffusivity_step.py +0 -0
  51. {diffusivity_step-2026.3.1 → diffusivity_step-2026.3.26}/versioneer.py +0 -0
@@ -1,6 +1,17 @@
1
1
  =======
2
2
  History
3
3
  =======
4
+ 2026.3.26 -- Bugfix: Corrected handling of viscosity <= 0.0
5
+ * Ignore the hydrostatic correction if the given viscosity is less than or equal
6
+ to 0. This allows a flowchart to work more simply whether the viscosity os know or
7
+ not.
8
+
9
+ 2026.3.15 -- Fixed an error with MLFFs and protected the viscosity correction.
10
+ * Fixed and error with the name of the MLFF, which caused the code to crash after
11
+ printing the results but before ending.
12
+ * Protected the hydrodynamic correction using the viscosity if the viscosity given
13
+ is zero or less, in which case the correction is ignored.
14
+
4
15
  2026.3.1 -- Internal: switching from deprecated library pkg_resources to importlib
5
16
 
6
17
  2026.1.8 -- Enhancement to use atomic position and velocity trajectories
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffusivity_step
3
- Version: 2026.3.1
3
+ Version: 2026.3.26
4
4
  Summary: A SEAMM plug-in for Diffusivity
5
5
  Home-page: https://github.com/molssi-seamm/diffusivity_step
6
6
  Author: Paul Saxe
@@ -103,6 +103,17 @@ award CHE-2136142.
103
103
  =======
104
104
  History
105
105
  =======
106
+ 2026.3.26 -- Bugfix: Corrected handling of viscosity <= 0.0
107
+ * Ignore the hydrostatic correction if the given viscosity is less than or equal
108
+ to 0. This allows a flowchart to work more simply whether the viscosity os know or
109
+ not.
110
+
111
+ 2026.3.15 -- Fixed an error with MLFFs and protected the viscosity correction.
112
+ * Fixed and error with the name of the MLFF, which caused the code to crash after
113
+ printing the results but before ending.
114
+ * Protected the hydrodynamic correction using the viscosity if the viscosity given
115
+ is zero or less, in which case the correction is ignored.
116
+
106
117
  2026.3.1 -- Internal: switching from deprecated library pkg_resources to importlib
107
118
 
108
119
  2026.1.8 -- Enhancement to use atomic position and velocity trajectories
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2026-03-01T13:12:21-0500",
11
+ "date": "2026-03-26T16:34:55-0400",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "88247e4719cc4cec9be7b9016ad9ff464dac4e74",
15
- "version": "2026.3.1"
14
+ "full-revisionid": "c1323930ff2d5200be364ea83294d42f3d571175",
15
+ "version": "2026.3.26"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -12,7 +12,7 @@ import time
12
12
  import traceback
13
13
 
14
14
  import numpy as np
15
- from tabulate import tabulate
15
+ import tabulate
16
16
 
17
17
  from .analysis import (
18
18
  read_dump_trajectory,
@@ -163,7 +163,7 @@ class Diffusivity(seamm.Node):
163
163
  ("x", "red", "rgba(255,0,0,0.1)"),
164
164
  ("y", "green", "rgba(0,255,0,0.1)"),
165
165
  ("z", "blue", "rgba(0,0,255,0.1)"),
166
- ("", "black", "rgba(0,0,0,0.1)"),
166
+ (" ", "black", "rgba(0,0,0,0.1)"),
167
167
  ]
168
168
 
169
169
  self._configuration = None # The initial configuration
@@ -274,7 +274,7 @@ class Diffusivity(seamm.Node):
274
274
 
275
275
  # If requested, calculate the Yeh-Hummer correction for cell size
276
276
  correction = None
277
- if P["hydrodynamic correction"]:
277
+ if P["hydrodynamic correction"] and P["viscosity"] > 0:
278
278
  if "T" in self._state_vars:
279
279
  T = self._state["T"][-1]
280
280
  if "a" in self._state_vars:
@@ -301,16 +301,16 @@ class Diffusivity(seamm.Node):
301
301
 
302
302
  table = {
303
303
  "Run": [],
304
- "Method": [],
304
+ " Method ": [],
305
305
  "Species": [],
306
- "Dx": [],
307
- "ex": [],
308
- "Dy": [],
309
- "ey": [],
310
- "Dz": [],
311
- "ez": [],
312
- "D": [],
313
- "e": [],
306
+ " Dx ": [],
307
+ " ex ": [],
308
+ " Dy ": [],
309
+ " ey ": [],
310
+ " Dz ": [],
311
+ " ez ": [],
312
+ " D ": [],
313
+ " e ": [],
314
314
  }
315
315
  if correction is not None:
316
316
  table["Correction"] = []
@@ -448,16 +448,16 @@ class Diffusivity(seamm.Node):
448
448
  value = round(value, 1)
449
449
  var = var.replace(",stderr", " ±")
450
450
  table[var].append(value)
451
- table["Method"].append("MSD")
451
+ table[" Method "].append("MSD".center(20))
452
452
  else:
453
453
  table["Run"].append("")
454
454
  if correction is not None:
455
455
  table["Correction"].append("")
456
- table["Method"].append("")
456
+ table[" Method "].append("")
457
457
  table["Species"].append(smiles)
458
458
  alpha = self._tensor_labels[i][0]
459
- table["D" + alpha].append(v)
460
- table["e" + alpha].append("")
459
+ table[" D" + alpha + " "].append(v)
460
+ table[" e" + alpha + " "].append("")
461
461
 
462
462
  add_msd_trace(
463
463
  plot,
@@ -635,14 +635,16 @@ class Diffusivity(seamm.Node):
635
635
  value = round(value, 1)
636
636
  var = var.replace(",stderr", " ±")
637
637
  table[var].append(value)
638
- table["Method"].append("Helfand Moments")
638
+ table[" Method "].append(
639
+ "Helfand Moments".center(20)
640
+ )
639
641
  else:
640
642
  table["Run"].append("")
641
- table["Method"].append("")
643
+ table[" Method "].append("")
642
644
  table["Species"].append(smiles)
643
645
  alpha = self._tensor_labels[i][0]
644
- table["D" + alpha].append(v)
645
- table["e" + alpha].append("")
646
+ table[" D" + alpha + " "].append(v)
647
+ table[" e" + alpha + " "].append("")
646
648
 
647
649
  add_helfand_trace(
648
650
  plot,
@@ -687,19 +689,23 @@ class Diffusivity(seamm.Node):
687
689
  table[var].append(t_v)
688
690
  table[var + " ±"].append(t_e)
689
691
  if self._use_velocity:
690
- table["Method"].append("Current MSD Estimate")
692
+ table[" Method "].append(
693
+ "Current MSD Estimate"
694
+ )
691
695
  else:
692
- table["Method"].append("Current Estimate")
696
+ table[" Method "].append(
697
+ "Current Estimate".center(20)
698
+ )
693
699
  else:
694
700
  table["Run"].append("")
695
- table["Method"].append("")
701
+ table[" Method "].append("")
696
702
  table["Species"].append(smiles)
697
703
 
698
704
  mean = msd_data["mean"][smiles][i][-1]
699
705
  stderr = msd_data["stderr"][smiles][i][-1]
700
706
  alpha = self._tensor_labels[i][0]
701
- table["D" + alpha].append(mean)
702
- table["e" + alpha].append(stderr)
707
+ table[" D" + alpha + " "].append(mean)
708
+ table[" e" + alpha + " "].append(stderr)
703
709
  if self._use_velocity:
704
710
  if i == 0:
705
711
  if spec == 0:
@@ -717,12 +723,16 @@ class Diffusivity(seamm.Node):
717
723
  table[var].append(t_v)
718
724
  table[var + " ±"].append(t_e)
719
725
  if self._use_msd:
720
- table["Method"].append("Current HM Estimate")
726
+ table[" Method "].append(
727
+ "Current HM Estimate".center(20)
728
+ )
721
729
  else:
722
- table["Method"].append("Current Estimate")
730
+ table[" Method "].append(
731
+ "Current Estimate".center(20)
732
+ )
723
733
  else:
724
734
  table["Run"].append("")
725
- table["Method"].append("")
735
+ table[" Method "].append("")
726
736
  table["Species"].append(smiles)
727
737
 
728
738
  mean = M_data["mean"][smiles][i][-1]
@@ -746,10 +756,12 @@ class Diffusivity(seamm.Node):
746
756
  )
747
757
  table[var].append(t_v)
748
758
  table[var + " ±"].append(t_e)
749
- table["Method"].append("Combined Estimate")
759
+ table[" Method "].append(
760
+ "Combined Estimate".center(20)
761
+ )
750
762
  else:
751
763
  table["Run"].append("")
752
- table["Method"].append("")
764
+ table[" Method "].append("")
753
765
  table["Species"].append(smiles)
754
766
 
755
767
  mean = M_data["combined mean"][smiles][i][-1]
@@ -760,13 +772,21 @@ class Diffusivity(seamm.Node):
760
772
 
761
773
  # Print the table of results
762
774
  text = ""
763
- tmp = tabulate(
775
+ tabulate.PRESERVE_WHITESPACE = True
776
+ tmp = tabulate.tabulate(
764
777
  table,
765
778
  headers="keys",
766
779
  tablefmt="rounded_outline",
767
780
  disable_numparse=True,
768
781
  )
769
- if run == 1:
782
+ tabulate.PRESERVE_WHITESPACE = False
783
+ if False:
784
+ length = len(tmp.splitlines()[0])
785
+ text += "\n"
786
+ text += f"Diffusion Coefficients (* {self._scale:.1e} m^2/s)".center(length)
787
+ text += "\n"
788
+ text += tmp
789
+ elif run == 1:
770
790
  length = len(tmp.splitlines()[0])
771
791
  text += "\n"
772
792
  text += f"Diffusion Coefficients (* {self._scale:.1e} m^2/s)".center(length)
@@ -870,7 +890,7 @@ class Diffusivity(seamm.Node):
870
890
  err = round(e * self._scale, decimals)
871
891
  table["Species"].append(smiles if i == 0 else "")
872
892
  table["Method"].append("MSD" if i == 0 else "")
873
- if self._tensor_labels[i][0] == "":
893
+ if self._tensor_labels[i][0] == " ":
874
894
  table["Dir"].append("total")
875
895
  if "D {key} (MSD)" in self.results:
876
896
  self.results["D {key} (MSD)"][smiles] = d_coeff
@@ -922,7 +942,7 @@ class Diffusivity(seamm.Node):
922
942
  err = round(e * self._scale, decimals)
923
943
  table["Species"].append(smiles if i == 0 else "")
924
944
  table["Method"].append("Helfand Moments" if i == 0 else "")
925
- if self._tensor_labels[i][0] == "":
945
+ if self._tensor_labels[i][0] == " ":
926
946
  table["Dir"].append("total")
927
947
  if "D {key} (HM)" in self.results:
928
948
  self.results["D {key} (HM)"][smiles] = d_coeff
@@ -974,7 +994,7 @@ class Diffusivity(seamm.Node):
974
994
  err = round(e * self._scale, decimals)
975
995
  table["Species"].append(smiles if i == 0 else "")
976
996
  table["Method"].append("Combined" if i == 0 else "")
977
- if self._tensor_labels[i][0] == "":
997
+ if self._tensor_labels[i][0] == " ":
978
998
  table["Dir"].append("total")
979
999
  if "D {key}" in self.results:
980
1000
  self.results["D {key}"][smiles] = d_coeff
@@ -1007,7 +1027,7 @@ class Diffusivity(seamm.Node):
1007
1027
 
1008
1028
  # If requested, calculate the Yeh-Hummer correction for cell size
1009
1029
  correction = None
1010
- if P["hydrodynamic correction"]:
1030
+ if P["hydrodynamic correction"] and P["viscosity"] > 0:
1011
1031
  if "T" in self._state_vars:
1012
1032
  T = self._state["T"][-1]
1013
1033
  if "a" in self._state_vars:
@@ -1031,7 +1051,8 @@ class Diffusivity(seamm.Node):
1031
1051
  table["95%"].append("")
1032
1052
 
1033
1053
  text = ""
1034
- tmp = tabulate(
1054
+ tabulate.PRESERVE_WHITESPACE = True
1055
+ tmp = tabulate.tabulate(
1035
1056
  table,
1036
1057
  headers="keys",
1037
1058
  tablefmt="rounded_outline",
@@ -1044,6 +1065,7 @@ class Diffusivity(seamm.Node):
1044
1065
  "decimal",
1045
1066
  ),
1046
1067
  )
1068
+ tabulate.PRESERVE_WHITESPACE = False
1047
1069
  length = len(tmp.splitlines()[0])
1048
1070
  text += "\n"
1049
1071
  text += f"Diffusion Coefficients (* {self._scale:.1e} m^2/s)".center(length)
@@ -1057,6 +1079,8 @@ class Diffusivity(seamm.Node):
1057
1079
  ff = self.get_variable("_forcefield")
1058
1080
  if ff == "OpenKIM":
1059
1081
  self._model = "OpenKIM/" + self.get_variable("_OpenKIM_Potential")
1082
+ elif ff == "PyTorch":
1083
+ self._model = "PyTorch/" + self.get_variable("_pytorch_model")
1060
1084
  else:
1061
1085
  # Valence forcefield...
1062
1086
  self._model = ff.current_forcefield
@@ -1140,12 +1164,19 @@ class Diffusivity(seamm.Node):
1140
1164
  )
1141
1165
 
1142
1166
  correction = P["hydrodynamic correction"]
1167
+ viscosity = P["viscosity"]
1168
+ if not self.is_expr(viscosity):
1169
+ try:
1170
+ if viscosity.magnitude <= 0:
1171
+ correction = "no"
1172
+ except Exception:
1173
+ pass
1143
1174
 
1144
1175
  if isinstance(correction, str) and self.is_expr(correction):
1145
1176
  text += (
1146
1177
  f" The expression '{correction}' will determine whether to use the "
1147
1178
  "Yeh-Hummer hydrodynamic correction for the finite cell size using "
1148
- f"a viscosity of {P['viscosity']}."
1179
+ f"a viscosity of {viscosity}."
1149
1180
  )
1150
1181
  else:
1151
1182
  if isinstance(correction, str):
@@ -1154,7 +1185,7 @@ class Diffusivity(seamm.Node):
1154
1185
  text += (
1155
1186
  " The calculated diffusivity will be corrected for the finite cell "
1156
1187
  "size using the Yeh-Hummer hydrodynamic correction using "
1157
- f"a viscosity of {P['viscosity']}."
1188
+ f"a viscosity of {viscosity}."
1158
1189
  )
1159
1190
 
1160
1191
  text += "\n\n"
@@ -1269,7 +1300,7 @@ class Diffusivity(seamm.Node):
1269
1300
  f"{100*len(x)/self.n_molecules:.2f}" for x in self.species.values()
1270
1301
  ],
1271
1302
  }
1272
- tmp = tabulate(
1303
+ tmp = tabulate.tabulate(
1273
1304
  table,
1274
1305
  headers="keys",
1275
1306
  tablefmt="simple_outline",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffusivity_step
3
- Version: 2026.3.1
3
+ Version: 2026.3.26
4
4
  Summary: A SEAMM plug-in for Diffusivity
5
5
  Home-page: https://github.com/molssi-seamm/diffusivity_step
6
6
  Author: Paul Saxe
@@ -103,6 +103,17 @@ award CHE-2136142.
103
103
  =======
104
104
  History
105
105
  =======
106
+ 2026.3.26 -- Bugfix: Corrected handling of viscosity <= 0.0
107
+ * Ignore the hydrostatic correction if the given viscosity is less than or equal
108
+ to 0. This allows a flowchart to work more simply whether the viscosity os know or
109
+ not.
110
+
111
+ 2026.3.15 -- Fixed an error with MLFFs and protected the viscosity correction.
112
+ * Fixed and error with the name of the MLFF, which caused the code to crash after
113
+ printing the results but before ending.
114
+ * Protected the hydrodynamic correction using the viscosity if the viscosity given
115
+ is zero or less, in which case the correction is ignored.
116
+
106
117
  2026.3.1 -- Internal: switching from deprecated library pkg_resources to importlib
107
118
 
108
119
  2026.1.8 -- Enhancement to use atomic position and velocity trajectories