code: def _dimension_data(self, buses, branches, generators):
          
          ipol = [i for i, g in enumerate(generators)
                  if g.pcost_model == POLYNOMIAL]
          ipwl = [i for i, g in enumerate(generators)
                  if g.pcost_model == PW_LINEAR]
          nb = len(buses)
          nl = len(branches)
          # Number of general cost vars, w.
          nw = self.om.cost_N
          # Number of piece-wise linear costs.
          if "y" in [v.name for v in self.om.vars]:
              ny = self.om.get_var_N("y")
          else:
              ny = 0
          # Total number of control variables of all types.
          nxyz = self.om.var_N
  
          return ipol, ipwl, nb, nl, nw, ny, nxyz
docs: Returns the problem dimensions.