Skip to content

Commit 276ffb9

Browse files
authored
openmc_py and openmc_xml lower case (#166)
* openmc_py and openmc_xml lower case * removed outdated code comment
1 parent 6daf2e3 commit 276ffb9

10 files changed

+23
-26
lines changed

docs/usage/python_api_usage.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ The following example shows a usage with every attributes specified.
104104
title="Converted with GEOUNED",
105105
geometryName="csg",
106106
outFormat=(
107-
"openMC_XML",
108-
"openMC_PY",
107+
"openmc_xml",
108+
"openmc_py",
109109
"serpent",
110110
"phits",
111111
"mcnp",

docs/usage/python_cli_usage.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Here is a complete JSON file specification
9999
"export_csg":{
100100
"title": "Converted with GEOUNED",
101101
"geometryName": "csg",
102-
"outFormat": ["openMC_XML", "openMC_PY", "serpent", "phits", "mcnp"],
102+
"outFormat": ["openmc_xml", "openmc_py", "serpent", "phits", "mcnp"],
103103
"volSDEF": false,
104104
"volCARD": true,
105105
"dummyMat": false,

scripts/config.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ stepFile = stepfilename.stp
66
geometryName = pieza
77
matFile = materials.txt
88

9-
# format of the converted geometry : mcnp, openMC_XML, openMC_PY, serpent, phits
10-
outFormat = mcnp, openMC_PY, openMC_XML
9+
# format of the converted geometry : mcnp, openmc_xml, openmc_py, serpent, phits
10+
outFormat = mcnp, openmc_py, openmc_xml
1111

1212

1313
[Parameters]

scripts/configReverse.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
inputFile = my_CSG_model
33
CADFile = modelCAD
44

5-
# CSG format allowed are mcnp or openMC_XML
5+
# CSG format allowed are mcnp or openmc_xml
66
inFormat = mcnp
77

88
# box dim in cm

scripts/geounedClassCall.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
GEO.set("stepFile", stepFileName)
2020
GEO.set("geometryName", "Placa")
21-
GEO.set("outFormat", ("mcnp", "openMC_XML"))
21+
GEO.set("outFormat", ("mcnp", "openmc_xml"))
2222
GEO.set("planeDistance", 0.05)
2323
GEO.set("quadricPY", True)
2424
GEO.set("P_abc", "12f")

src/geouned/GEOReverse/reverse.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ def reverse(optFile="configRevese.ini"):
3434
# get geometry definition from MCNP input
3535
if inFormat == "mcnp":
3636
geom = McnpInput(geomfile)
37-
elif inFormat == "openMC_XML":
37+
elif inFormat == "openmc_xml":
3838
geom = XmlInput(geomfile)
3939
else:
40-
msg = f"input format type {inFormat} is not supported." 'Supported options are "mcnp" or "openMC_XML"'
40+
msg = f"input format type {inFormat} is not supported." 'Supported options are "mcnp" or "openmc_xml"'
4141
raise ValueError(msg)
4242

4343
CADCells, fails = buildCAD(UnivCell, geom, CADselection)

src/geouned/GEOUNED/core.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def export_csg(
6969
title: str = "Converted with GEOUNED",
7070
geometryName: str = "csg",
7171
outFormat: typing.Tuple[str] = (
72-
"openMC_XML",
73-
"openMC_PY",
72+
"openmc_xml",
73+
"openmc_py",
7474
"serpent",
7575
"phits",
7676
"mcnp",
@@ -90,8 +90,8 @@ def export_csg(
9090
geometryName (str, optional): the file stem of the output file(s).
9191
Defaults to "converted_with_geouned".
9292
outFormat (typing.Tuple[str], optional): Format for the output
93-
geometry. Available format are: "mcnp", "openMC_XML",
94-
"openMC_PY", "phits" and "serpent". Several output format can
93+
geometry. Available format are: "mcnp", "openmc_xml",
94+
"openmc_py", "phits" and "serpent". Several output format can
9595
be written in the same method call. Defaults to output all codes.
9696
volSDEF (bool, optional): Write SDEF definition and tally of solid
9797
cell for stochastic volume checking. Defaults to False.
@@ -221,9 +221,9 @@ def set_configuration(self, configFile=None):
221221
if v.lower() == "mcnp":
222222
outFormat.append("mcnp")
223223
elif v.lower() == "openmc_xml":
224-
outFormat.append("openMC_XML")
224+
outFormat.append("openmc_xml")
225225
elif v.lower() == "openmc_py":
226-
outFormat.append("openMC_PY")
226+
outFormat.append("openmc_py")
227227
elif v.lower() == "serpent":
228228
outFormat.append("serpent")
229229
elif v.lower() == "phits":

src/geouned/GEOUNED/write/write_files.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ def write_geometry(
2525
stepFile,
2626
):
2727

28-
# Currently there are two was of setting outFormat (via a .set method and
29-
# a class attribute. Once we have a single method then move this validating
30-
# input code to the attribute @setter
31-
supported_mc_codes = ("mcnp", "openMC_XML", "openMC_PY", "serpent", "phits")
28+
supported_mc_codes = ("mcnp", "openmc_xml", "openmc_py", "serpent", "phits")
3229
for out_format in outFormat:
3330
if out_format not in supported_mc_codes:
3431
msg = f"outFormat {out_format} not in supported MC codes ({supported_mc_codes})"
@@ -71,14 +68,14 @@ def write_geometry(
7168
MCNPfile.set_sdef((outSphere, outBox))
7269
MCNPfile.write_input(mcnpFilename)
7370

74-
if "openMC_XML" in outFormat or "openMC_PY" in outFormat:
71+
if "openmc_xml" in outFormat or "openmc_py" in outFormat:
7572
OMCFile = OpenmcInput(MetaList, Surfaces, options, tolerances, numeric_format)
7673

77-
if "openMC_XML" in outFormat:
74+
if "openmc_xml" in outFormat:
7875
omcFilename = geometryName + ".xml"
7976
OMCFile.write_xml(omcFilename)
8077

81-
if "openMC_PY" in outFormat:
78+
if "openmc_py" in outFormat:
8279
omcFilename = geometryName + ".py"
8380
OMCFile.write_py(omcFilename)
8481

tests/config_complete_defaults.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"export_csg":{
6767
"title": "Converted with GEOUNED",
6868
"geometryName": "csg",
69-
"outFormat": ["openMC_XML", "openMC_PY", "serpent", "phits", "mcnp"],
69+
"outFormat": ["openmc_xml", "openmc_py", "serpent", "phits", "mcnp"],
7070
"volSDEF": false,
7171
"volCARD": true,
7272
"dummyMat": false,

tests/test_convert.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def test_conversion(input_step_file):
109109
title="Converted with GEOUNED",
110110
geometryName=f"{output_filename_stem.resolve()}",
111111
outFormat=(
112-
"openMC_XML",
113-
"openMC_PY",
112+
"openmc_xml",
113+
"openmc_py",
114114
"serpent",
115115
"phits",
116116
"mcnp",
@@ -189,7 +189,7 @@ def test_writing_to_new_folders():
189189
geo = geouned.CadToCsg(stepFile="testing/inputSTEP/BC.stp")
190190
geo.start()
191191

192-
for outformat in ["mcnp", "phits", "serpent", "openMC_XML", "openMC_PY"]:
192+
for outformat in ["mcnp", "phits", "serpent", "openmc_xml", "openmc_py"]:
193193
geo.export_csg(
194194
geometryName=f"tests_outputs/new_folder_for_testing_{outformat}/csg",
195195
cellCommentFile=False,

0 commit comments

Comments
 (0)