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

Feature: named parts #60

Merged

Conversation

Bouni
Copy link
Contributor

@Bouni Bouni commented Jan 19, 2024

This PR adds the ability to pass names along with the lengths which are included in the results as well.

Here's example data:

{"cut_width": "3",
 "max_length": "1500",
 "target_sizes": [{"length": "200", "name": "Part1", "quantity": "4"},
                  {"length": "500", "quantity": "2"}]}

The resulting data looks like this:

{"job": {"cut_width": 3,
         "max_length": 1500,
         "target_sizes": [{"length": 200, "name": "Part1", "quantity": 4},
                          {"length": 500, "name": "", "quantity": 2}]},
 "lengths": [[[500, ""], [500, ""], [200, "Part1"], [200, "Part1"]],
             [[200, "Part1"], [200, "Part1"]]],
 "solver_type": "bruteforce",
 "time_us": 4974}

This will allow the Frontend to show part names along with the dimensions which makes it much easier to find parts in the cutlist.

Caution

This is a breaking change and the Frontend must be updated as well. I'll submit a PR for that soon

@Bouni Bouni marked this pull request as draft January 19, 2024 09:48
@Bouni
Copy link
Contributor Author

Bouni commented Jan 19, 2024

I just realized that the output is not rigtht (for whatever reason, the tests seem to check for the right data 🤔)

@Bouni
Copy link
Contributor Author

Bouni commented Jan 19, 2024

False alarm 🤦🏽 I had a stock length of 13000 in my example which resulted in just one element in the resulting array.

@Bouni Bouni marked this pull request as ready for review January 19, 2024 10:40
@ModischFabrications
Copy link
Owner

Thanks for contributing 👍🏻
I will wait until your PR for the frontend is done, feel free to ask if anything is unclear

@Bouni
Copy link
Contributor Author

Bouni commented Jan 24, 2024

I realized a issue yesterday. I have not refactored the FFD solver yet and if a user adds to many parts it will not work.
I'll look into it today. The frontend is already done, you can check it out here: https://cutsolver.bouni.de/

@Bouni
Copy link
Contributor Author

Bouni commented Jan 24, 2024

@ModischFabrications I refactored the FFD solver as well, all tests pass and my test setup works like a charm!

grafik

@Bouni
Copy link
Contributor Author

Bouni commented Jan 24, 2024

One last question, in the comment above the ffd solver is a TODO comment about the execution time being aweful. what size of test data did you use?

@ModischFabrications
Copy link
Owner

One last question, in the comment above the ffd solver is a TODO comment about the execution time being aweful. what size of test data did you use?

Not sure, it's been a while. There is a benchmarking-test somewhere in there, but I haven't set up the tests on my end again.

@ModischFabrications
Copy link
Owner

@Bouni tests failed, it seems that you include py 3.11 in your dependencies but chose a py 3.12 docker image. Can you fix it, so that the CI runs through successfully? Everything else seems fine at first glance, I will merge und update the service once both PRs are done

@Bouni
Copy link
Contributor Author

Bouni commented Jan 28, 2024

I'll do that tomorrow. I think it fails because of a python 3.9 in the ci.
For me everything runs fine in a python 3.12 container

Copy link
Owner

@ModischFabrications ModischFabrications left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this could be it, CI pipenv is rather picky with it's dependencies.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@Bouni
Copy link
Contributor Author

Bouni commented Jan 28, 2024

This is what I mean

https://github.com/ModischFabrications/CutSolver/blob/master/.github%2Fworkflows%2Fci.yml#L42

@ModischFabrications
Copy link
Owner

Good call, everything works now. Blocked by ModischFabrications/CutSolverFrontend#63

@Bouni
Copy link
Contributor Author

Bouni commented Jan 29, 2024

I guess we might shoul update the python version to 3.12 as that's the current stabel release, what do you think?

@ModischFabrications
Copy link
Owner

I don't see the need, but I'm open to it. Feel free to update if you prefer.

@Bouni
Copy link
Contributor Author

Bouni commented Jan 30, 2024

You're right I think we just leave it at 3.11 and update it maybe at a later point

@ModischFabrications ModischFabrications merged commit 7459d77 into ModischFabrications:master Jan 30, 2024
2 checks passed
@ModischFabrications
Copy link
Owner

FYI: CutSolver (Backend) was promoted to v1.0.0 and got it's releases: https://hub.docker.com/r/modischfabrications/cutsolver/tags

Thanks for your support!

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

Successfully merging this pull request may close these issues.

2 participants