-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When reusing bins and items in a packer old data persists #33
Comments
I am experiencing this same strange "issue". What is the best way to manually reset the data? |
I ran into the same issue, trying to use it for the repo for simplicity. |
@Kyle772 Can you share your method for resetting the data back to the init values? In my implementation I am having to use 3 different Bin lists but would like to standardize to one. |
Sorry for the late response I needed to hunt down the code for this and kept putting it off. If you persist the packer between different bins it will maintain the values. To avoid this what I ended up doing was reinitializing a new packer and bins with each request/cycle. You could also manually go through the init variables (found in main.py Packer.init()) and reset them manually. I don't have a huge data set so recreating the classes wasn't an issue for me but if you need the original set you could deep copy it into a variable and pull values from there on reset. If you're still having troubles consider reading through this article, it's not immediately relevant to this library but may give you the insight as to why this needs to happen |
Hi, thank you for the reply! |
Thanks to both of you! I'm curious how your solution looks Johetan. I'm currently reinitializing the list of Bins in each function... however ideally I want to have just 1 list of bins that reset so I can use that to manage changes when box sizes change. |
It's a bit rough
|
This isn't so much of an issue moreso a problem I ran into which took some time to debug.
Since the three objects are built out as standalone classes bins keep their mutated data between runs. To work around this I had to manually reset the data back to the init values on every loop in each bin. This isn't really an issue with the code but more an issue with the implementation/design. If a new packer is initialized and bins are added those bins should be reinitialized as well.
More of a PSA I suppose since nobody in the gh issues brought this up (Except maybe #15 ?)
The text was updated successfully, but these errors were encountered: