From 68a0fd4c23e9c499a56b48435ee5b7e57a6c4eb1 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 13 May 2024 12:02:08 +0100 Subject: [PATCH] testing the setting of all class arguments (#147) --- tests/test_convert.py | 101 ++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 29 deletions(-) diff --git a/tests/test_convert.py b/tests/test_convert.py index 393de15a..397eefbb 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -23,24 +23,6 @@ def test_conversion(input_step_file): output_dir.mkdir(parents=True, exist_ok=True) output_filename_stem = output_dir / input_step_file.stem - # creates the config file contents - template = { - "title": "Input Test", - "stepFile": f"{input_step_file.resolve()}", - "geometryName": f"{output_filename_stem.resolve()}", - "outFormat": ("mcnp", "openMC_XML", "openMC_PY", "serpent", "phits"), - "compSolids": False, - "volCARD": False, - "volSDEF": True, - "voidGen": True, - "dummyMat": True, - "minVoidSize": 100, - "cellSummaryFile": False, - "cellCommentFile": False, - "debug": False, - "simplify": "no", - } - # deletes the output MC files if they already exists suffixes = (".mcnp", ".xml", ".inp", ".py", ".serp") for suffix in suffixes: @@ -48,28 +30,89 @@ def test_conversion(input_step_file): my_options = geouned.Options( forceCylinder=False, - splitTolerance=0, newSplitPlane=True, + delLastNumber=False, + enlargeBox=2, nPlaneReverse=0, + splitTolerance=0, + scaleUp=True, + quadricPY=False, + Facets=False, + prnt3PPlane=False, + forceNoOverlap=False, ) - # default values used, just checking it can be passed in - my_tolerances = geouned.Tolerances(min_area=0.01) - - # default values used, just checking it can be passed in - my_numeric_format = geouned.NumericFormat(C_r="12f") + my_tolerances = geouned.Tolerances( + relativeTol=False, + relativePrecision=0.000001, + value=0.000001, + distance=0.0001, + angle=0.0001, + pln_distance=0.0001, + pln_angle=0.0001, + cyl_distance=0.0001, + cyl_angle=0.0001, + sph_distance=0.0001, + kne_distance=0.0001, + kne_angle=0.0001, + tor_distance=0.0001, + tor_angle=0.0001, + min_area=0.01, + ) + my_numeric_format = geouned.NumericFormat( + P_abc="14.7e", + P_d="14.7e", + P_xyz="14.7e", + S_r="14.7e", + S_xyz="14.7e", + C_r="12f", + C_xyz="12f", + K_xyz="13.6e", + K_tan2="12f", + T_r="14.7e", + T_xyz="14.7e", + GQ_1to6="18.15f", + GQ_7to9="18.15f", + GQ_10="18.15f", + ) geo = geouned.CadToCsg( - title="Input Test", + stepFile=f"{input_step_file.resolve()}", + matFile="", + voidGen=True, + debug=False, + compSolids=False, # changed from the default + simplify="no", + cellRange=[], + exportSolids="", + minVoidSize=100, # changed from the default + maxSurf=50, + maxBracket=30, + voidMat=[], + voidExclude=[], + startCell=1, + startSurf=1, + sort_enclosure=False, options=my_options, tolerances=my_tolerances, numeric_format=my_numeric_format, + title="Converted with GEOUNED", + geometryName=f"{output_filename_stem.resolve()}", + outFormat=( + "openMC_XML", + "openMC_PY", + "serpent", + "phits", + "mcnp", + ), + volSDEF=True, # changed from the default + volCARD=False, # changed from the default + UCARD=None, + dummyMat=True, # changed from the default + cellCommentFile=False, + cellSummaryFile=False, # changed from the default ) - # set parameters values stored in template dictionary - for key, value in template.items(): - geo.set(key, value) - geo.start() for suffix in suffixes: