#18448: Add test if a matroid is binary
-------------------------------------+-------------------------------------
       Reporter:  Rudi               |        Owner:  Rudi
           Type:  enhancement        |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-6.8
      Component:  matroid theory     |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Rudi Pendavingh    |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/Rudi/add_test_if_a_matroid_is_binary|  
edaf4c7793369b2395dc241ad40a7d4452d93c39
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by Rudi):

 Hi Travis,

 thanks for the feedback.

 > - Instead of `type(self) == BinaryMatroid`, you should do
 `isinstance(self, BinaryMatriod)` (or even better, for `is_binary`, I
 would just overwrite this method in that class which returns `True`).

 I overwrote the method for BinaryMatroid and RegularMatroid, completely
 agree that this is a better solution.

 Why is `isinstance(self, BinaryMatroid)` preferred over over `type(self)
 == BinaryMatroid`? For a class like BinaryMatroid that has no derived
 classes, both seem to accomplish the exact same thing.

 > - You need to fix the documentation of your methods. For example, the
 `INPUT:` block should only have one colon. You can look at the other
 nearby methods or ask me if you have any questions. I'd also add some
 latex formating to things using single backticks, e.g., {{{`|X\B| \leq
 1`}}}.

 I improved the docstring, with an eye on adjacent methods.

 I wrote dozens of docstrings just before we added the matroid monster
 patch (essentialy all the docstrings were written after we wrote all the
 code), but apparently the rules for proper docstring writing have escaped
 me (or perhaps Stefan repaired my bad formatting during the review, so
 that I never even realized all my errors). Anyway, I should learn to do it
 properly.  I'll take a look at the developer guide.

--
Ticket URL: <http://trac.sagemath.org/ticket/18448#comment:11>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to