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

Adding compatability for upstream vroom. #121

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Adding compatability for upstream vroom. #121

wants to merge 14 commits into from

Conversation

jonathf
Copy link
Collaborator

@jonathf jonathf commented Nov 23, 2024

No description provided.

Comment on lines 25 to 27
.def("_from_json", &vroom::io::parse, py::arg("json_string"),
py::arg("geometry"))
.def("_set_amount_size", &vroom::Input::set_amount_size)
/* .def("_set_amount_size", &vroom::Input::set_amount_size) */
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jcoupey, seems like vroom::Input::set_amount_size is removed. Is the feature deprecated or just moved somewhere else?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, we still store _amount_size as an optional. It's just that it used to be user-defined which is not really convenient. Now we infer the expected size for amount/capacity arrays directly ourselves in the Input class while adding stuff.

This is more convenient from the user perspective (not having to provide a somewhat redundant info). Also it allows to move some checks upstream in the Input class in the light of VROOM-Project/vroom#1086.

Comment on lines 58 to 59
py::arg("nb_searches"),
py::arg("depth"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like vroom::Input and vroom::input::solve have been changed a bit. Do we have documentation for apply_TSPFix, nb_searches and depth? I am guessing the former is experimental, and the two latter are core parameters.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the TSPFix operator is definitely experimental. The reasons for disabling it by default are discussed in VROOM-Project/vroom#1013.

The nb_searches and depth parameters are internal parameters that we don't really expose outside the C++ functions. When using from command-line, there is a "meta" parameter that wraps the various trade-offs we offer -x, --explore arg exploration level to use (0..5) (default: 5). The way this translates to the above is defined in https://github.com/VROOM-Project/vroom/blob/31bace492abfd97155faf91c20b4300dfbfcdcec/src/structures/cl_args.cpp#L78-L90.

Having a simple knob to use on a scale from 0 to 5 is actually convenient from a user perspective because everything is already tuned internally and you don't have to understand what the underlying parameters are about. Maybe that's what we'd also like to expose from pyvroom to offer the same interface?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think have the parameters consistent would be a good idea, yeah.
For now I'll do the translation manually on the Python side to get something working.

Copy link
Contributor

Choose a reason for hiding this comment

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

What we could do if it helps is to keep an overload of Input::solve with the old exploration_level signature. This would trivially call the new version with the expected conversion for the new parameters. Then you'd only have to keep exposing that one for the bindings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we can have that, that would be great, yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jonathf done in VROOM-Project/vroom#1197, let me know if that's OK and I'll merge.

@jonathf jonathf force-pushed the serverstring branch 3 times, most recently from 532420d to f37c360 Compare December 1, 2024 17:21
Copy link

codecov bot commented Dec 1, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 15 lines in your changes missing coverage. Please review.

Project coverage is 40.3%. Comparing base (7fc9070) to head (39d4e1f).

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #121      +/-   ##
========================================
- Coverage   79.1%   40.3%   -38.9%     
========================================
  Files         29      29              
  Lines       1628    1630       +2     
  Branches     138     147       +9     
========================================
- Hits        1288     657     -631     
- Misses       330     973     +643     
+ Partials      10       0      -10     
Flag Coverage Δ
binding 0.0% <0.0%> (-69.2%) ⬇️
python 92.2% <90.9%> (+0.8%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@jonathf jonathf force-pushed the serverstring branch 2 times, most recently from 7fd3db2 to 0b3940e Compare December 4, 2024 09:40
@jonathf jonathf force-pushed the serverstring branch 3 times, most recently from 8529802 to dde63c7 Compare January 7, 2025 10:50
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