#16553: Clean IncidenceStructure
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.3
      Component:  combinatorial      |   Resolution:
  designs                            |    Merged in:
       Keywords:                     |    Reviewers:
        Authors:  Nathann Cohen,     |  Work issues:
  Vincent Delecroix                  |       Commit:
Report Upstream:  N/A                |  428113c0bef095a97189239435c6fb4a92dbe099
         Branch:  public/16553       |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by ncohen):

 Yo !

 > done. But it is not clear to me:
 > - are we allowed to modify the output of `blocks`?
 > - are we allowed to modify the output of `__iter__`?
 >
 > If both answers are yes, then there are copy anyway (I did not implement
 the copy=False idea).

 The point is that we cannot cache any answer unless the design is
 immutable. Then, if it is immutable we can do things like store the blocks
 internally as tuples. This way we can write `__iter__` by returning the
 blocks directly, and they will not be modified by the user.

 For `.blocks()`, we can (by default) return a copy of them or (if the user
 asks) return the thing directly.

 Ideally, we could have `copy=True/False` arguments in the constructor and
 in `blocks()`. This way, if the user (=us, the developpers) say
 `copy=False` it means that we know that we are doing and that no copy
 occurs.

 We can also do this when we compute a design without this class wrapping,
 then return the design. We can set `copy=False` and return the new design
 as we know that nobody else will modify the lists afterwards.

 > Sorry, I should have said this: it was *completely* broken!!

 And it wasn't used anywhere ? Why on earth did we write this in the first
 place ? `O_o`

 > It has nothing to do here (in the doc of `AffineGeometryDesign`).

 Okay

 > The same test above is copied I guess 5 times all over the place.

 Okay.

 Those two things are the kind of stuff that is pretty hard to find out
 while looking at the diff file unless you explain it....

 > > - `IncidenceStructure(matrix)` broken ?
 >
 > It was. Now if the input is a matrix there is a check

 Okayyy...

 > degrees can not be in another commit since it is used in `.is_t_design`.

 This function was already implemented before.

 Nathann

--
Ticket URL: <http://trac.sagemath.org/ticket/16553#comment:39>
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