question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add_rect() in online packers doesn't return solution

See original GitHub issue

I am using the online packer and calling add_rect() when needed. However, the return value is inconsitent and never complete. The only way to get the full solution seems to be to iterate all bins which is O(n) for n rects packed so far. The solution is available and could be returned, but…

  • BBF returns bool indicating whether packing succeeded.
  • BNF and BBF return a rect if successful or None otherwise - but not the bin ID it was packed into.

I would suggest changing the return value for all three to a tuple of the form (bin_id, rect).

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:31 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
lordmauvecommented, Mar 2, 2021

Why uuid4 and not just sequential integer IDs? It’s surely unnecessary to need global unique identifiers, and they’re much more expensive to compute.

1reaction
secnotcommented, Mar 2, 2021

Now that i have written it I can’t see many cases where pop(bin_id) would be useful, a simple pop() should be enough and not require an ordereddict

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found