@@ -35,6 +35,7 @@ class WaterEntropyInput:
3535 end : int
3636 step : int
3737 temperature : float
38+ parallel : bool
3839 group_id : int | None = None
3940
4041
@@ -53,7 +54,7 @@ def __init__(
5354 self ,
5455 args : Any ,
5556 reporter : Any ,
56- solver : Callable [..., tuple [dict , Any , Any , Any , Any ]] = (
57+ solver : Callable [..., tuple [dict , Any , Any , Any , Any , Any ]] = (
5758 GetSolvent .get_interfacial_water_orient_entropy
5859 ),
5960 ) -> None :
@@ -77,6 +78,7 @@ def calculate_and_log(
7778 start : int ,
7879 end : int ,
7980 step : int ,
81+ parallel : bool ,
8082 group_id : int | None = None ,
8183 ) -> None :
8284 """Compute water entropy and write results to the data logger.
@@ -95,6 +97,7 @@ def calculate_and_log(
9597 step = step ,
9698 temperature = float (self ._args .temperature ),
9799 group_id = group_id ,
100+ parallel = parallel ,
98101 )
99102 self ._calculate_and_log_from_inputs (inputs )
100103
@@ -119,18 +122,19 @@ def _run_solver(self, inputs: WaterEntropyInput):
119122 Tuple of solver outputs.
120123 """
121124 logger .info (
122- "[WaterEntropy] Computing water entropy (start=%s, end=%s, step=%s)" ,
125+ "[WaterEntropy] Computing water entropy (start=%s, end=%s, step=%s, parallel=%s )" ,
123126 inputs .start ,
124127 inputs .end ,
125128 inputs .step ,
129+ inputs .parallel ,
126130 )
127131 return self ._solver (
128132 inputs .universe ,
129133 inputs .start ,
130134 inputs .end ,
131135 inputs .step ,
132136 inputs .temperature ,
133- parallel = True ,
137+ inputs . parallel ,
134138 )
135139
136140 def _log_orientational_entropy (
@@ -144,8 +148,9 @@ def _log_orientational_entropy(
144148 """
145149 for _resid , resname_dict in Sorient_dict .items ():
146150 for resname , values in resname_dict .items ():
147- if isinstance (values , list ) and len (values ) == 2 :
148- entropy , count = values
151+ if isinstance (values , dict ):
152+ entropy = values ["Sorient_Nw_ave" ]
153+ count = values ["tot_count" ]
149154 self ._reporter .add_residue_data (
150155 group_id , resname , "Water" , "Orientational" , count , entropy
151156 )
0 commit comments