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

Unify usage of domain_factory in API #363

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

nhuet
Copy link
Contributor

@nhuet nhuet commented May 17, 2024

  • C++ solvers need the domain_factory in their init
  • Some other solvers needed it during solve and thus it was introduced in Domain.solve_with() and Solver.solve() and even in Restorable.load()

Here we unify this by putting all these domain_factory in all solvers init.
During init we take care to autocast the domain_factory so that it produced the domain at the appropriate level for the solver (at is was previously done in solve() which then called _solve()). We thus avoid repeating this process twice (it was done also in load()) and improve the readibility for users (that sometime needed to put domain_factory in init, sometimes in solve_with)

@nhuet nhuet force-pushed the domain_factory branch 2 times, most recently from 2465a30 to 41f46c0 Compare May 19, 2024 16:13
- C++ solvers need the domain_factory in their __init__
- Some other solvers needed it during solve and thus it was introduced
  in Domain.solve_with() and Solver.solve() and even in
  Restorable.load()

Here we unify this by putting all these domain_factory in all solvers
__init__.
During __init__ we take care to autocast the domain_factory so that it
produced the domain at the appropriate level for the solver (at is was
previously done in solve() which then called _solve()).
We thus avoid repeating this process twice (it was done also in load())
and improve the readibility for users (that sometime needed to put
domain_factory in __init__, sometimes in solve_with)
@nhuet nhuet force-pushed the domain_factory branch from 41f46c0 to fda49f6 Compare May 19, 2024 16:49
@fteicht fteicht self-requested a review May 20, 2024 20:16
@fteicht fteicht self-assigned this May 20, 2024
@fteicht fteicht added the enhancement New feature or request label May 20, 2024
@fteicht fteicht merged commit f05319b into airbus:master May 20, 2024
33 checks passed
@nhuet nhuet mentioned this pull request May 21, 2024
@nhuet nhuet deleted the domain_factory branch May 28, 2024 13:09
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

Successfully merging this pull request may close these issues.

2 participants