#10043: Complete rewrite of LP solver interfaces
----------------------------------+-----------------------------------------
Reporter: ncohen | Owner: ncohen
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.6
Component: linear programming | Keywords:
Author: Nathann Cohen | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
----------------------------------+-----------------------------------------
Changes (by malb):
* status: needs_review => needs_work
Comment:
Hi, a few comments. They are rather nitpicky but since you're defining an
interface it would be hard to change any of this at a later time.
* there is one doctest failure, where you forgot to catch the
{{{NotImplementedError}}}
* {{{getSolver}}} should be {{{get_solver}}} according to Python coding
conventions
* Sage matrices use {{{ncols()}}} instead of {{{n_cols()}}}, I suggest to
do the same for consistency (same for ({{{nrows}}}, {{{add_column}}}
instead of {{{add_col}}})
* Isn't {{{set_sense()}}} the canonical vocabulary instead of
{{{set_direction()}}}?
* I think we have a bias in Sage to using {{{coefficient}}} instead of
{{{coeff}}} in function names
* One could rename {{{set_log_level}}} to {{{set_verbose(_level)()}}} to
match the global function names already defined in Sage (see below for
comments on getters and setters)
* I wonder if it would make sense to rename {{{add_constraint}}} to
{{{add_linear_constraint}}}. Of course, this is a linear programming
backend but many of the solvers we support also support non-linear
constraints.
* Sage matrices define {{{row()}}} instead of {{{get_row()}}}. I guess if
you change the name then maybe all {{{get_XXX()}}} might be replaced by
{{{XXX()}}} which seems to conform to Python conventions.
* In the same spirit one could replace {{{get/set_variable_min/max}}} by
functions {{{variable_min/max}}} which return the value if no optional
argument is given and set the value if it is given. Same for similar
functions. It seems getter and setter functions are considered unpythonic.
http://tomayko.com/writings/getters-setters-fuxors
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10043#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.