Skip to content

Commit 131a68d

Browse files
committed
merging updates from main
2 parents 53648e0 + 6e0bc3e commit 131a68d

14 files changed

Lines changed: 575 additions & 410 deletions

File tree

‎CodeEntropy/entropy/nodes/configurational.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def run(self, shared_data: MutableMapping[str, Any], **_: Any) -> dict[str, Any]
5353
fragments = universe.atoms.fragments
5454
results: dict[int, dict[str, float]] = {}
5555

56-
for group_id, mol_ids in groups.items():
56+
for group_id, mol_ids in sorted(groups.items()):
5757
results[group_id] = {"ua": 0.0, "res": 0.0, "poly": 0.0}
5858
if not mol_ids:
5959
continue

‎CodeEntropy/entropy/nodes/orientational.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def run(self, shared_data: MutableMapping[str, Any], **_: Any) -> dict[str, Any]
5252

5353
results: dict[int, float] = {}
5454

55-
for group_id, mol_ids in groups.items():
55+
for group_id, mol_ids in sorted(groups.items()):
5656
results[group_id] = 0
5757
if not mol_ids:
5858
continue

‎CodeEntropy/entropy/nodes/vibrational.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def run(self, shared_data: MutableMapping[str, Any], **_: Any) -> dict[str, Any]
9090

9191
results: dict[int, dict[str, dict[str, float]]] = {}
9292

93-
for group_id, mol_ids in groups.items():
93+
for group_id, mol_ids in sorted(groups.items()):
9494
results[group_id] = {}
9595
if not mol_ids:
9696
continue
@@ -198,7 +198,7 @@ def _get_group_id_to_index(self, shared_data: Mapping[str, Any]) -> dict[int, in
198198
if isinstance(gid2i, dict) and gid2i:
199199
return gid2i
200200
groups = shared_data["groups"]
201-
return {gid: i for i, gid in enumerate(groups.keys())}
201+
return {gid: i for i, gid in enumerate(sorted(groups.keys()))}
202202

203203
def _get_ua_frame_counts(self, shared_data: Mapping[str, Any]) -> dict[CovKey, int]:
204204
"""Extract per-(group,residue) frame counts for united-atom covariances.

‎CodeEntropy/entropy/workflow.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,15 @@ def _split_water_groups(
303303

304304
water_groups = {
305305
gid: mol_ids
306-
for gid, mol_ids in groups.items()
306+
for gid, mol_ids in sorted(groups.items())
307307
if any(
308308
res.resid in water_resids
309309
for mol in [universe.atoms.fragments[i] for i in mol_ids]
310310
for res in mol.residues
311311
)
312312
}
313313
nonwater_groups = {
314-
gid: g for gid, g in groups.items() if gid not in water_groups
314+
gid: g for gid, g in sorted(groups.items()) if gid not in water_groups
315315
}
316316
return nonwater_groups, water_groups
317317

@@ -364,7 +364,7 @@ def _finalize_molecule_results(self) -> None:
364364
except (TypeError, ValueError):
365365
logger.warning("Skipping invalid entry: %s, %s", group_id, result)
366366

367-
for group_id, total in entropy_by_group.items():
367+
for group_id, total in sorted(entropy_by_group.items()):
368368
self._reporter.molecule_data.append(
369369
(group_id, "Group Total", "Group Total Entropy", total)
370370
)

‎CodeEntropy/levels/nodes/covariance.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def run(self, ctx: FrameCtx) -> dict[str, Any]:
9393
res_molcount: dict[int, int] = {}
9494
poly_molcount: dict[int, int] = {}
9595

96-
for group_id, mol_ids in groups.items():
96+
for group_id, mol_ids in sorted(groups.items()):
9797
for mol_id in mol_ids:
9898
mol = fragments[mol_id]
9999
level_list = levels[mol_id]

0 commit comments

Comments
 (0)