Autodoc will resolve the lazy imports when it tries to get at the 
docstrings, there are various lazily imported objects for which the 
documentation builds just fine. Your problem is most likely elsewhere. 
Whats the trac ticket?

Also, how about moving the matroid code into the sage.geometry.matroid 
subdirectory? There is already some related code in there, including code 
to compute the circuits of a point configuration in 
sage.geometry.triangulation.point_configuration







On Tuesday, February 26, 2013 4:28:21 PM UTC-10, Stefan wrote:
>
> Hi all, 
>
> The matroid code we want to submit to Sage soon has a reasonably complex 
> web of imports: the base class Matroid is abstract, but invokes subclasses 
> of itself (DualMatroid, MinorMatroid, sometimes BasisMatroid) for several 
> of the standard implementations of methods. Of course each of these, in its 
> own file, inherits from the abstract class. 
>
> For the end user, we only want to auto-import a few classes and a 
> constructor function. We want to use lazy_import to play nice with Sage's 
> startup time. After a little struggle I got it to work fine (autocomplete, 
> runtime docstrings and all), but that gives trouble with building the 
> reference manual. I get errors like 
>
> [matroids ] 
> /Users/svanzwam/sage-5.8.beta1/devel/sage/doc/en/reference/matroids/sage/matroids/basis_exchange_matroid.rst:11:
>  
> WARNING: autodoc can't import/find module 
> 'sage.matroids.basis_exchange_matroid', it reported error: "'module' object 
> has no attribute 'BasisExchangeMatroid'", please check your spelling and 
> sys.path 
>
> Not only that, but the corresponding documentation files will be basically 
> empty (or, depending on the command issued, it fails to build) 
>
> With normal imports these warnings vanish and the documentation builds as 
> expected. Should I give up on lazy_import, or is there another way out? 
>
> Cheers, 
>
> Stefan.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to