Cool, and then you can call Poset(digraph_spkg()).


On Tuesday, January 29, 2019 at 12:56:07 PM UTC-8, Frédéric Chapoton wrote:
>
> Quick tentative, not smooth:
>
> from sage.misc.package import *
>
>
>
>
> def digraph_spkg():
>     """
>     digraph
>     """
>     opts = {}
>
>
>     local = opts.pop('local', False)
>     ignore_URLError = opts.pop('ignore_URLError', False)
>     exclude_pip = opts.pop('exclude_pip', False)
>     if opts:
>         raise ValueError("{} are not valid options".format(sorted(opts)))
>
>
>     installed = installed_packages(exclude_pip)
>
>
>     pkgs = {}
>
>
>     for p in os.listdir(SAGE_PKGS):
>         try:
>             f = open(os.path.join(SAGE_PKGS, p, "dependencies"))
>         except IOError:
>             # Probably an empty directory => ignore
>             continue
>
>
>         with f:
>             deps = f.read().splitlines()[0].strip()
>
>
>         if 'no dependencies' in deps:
>             continue
>         if 'not a real package' in deps:
>             continue
>             
>         pkgs[p] = [u for u in deps.split() if u != "|" ]
>
>
>     return DiGraph(pkgs)
>
>
>
>
> Le mardi 29 janvier 2019 19:45:07 UTC+1, Dima Pasechnik a écrit :
>>
>> Has anyone written code to compute it? 
>> (and create a Sage graph out of it, maybe) 
>>
>

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to