Great, thanks! I now added a _latex_ method to FinitePosets. However, without my patch applied I get doc test failures in /combinat/posets/posets.py which did not happen before. Did something substantial change that causes these failures?
Cheers, Anne posets anne$ hg qtop trac_9280-graded-algebras-example.patch lolita-3:posets anne$ sage -t posets.py sage -t "devel/sage-combinat/sage/combinat/posets/posets.py" ********************************************************************** File "/Applications/sage-5.0.beta3/devel/sage-combinat/sage/combinat/posets/posets.py", line 1428: sage: P = Posets.SymmetricGroupBruhatOrderPoset(4) Exception raised: Traceback (most recent call last): File "/Applications/sage-5.0.beta3/local/bin/ncadoctest.py", line 1231, in run_one_test self.run_one_example(test, example, filename, compileflags) File "/Applications/sage-5.0.beta3/local/bin/sagedoctest.py", line 38, in run_one_example OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags) File "/Applications/sage-5.0.beta3/local/bin/ncadoctest.py", line 1172, in run_one_example compileflags, 1) in test.globs File "<doctest __main__.example_38[6]>", line 1, in <module> P = Posets.SymmetricGroupBruhatOrderPoset(Integer(4))###line 1428: sage: P = Posets.SymmetricGroupBruhatOrderPoset(4) File "/Applications/sage-5.0.beta3/local/lib/python/site-packages/sage/combinat/posets/poset_examples.py", line 388, in SymmetricGroupBruhatOrderPoset for s in Permutations(n)]),element_labels) File "/Applications/sage-5.0.beta3/local/lib/python/site-packages/sage/combinat/posets/posets.py", line 363, in Poset return FinitePoset(D,elements, category = category, facade = facade, key = key) File "/Applications/sage-5.0.beta3/local/lib/python/site-packages/sage/misc/classcall_metaclass.py", line 276, in __call__ return cls.__classcall__(cls, *args, **options) File "/Applications/sage-5.0.beta3/local/lib/python/site-packages/sage/combinat/posets/posets.py", line 532, in __classcall__ category = category, facade = facade, key = key) File "cachefunc.pyx", line 568, in sage.misc.cachefunc.CachedFunction.__call__ (sage/misc/cachefunc.c:2396) File "/Applications/sage-5.0.beta3/local/lib/python/site-packages/sage/graphs/generic_graph.py", line 181, in __hash__ return hash((tuple(self.vertices()), tuple(self.edges()))) TypeError: unhashable type: 'dict' ********************************************************************** File "/Applications/sage-5.0.beta3/devel/sage-combinat/sage/combinat/posets/posets.py", line 1430: sage: [(v,P.rank(v)) for v in P] Expected: [(1234, 0), (1324, 1), ... (4231, 5), (4321, 6)] Got: [(0, 0), (1, 1), (2, 1), (4, 2), (5, 2), (3, 1), (6, 2), (7, 3)] ********************************************************************** 1 items had failures: 2 of 9 in __main__.example_38 ***Test Failed*** 2 failures. For whitespace errors, see the file /Users/anne/.sage//tmp/posets_2310.py [10.9 s] ---------------------------------------------------------------------- The following tests failed: sage -t "devel/sage-combinat/sage/combinat/posets/posets.py" Total time for all tests: 11.0 seconds On 2/17/12 11:25 AM, Nicolas M. Thiery wrote: > On Fri, Feb 17, 2012 at 12:41:27AM -0800, Anne Schilling wrote: >> Do posets have a latex method? Or can they only be viewed using .show()? > > Apparently not: > > sage: P = Posets().example() > sage: P._latex_ > ... > AttributeError: 'FiniteSetsOrderedByInclusion_with_category' object has > no attribute '_latex_' > > I have the following in my .sage/init.sage: > > view_std = view > def view(x, **options): > options["tightpage"] = True > options["pdflatex"] = True > if x in Crystals(): > x = x.digraph() > if x in Posets().Finite(): > x = x.hasse_diagram() > if isinstance(x, DiGraph): > latex_options = {'format': "dot2tex", > 'edge_labels':True,'color_by_label':{1:"blue", 2:"red", 3:"green", > 4:"yellow",-1:"blue", -2:"red", -3:"green",-4:"yellow"}, 'edge_options': > lambda (u,v,l): {'backward': l is not None and l>0}} > if x._latex_opts is not None: > latex_options.update(x._latex_opts._options) > x = copy(x) > x.set_latex_options(**latex_options) > view_std(x, **options) > > You might recognize the typical applications :-) > > Cheers, > Nicolas -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.