Skip to content

Commit

Permalink
Cleaning up material modification table (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Oct 19, 2023
1 parent 68f2ede commit 85d4f6e
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions doc/user/inputs/blueprints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -395,22 +395,35 @@ material modifications
from tabulate import tabulate

data = []

for m in Material.__subclasses__():
numArgs = m.applyInputParams.__code__.co_argcount
if numArgs > 1:
modNames = m.applyInputParams.__code__.co_varnames[1:numArgs]
data.append((m.__name__, ', '.join(modNames)))
data.append((m.__name__, ", ".join(modNames)))

for subM in m.__subclasses__():
num = subM.applyInputParams.__code__.co_argcount
if num > 1:
mods = subM.applyInputParams.__code__.co_varnames[1:num]
data.append((subM.__name__, ', '.join(mods)))

if numArgs > 1:
mods += modNames
data.append((subM.__name__, ", ".join(mods)))

d = {}
for k, v in data:
if k not in d:
d[k] = v
else:
d[k] = d[k].split(",") + v.split(",")
d[k] = sorted(set([vv.strip() for vv in d[k]]))
d[k] = ", ".join(d[k])
data = [(k, v) for k, v in d.items()]
data.sort(key=lambda t: t[0])
return tabulate(headers=('Material Name', 'Available Modifications'),
tabular_data=data, tablefmt='rst')
return tabulate(
headers=("Material Name", "Available Modifications"),
tabular_data=data,
tablefmt="rst",
)

The class 1/class 2 modifications in fuel materials are used to identify mixtures of
custom isotopics labels for input scenarios where a varying blend of a high-reactivity
Expand Down

0 comments on commit 85d4f6e

Please sign in to comment.