Skip to content

Commit 8b0bb9b

Browse files
Update voids_search.py CJK fixes for Pablo NO_JIRA
lines 201 - 204 , searches the right field now, and all have rounding included
1 parent 2a30699 commit 8b0bb9b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

scripts/voids_search/voids_search.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,29 +177,31 @@ def run_search(interface=None):
177177

178178
TNS = TextNumericSearch()
179179
if void_search_dict.get("total_surface_area", False):
180-
tsa = query_string_to_tuple(void_search_dict["total_surface_area"], 10000.0)
181-
query_report += f"Pore Total Surface Area (&#8491;^2) {tsa[0]}-{tsa[1]} <br>"
180+
tsa = query_string_to_tuple(void_search_dict["total_surface_area"], 10000.0)
181+
query_report += f"Pore Total Surface Area (&#8491;^2) {round(tsa[0],1)}-{round(tsa[1],1)} <br>"
182182
TNS.add_pore_analysis_total_surface_area(tsa)
183183

184184
if void_search_dict.get("total_geometric_volume", False):
185185
tgv = query_string_to_tuple(void_search_dict["total_geometric_volume"], 100000.0)
186-
query_report += f"Pore Total Geometric Volume (&#8491;^3): {tgv[0]}-{tgv[1]} <br>"
186+
query_report += f"Pore Total Geometric Volume (&#8491;^3): {round(tgv[0],1)}-{round(tgv[1],1)} <br>"
187187
TNS.add_pore_analysis_total_geometric_volume(tgv)
188188

189189
if void_search_dict.get("pore_limiting_diameter", False):
190190
pld = query_string_to_tuple(void_search_dict["pore_limiting_diameter"], 200.0)
191-
query_report += f"Pore Limiting Diameter (&#8491;): {pld[0]}-{pld[1]} <br>"
191+
query_report += f"Pore Limiting Diameter (&#8491;): {round(pld[0],2)}-{round(pld[1],2)} <br>"
192192
TNS.add_pore_analysis_pore_limiting_diameter(pld)
193193

194194
if void_search_dict.get("max_pore_diameter", False):
195195
pmd = query_string_to_tuple(void_search_dict["max_pore_diameter"], 200.0)
196-
query_report += f"Pore Maximum Diameter (&#8491;): {pmd[0]}-{pmd[1]} <br>"
196+
query_report += f"Pore Maximum Diameter (&#8491;): {round(pmd[0],2)}-{round(pmd[1],2)} <br>"
197197
TNS.add_pore_analysis_max_pore_diameter(pmd)
198198

199199
if void_search_dict.get("num_percolated_dimensions", False):
200-
npd = query_string_to_tuple(void_search_dict["num_percolated_dimensions"], 3.1)
201-
query_report += f"Number of Percolated Dimensions: {npd[0]}-{npd[1]} <br>"
202-
TNS.add_pore_analysis_max_pore_diameter(npd)
200+
npd = query_string_to_tuple(void_search_dict["num_percolated_dimensions"],3.1)
201+
low, high = int(round(npd[0],0)), int(round(npd[1],0))
202+
range_text = f"{low}-{high}" if low != high else high
203+
query_report += f"Number of Percolated Dimensions: {range_text} <br>"
204+
TNS.add_pore_analysis_num_percolated_dimensions(npd)
203205

204206
hits = TNS.search()
205207
refcode_list = list()

0 commit comments

Comments
 (0)