On Monday, December 1, 2014 9:46:04 AM UTC-8, Ben Hutz wrote: > > D={} > for t in G: > D.update({t:[F(t)]}) > The keys here aren't necessarily a problem yet, provided "preperiodic" is careful. However, the values here are computed from an imprecise t and you're hoping that their values will be *exactly* equal to one of the elements in G. This can't work. you're doing numerical work so you'll have to choose an epsilon to do your comparison.
Interval fields apparently hide this (intervals are "equal" if they have non-empty intersection?), but of course hash cannot respect this, because this notion of "equality" isn't transitive. The bug is that CIF elements are hashable at all. Instead of using CIF elements as keys you should use abstract labels and you should build your graph by looking up the abstract labels, or normalize your labels to be exactly the elements originally put in G. Naively that's O(n^2), but with some sort you might be able to speed that up if necessary. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.