Skip to content

Commit

Permalink
Fixed an issue with bank_index
Browse files Browse the repository at this point in the history
Where bank_index was not being generated unless the user explicitly added it as a reactor property
  • Loading branch information
Soroosh129 committed Apr 10, 2022
1 parent e5e988a commit 7dd5d2e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ private static String generatePythonClassInstantiation(ReactorInstance instance,
CodeBuilder code = new CodeBuilder();
code.pr(PyUtil.reactorRef(instance)+" = _"+className+"(");
code.indent();
// Always add the bank_index
code.pr("_bank_index = "+PyUtil.bankIndex(instance)+",");
for (ParameterInstance param : instance.parameters) {
if (param.getName().equals("bank_index")) {
code.pr("_bank_index = "+PyUtil.bankIndex(instance)+",");
} else {
if (!param.getName().equals("bank_index")) {
code.pr("_"+param.getName()+"="+PythonParameterGenerator.generatePythonInitializer(param)+",");
}
}
Expand Down

0 comments on commit 7dd5d2e

Please # to comment.