Conversation
tias
left a comment
There was a problem hiding this comment.
yes, all good for me, also appropriate to add the ruff formatting at the same time.
One thing I wonder, now we import all constraints as part of cpmpy.expression.init
and then cpmpy.init still has a *
would an alternative be to only import them in cpmpy.init, and have the other packages not load anything else in there init? or is this the current way the right way (but for example SolverLookup is directly imported from top init, not in cpmpy.solvers; or is that an oversight, or maybe on purpose because it is not a solver? or maybe because those solvers in cpmpy.solvers.init are not exported in the top one as well...
we want all those you have now in the top in any case...
|
I've added a test to ensure we import all of the global constraints at the Importing everything at the |
Reformat the init files and properly enforce what is "exported" from the package using the
__all__tags.It allows IDE's to properly inspect what is available from the package
The formatting of imports was unnatural to me at first, but it actually makes a lot of sense. Also massively simplifies merges when two branches add a global constraint for example...