Skip to content
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

Sorting error under multiple conditions? #14

Open
woshisj opened this issue May 9, 2023 · 1 comment
Open

Sorting error under multiple conditions? #14

woshisj opened this issue May 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@woshisj
Copy link

woshisj commented May 9, 2023

The code below only works in the last line, right?

Should you write this when using multiple conditions for sort
self.items.sort(key=lambda item: (item.level item.loadbear)), reverse=False)
https://github.com/jerry800416/3D-bin-packing/blob/43793860f0a75f1553e6cbf95d43bb3862725e51/py3dbp/main.py#LL497C7-L501C68
`

    self.items.sort(key=lambda item: item.loadbear, reverse=True)

    self.items.sort(key=lambda item: item.level, reverse=False)

`

@jerry800416 jerry800416 added the bug Something isn't working label Jul 31, 2023
@jerry800416
Copy link
Owner

@woshisj
Thank you very much, this problem will be fixed in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants