Skip to content

Fix NameError in hierarchy_minimize()

Stuart Berg requested to merge (removed):fix-hierarchy_minimize-NameError into master

This one-word PR fixes a tiny omission in hierarchy_minimize().

minimize_nested_blockmodel_dl() permits the user to supply an initial hierarchical partition. If the partition's top level contains more than one block, then an extra level should be added automatically. But due to a missing word, a NameError is raised instead:

   1153             bstate = state.levels[-1].get_block_state(**dict(state.hstate_args,
   1154                                                              b=zeros(state.levels[-1].B),
-> 1155                                                              Lrecdx=levels[-1].Lrecdx))
   1156             state.levels.append(bstate)
   1157             state._regen_Lrecdx()

NameError: name 'levels' is not defined

Merge request reports