Ticket #5891 (closed enhancement: fixed)

Opened 17 months ago

Last modified 5 months ago

Categories for the working mathematics programmer

Reported by: nthiery Owned by: nthiery
Priority: major Milestone: sage-4.3
Component: categories Keywords: categories parents
Cc: sage-combinat, roed, saliola Author(s): Nicolas M. Thiéry, Teresa Gomez-Diaz
Report Upstream: N/A Reviewer(s): Robert Bradshaw, Craig Citro, Florent Hivert, David Kohel, David Roe, Anne Schilling, William Stein, Javier Vengoroso
Merged in: sage-4.3.alpha0 Work issues:

Description (last modified by nthiery) (diff)

This (series of) patch(es) extends the Sage category framework as a design pattern for organizing generic code.

Latest version of the patches:

Status and roadmap:  http://sagetrac.org/sage_trac/wiki/CategoriesRoadMap

Attachments

categories-framework-nt.patch Download (145.6 KB) - added by nthiery 16 months ago.
categories-categories-nt.patch Download (296.9 KB) - added by nthiery 16 months ago.
categories-fixsagelib-nt.patch Download (36.4 KB) - added by nthiery 16 months ago.
categories-enumeratedsets-nt.patch Download (5.3 KB) - added by nthiery 16 months ago.
categories-combinat-nt.patch Download (13.2 KB) - added by nthiery 16 months ago.
categories-numberfield_homset-nt.patch Download (3.8 KB) - added by nthiery 16 months ago.

Change History

  Changed 17 months ago by nthiery

  • description modified (diff)

  Changed 17 months ago by roed

  • cc roed added

  Changed 16 months ago by saliola

  • cc saliola added

  Changed 16 months ago by nthiery

  • description modified (diff)

  Changed 16 months ago by nthiery

  • description modified (diff)

  Changed 16 months ago by nthiery

  • description modified (diff)

  Changed 16 months ago by nthiery

  • description modified (diff)

follow-up: ↓ 11   Changed 16 months ago by robertwb

Where is categories-nt.patch itself?

  Changed 16 months ago by nthiery

  • description modified (diff)

  Changed 16 months ago by nthiery

  • description modified (diff)

in reply to: ↑ 8   Changed 16 months ago by nthiery

Replying to robertwb:

Where is categories-nt.patch itself?

On the sage-combinat patch server. It changes too often to keep it updated on trac. I highlighted the link on top of the description (and improved the ReSTing)

  Changed 16 months ago by nthiery

  • description modified (diff)

  Changed 16 months ago by nthiery

  • description modified (diff)

  Changed 16 months ago by nthiery

  • status changed from new to assigned

Changed 16 months ago by nthiery

Changed 16 months ago by nthiery

Changed 16 months ago by nthiery

Changed 16 months ago by nthiery

Changed 16 months ago by nthiery

Changed 16 months ago by nthiery

  Changed 16 months ago by nthiery

There are the patches. They are file-orthogonal, so they should apply in any order.

  Changed 16 months ago by nthiery

Note: to get the latest version, please use the patch server.

follow-up: ↓ 19   Changed 10 months ago by was

  • status changed from new to needs_work

NOTES:

(1) Post the latest version here -- I don't want to mess with the patch server.

(2) It says "Experts: please redefine this properly and/or put CC/RR/... in NumberFields?()". I number field is by definition a finite extension of QQ, but CC and RR are infinite extensions of QQ. So we can't put them in that category. Having a function is_NumberFieldHomsetCodomain does seem like a good workaround for now.

(3) The function is_NumberFieldHomsetCodomain in the patch posted here doesn't have any documentation or doctests. Please add them.

(4) I would change these two lines:

        143	        if is_Field(codomain): 
 	144	            return True 

to the single line

        143	        return is_Field(codomain)

which should be functionally the same, and clearer to read.

(5) in a similar spirit, I would change

        145	    except: 
 	146	        pass     
 	147	    return False 

to just

        145	    except: 
 	146	        return False

which is again clearer and equivalent.

(6) I'm puzzled by this in your number_field_rel.py patch:

	543	            return NotImplemented 

What is NotImplemented?? It's not defined in the number_field_rel.py file in sage-4.2.

  Changed 10 months ago by nthiery

  • description modified (diff)

in reply to: ↑ 17 ; follow-up: ↓ 24   Changed 10 months ago by nthiery

  • status changed from needs_work to needs_review
  • reviewer set to Robert Bradshaw, Florent Hivert, David Kohel, David Roe, Anne Schilling, Javier Vengoroso
  • description modified (diff)
  • author set to Nicolas M. Thiéry

Replying to was:

NOTES: (1) Post the latest version here -- I don't want to mess with the patch server.

I just added direct links in the description. I will post the patches shortly when they will be final.

(2) It says "Experts: please redefine this properly and/or put CC/RR/... in NumberFields?()". I number field is by definition a finite extension of QQ, but CC and RR are infinite extensions of QQ. So we can't put them in that category. Having a function is_NumberFieldHomsetCodomain does seem like a good workaround for now.

Ok.

(3) The function is_NumberFieldHomsetCodomain in the patch posted here doesn't have any documentation or doctests. Please add them.

Oops. Will do.

(4) (5) (6)

Yes better. Will do.

(6) I'm puzzled by this in your number_field_rel.py patch: {{{ 543 return NotImplemented? }}} What is NotImplemented?? It's not defined in the number_field_rel.py file in sage-4.2.

It's a builtin python object. Anyway, the function now raises a TypeError?, per the latest _Hom_ protocol.

  Changed 10 months ago by nthiery

  • status changed from needs_review to needs_work
  • component changed from misc to algebra

  Changed 10 months ago by nthiery

  • status changed from needs_work to needs_review
  • reviewer changed from Robert Bradshaw, Florent Hivert, David Kohel, David Roe, Anne Schilling, Javier Vengoroso to Robert Bradshaw, Craig Citro, Florent Hivert, David Kohel, David Roe, Anne Schilling, William Stein, Javier Vengoroso
  • description modified (diff)

  Changed 10 months ago by nthiery

  • description modified (diff)

  Changed 10 months ago by nthiery

  • description modified (diff)

in reply to: ↑ 19   Changed 10 months ago by nthiery

Replying to nthiery:

Replying to was: ...

Done! See the linked to patch.

I used the occasion to move the field containment logic into Fields where it belongs.

  Changed 10 months ago by AlexGhitza

  • component changed from algebra to categories

  Changed 10 months ago by mhansen

  • status changed from needs_review to closed
  • resolution set to fixed
  • merged set to sage-4.3.alpha0

Merged the patches from changeset e70487186111. They'll be posted on here in a bit.

  Changed 10 months ago by mvngu

  • milestone changed from sage-combinat to sage-4.3

  Changed 5 months ago by nthiery

  • upstream set to N/A
  • author changed from Nicolas M. Thiéry to Nicolas M. Thiéry, Teresa Gomez-Diaz
Note: See TracTickets for help on using tickets.