cleanup and < 3 bundle pre-filter
This commit is contained in:
@ -86,6 +86,12 @@ class SolverRun(BaseModel):
|
||||
items=[item],
|
||||
type=type_attribute)
|
||||
]
|
||||
# temporary compensator for bundle item limits, since we shouldn't be using cases with less than 3 items
|
||||
# ideally this should be in the bundles model as a new attribute to handle "constraints of constraints"
|
||||
logging.info('Removing bundles with items < 3')
|
||||
for k,v in enumerate(self.bundles):
|
||||
bundle = self.bundles[k]
|
||||
if bundle.count < 3: del self.bundles[k]
|
||||
|
||||
logging.info('Bundles Generated...')
|
||||
|
||||
@ -94,4 +100,7 @@ class SolverRun(BaseModel):
|
||||
if constraint.reference_attribute.id == name), None)
|
||||
|
||||
def unbundled_items(self) -> list:
|
||||
# since the only bundles are based on passage id currently
|
||||
# in the future when we have more than just passage based bundles
|
||||
# we'll need to develop a more sophisticated way of handling this concern
|
||||
return [item for item in self.items if item.passage_id == None]
|
||||
|
Reference in New Issue
Block a user