Skip to content

Add set_threads convenience method #37

Draft
nh13 wants to merge 1 commit intorust-or:mainfrom
nh13:nh_typed-option-setters
Draft

Add set_threads convenience method #37
nh13 wants to merge 1 commit intorust-or:mainfrom
nh13:nh_typed-option-setters

Conversation

@nh13
Copy link

@nh13 nh13 commented Mar 23, 2026

(updated human description, sorry!)

Expose a set_threads convenience method on Model that takes a NonZeroU32, following the existing make_quiet() pattern.

You can already do this with set_option("threads", 4), but the typed method makes it discoverable via IDE autocomplete and catches mistakes at compile time (eg. wrong type, zero value).

@lovasoa
Copy link
Contributor

lovasoa commented Mar 23, 2026

This pr seems to be fully ai-generated. @nh13 did you check all the new methods actually work ?

If so, can you please include a short human written description of how you tested it ?

@KnorpelSenf
Copy link
Collaborator

@lovasoa I also started reviewing this before I noticed that it's LLM-output. It seems rather disrespectful to waste our time just because @nh13 is too lazy to put in their own time. Perhaps we should just close it as slop?

My take on LLM contributions is that people are free to use whichever tools they want to improve their code, but this sort of qualifies as spam.

@lovasoa
Copy link
Contributor

lovasoa commented Mar 23, 2026

@KnorpelSenf I also do find the lack of a single human word sad, but I think these new methods could be useful. The current string-based configuration is brittle.

@nh13 : Nils, would you be ready to spend a little bit more time on this, switch this PR to "draft" status, and ask for our review again after you can show it all actually works ? If you are interested in contributing to this project, your help is welcome ! Like you, I also find LLMs useful, but I think we should all be careful when using them: they still often output nonsensical content, and I think it's unfair to ask others to review their outputs before you.

@nh13 nh13 marked this pull request as draft March 23, 2026 23:07
@nh13
Copy link
Author

nh13 commented Mar 23, 2026

All fair comments. Obviously I didn't get the right balance wanting to contribute back something I found useful locally in a rush, and that's unfair to you and the maintainers. Perhaps I could open an issue to ask for guidance before making any PR, would that help in the future. Thank-you for the feedback, I have taken it to heart.

@nh13 nh13 force-pushed the nh_typed-option-setters branch 3 times, most recently from f16eb01 to c8e1961 Compare March 23, 2026 23:17
@nh13 nh13 changed the title Add typed convenience methods for common solver options Add set_threads convenience method Mar 23, 2026
Expose a `set_threads` convenience method on `Model` that takes a
`NonZeroU32`, following the existing `make_quiet()` pattern.

You can already do this with `set_option("threads", 4)`, but the typed
method makes it discoverable via IDE autocomplete and catches mistakes
at compile time (eg. wrong type, zero value).
@nh13 nh13 force-pushed the nh_typed-option-setters branch from c8e1961 to a849b40 Compare March 23, 2026 23:22
@nh13
Copy link
Author

nh13 commented Mar 23, 2026

Apologies for the slop, that was my mistake. I've updated the PR to be just set_threads which is what I needed.

@nh13 nh13 requested a review from lovasoa March 23, 2026 23:30
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.

3 participants