[Python-il] Code Review: Kakurasu Solver
cool-rr at cool-rr.com
Tue Oct 12 20:48:07 IST 2010
On Tue, Oct 12, 2010 at 8:12 PM, Shlomi Fish <shlomif at gmail.com> wrote:
> Hi all,
> I've written a solver for Kakurasu (see
> http://brainbashers.com/kakurasu.asp) based on lp_solve, an LGPLed
> Linear Programming solver, and you can currently find it here:
> I'd like to get some input about it before I release its first
> version, announce it on Freshmeat.net and all that Jazz. Some points
> to consider:
> 1. Is it OK to name the module with a hyphen? Should it be
> "kakurasu_solver" instead?
I think you must rename it. Did you succeed in importing it? I think that
would be impossible, because when you'll do `import kakurasu-solver` Python
won't be able to create a variable `kakurasu-solver`, because `-` is the
2. I realise the setup.py could use some improvements, and that some
> fields could be added, but feel free to mention them anyway.
> Any comments would be appreciated. The default mode of the module is
> to be used from the command line, but it also includes an API.
> -- Shlomi Fish
I didn't inspect the `setup.py` file, but I see that your module is
completely undocumented. Almost every class, function and method should have
a docstring, and in your module I haven't seen a single docstring.
You should make the short description ("This is Shlomi Fish's open-source
solver for Kakurasu ") into a docstring instead of a comment.
Otherwise the code looks pretty good. But I'd be hesitant to spend time
diving into your code before it has docstrings. In addition, I suggest
putting extensive comments in a function as long as calc_params_obj,
explaining the implementation of the function.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-il