Opened 7 years ago

Closed 7 years ago

#12214 closed defect (duplicate)

polygon documentation in error

Reported by: kcrisman Owned by: jason, was
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords: beginner sd35.5 sd40.5
Cc: Merged in:
Authors: Reviewers: Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Type polygon.options for a dictionary of the default options for polygons. 

This seems to not be correct.

sage: polygon.options
---------------------------------------------------------------------
AttributeError: 'function' object has no attribute 'options'

We should fix the documentation to

sage: sage.plot.polygon.polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness': 0}

or something else that fixes this.

Attachments (1)

trac_12214_polygon_options.patch (1.1 KB) - added by ksmith 7 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by ksmith

sage: polygon2d      
<function polygon2d at 0x9c61064>
sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness': 0}
sage: polygon3d
<function polygon3d at 0x9edcd14>
sage: polygon3d.options
{'color': (0, 0, 1), 'opacity': 1}

Here's what actually works

Changed 7 years ago by ksmith

comment:2 Changed 7 years ago by ksmith

  • Authors set to ksmith
  • Status changed from new to needs_review

I just changed the references from polygon.options to polygon2d.options and polygon3d.options.

comment:3 Changed 7 years ago by kcrisman

  • Authors changed from ksmith to Kenny Smith
  • Reviewers set to Karl-Dieter Crisman
  • Status changed from needs_review to needs_work

Apparently the documentation is actually wrong about how reset works. I'll look into this. This should definitely be fixed at the same time, so "needs work", but the initial change is fine.

comment:4 follow-up: Changed 7 years ago by kcrisman

This is really weird. Apparently the resetting of options actually does work! But...

sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness': 0}
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks blue
sage: polygon2d.options['rgbcolor']=(1,0,0)
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks red
sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (1, 0, 0), 'thickness': 0}
sage: polygon2d.defaults()
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness': 0}
sage: polygon2d.reset()
sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (1, 0, 0), 'thickness': 0}
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks blue again like it should

But for some reason the options never changed.

I've asked about this on sage-devel. But in any case if that doesn't work, it is also that way on disk and others (I've checked), so that wouldn't hold things up on this.

Anyway, that means we just have to change to polygon2d.reset() and polygon3d.reset().

comment:5 Changed 7 years ago by ksmith

  • Authors changed from Kenny Smith to Kenneth Smith

comment:6 Changed 7 years ago by ksmith

  • Keywords sd35.5 added

comment:7 in reply to: ↑ 4 Changed 7 years ago by kcrisman

But for some reason the options never changed.

This is now #12300.

comment:8 Changed 7 years ago by kcrisman

  • Authors Kenneth Smith deleted
  • Milestone changed from sage-5.1 to sage-duplicate/invalid/wontfix
  • Status changed from needs_work to positive_review

This is a dup of #6367, more or less. Added the author of this patch there as well.

comment:9 Changed 7 years ago by kcrisman

  • Keywords sd40.5 added

comment:10 Changed 7 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.