#6586: [with spkg, needs review] update Sphinx to version 0.6.2
-------------------------+--------------------------------------------------
 Reporter:  jhpalmieri   |       Owner:  mabshoff  
     Type:  enhancement  |      Status:  new       
 Priority:  major        |   Milestone:  sage-4.1.1
Component:  packages     |    Keywords:            
 Reviewer:               |      Author:            
   Merged:               |  
-------------------------+--------------------------------------------------

Comment(by mpatel):

 Apparently, the culprit is `sphinx.pycode`'s Python source analyzer, which
 `sphinx.ext.autodoc` uses to extract ''attribute'' docstrings.  From
 `Sphinx-0.6.2-py2.6.egg/sphinx/pycode/__init__.py`:
 {{{
     The docstrings can either be in special '#:' comments before the
 assignment
     or in a docstring after it.
 }}}
 According to the analyzer, there are just two places to find such
 docstrings in the Sage library:
  * `combinat/designs/block_design.py`
  * `schemes/elliptic_curves/ell_field.py`
 Still, resource use is high, because there is a '''lot''' of caching going
 on.  We can reduce it with [http://docs.python.org/library/weakref.html
 weak references]:
 {{{
 --- __init__.py.orig    2009-08-01 09:58:27.303927239 -0700
 +++ __init__.py 2009-08-01 11:35:17.477865562 -0700
 @@ -120,10 +120,11 @@ class PycodeError(Exception):
              res += ' (exception was: %r)' % self.args[1]
          return res

 -
 +import weakref
  class ModuleAnalyzer(object):
      # cache for analyzer objects -- caches both by module and file name
 -    cache = {}
 +#    cache = {}
 +    cache = weakref.WeakValueDictionary()

      @classmethod
      def for_string(cls, string, modname, srcname='<string>'):
 }}}
 This does reduce build time and memory usage, but I don't know if the
 output is identical.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6586#comment:11>
Sage <http://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
-~----------~----~----~----~------~----~------~--~---

Reply via email to