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

group equal required and stocks #73

Open
ModischFabrications opened this issue Apr 12, 2024 · 2 comments
Open

group equal required and stocks #73

ModischFabrications opened this issue Apr 12, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ModischFabrications
Copy link
Owner

Current implementation will ignore content during iteration and try to generate permutations for multiple entries for the same length.
Combining all entires would make some parts of the code easier and n_combinations more accurate.

[500:1, 500:2, 500:4] => [500:7]

Might be good to do that during assignment rather than during every access.

@ModischFabrications
Copy link
Owner Author

something like this, but for INS and QNS:

def group_QNS(entries: Collection[QNS]) -> Collection[QNS]:
    g = [QNS(length=e[0].length, quantity=e[1]) for e in groupby(entries, key=lambda x: x.length)]
    return g

See https://docs.pydantic.dev/latest/concepts/validators/#before-after-wrap-and-plain-validators for assignment checks.

@ModischFabrications
Copy link
Owner Author

extension of #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant