示例#1
0
 def _get_iter(self, _slice, key, get_if_not_present=False):
     if key.__class__ not in (tuple, list):
         key = (key, )
     return _IndexedComponent_slice_iter(
         _slice,
         _fill_in_known_wildcards(flatten_tuple(key),
                                  get_if_not_present=get_if_not_present))
示例#2
0
 def _get_iter(self, _slice, key):
     if key.__class__ not in (tuple, list):
         key = (key, )
     return _IndexedComponent_slice_iter(_slice,
                                         _fill_in_known_wildcards(
                                             flatten_tuple(key),
                                             look_in_index=True),
                                         iter_over_index=True)
示例#3
0
文件: reference.py 项目: Pyomo/pyomo
 def _get_iter(self, _slice, key, get_if_not_present=False):
     if key.__class__ not in (tuple, list):
         key = (key,)
     return _IndexedComponent_slice_iter(
         _slice,
         _fill_in_known_wildcards(flatten_tuple(key),
                                  get_if_not_present=get_if_not_present)
     )
示例#4
0
文件: reference.py 项目: Pyomo/pyomo
 def _get_iter(self, _slice, key):
     if key.__class__ not in (tuple, list):
         key = (key,)
     return _IndexedComponent_slice_iter(
         _slice,
         _fill_in_known_wildcards(flatten_tuple(key), look_in_index=True),
         iter_over_index=True
     )
示例#5
0
文件: reference.py 项目: yynst2/pyomo
 def _get_iter(self, _slice, key, get_if_not_present=False):
     # Construct a slice iter with `_fill_in_known_wildcards`
     # as `advance_iter`. This reuses all the logic from the slice
     # iter to walk the call/iter stacks, but just jumps to a
     # particular component rather than actually iterating.
     # This is how this object does lookups.
     if key.__class__ not in (tuple, list):
         key = (key, )
     return _IndexedComponent_slice_iter(
         _slice,
         _fill_in_known_wildcards(flatten_tuple(key),
                                  get_if_not_present=get_if_not_present))