On 6/14/12 7:20 AM, Javier López Peña wrote:
        I don't think this should be a problem, but current policy is to
        first deprecate it for a while (usually I've heard one year, see
        also #13109 for something that will hopefully work in the
        future). Presumably you can change the backend but still return
        the weights for now, and make it really clear what code would be
        deleted once the deprecation period was over?


How does one exactly do this in these cases? The sage method is just a
wrapper for networkx one that changed. I don't believe patching NetworkX
source reverting it to the old inconsistent behavior is a good idea. In
this case, since NetworkX is pure python I guess can just copy the old
code under the sage method, but that doesn't seem like a clean solution.
What would we do if the offending component were not python code?

So, to be clear, the new networkx function does not give you as much information as the old one? Generally, in the Sage wrapper for the networkx function, you'd "correct" the return output to take care of the backwards incompatibility. Is there a way to get the missing information easily?

So something like:

def sage_function(...):

   results = networkx.function(...)
   # fix return value
   backwards_compatible_results = ...
   if (this is a case where the result is changing):
      deprecation_warning(...)
   return backwards_compatible_results

Thanks,

Jason



--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to