Differences between revisions 2 and 3
Revision 2 as of 2008-02-08 08:15:25
Size: 4199
Editor: DavidRoe
Revision 3 as of 2008-11-14 13:41:55
Size: 4199
Editor: localhost
Comment: converted to 1.6 markup
No differences found!



WRITING .SAGE FILES: Imports Preparser Style

  • documentation
    • formating
    spaces and tabs (no really, this matters)

WRITING .SPYX FILES: Cdefs Cimports <class_name> Interfacing with C and C++ libraries and files Tips for writing fast cython


Things that don't work in cython (yet) Point to cython wiki

PARENTS AND ELEMENTS: Intro Coercion Comparison Functions

  • Parent functions
    • Must Implement
      • init

      • has_coercion_from (cpdef)
      • gen
      • ngens
      • base_extend?
    • For Advanced Users
      • make_coercion_from (cpdef)
      • make_conversion_from (cpdef)
      • make_action_on (cpdef)
      • make_action_by (cpdef)
      • _populate_coercion_lists (cpdef)
    • Advanced Calls
      • get_coercion_from (cpdef)
      • get_conversion_from (cpdef)
      • get_action (cpdef)
    • Generic Functions you might override
      • contains

        • Do we really want to do this? Cases: is mod(3, 5) in ZZ? is Zp(5)(17) in ZZ? is QQ(2) in ZZ? is RR(2) in ZZ?
      • cmp

      • call

    • Not defined functions you may want to define
      • iter

  • Element functions
    • Arithmetic (raise NotImplemented)

      • _add_ (cpdef)
      • _mul_ (cpdef)
      • neg (spec)

      • invert (spec)

    • Arithmetic (With Defaults)
      • _sub_ (cpdef)
      • _div_ (cpdef)
      • _powlong_
      • _pow_
    • Functions you may want to implement
      • _polynomial_

MERCURIAL: Mercurial tutorial Referees Style

  • naming conventions
    • capitalization/underscores functions pretending to be classes Underscores in subtypes of classes


  • philosophy automated testing headers

    what r means and when you should use it. flags on doctests manuals and latex documentation

ADDING TO THE SAGE LIBRARY: Browse the source Doctesting and documentation Exceptions Imports

  • Finding things in the global namespace
    • last word may or may not be appropriate
    from blah import * circular

Factories and weakrefs

  • uniqueness of parents how and why to use a factory other methods for uniqueness


  • why to include sage.misc.latex

_matrix_ and _vector_ Printing model Licensing Use method functions rather than global functions (eg sqrt()) how to add a directory to sage

  • Add an init.py Add an all.py Add package name to list of packages at bottom of setup.py

Optional packages


  • automate Talk to William

setup.py hash and richcmp must be written together. _sig_on and _sig_off

  • functions that have a _sig_off inside

cpdef Crap in the build directory:

  • After deleting a .pyx file.
    • so files in build/sage/... and build/lib.macosx-20.3-i386-2.5/...
    • o file in build/temp.macosx-10.3-i386-2.5/sage/...
    After deleting a .py file
    • nuke .pyc files in the build directory
    nuke the build directory/ sage -ba download the tarball, build from scratch, pull from mercurial repository download the tarball, manually copy files over.

SPKGS Have someone else write this.

HIDDEN GEMS OF THE SAGE LIBRARY: c_lib setup.py sage.ext

sage.rings.integer (check out the bottom for crazy hackery)

sage.structure.element sage.structure.parent sage.structure.coerce sage.categories.morphism

APPENDIX: COERCION Assumption: Codomains are likely to become inaccessible before domains. The main exception is for subobjects, implemented with a single embedding.

Because of this assumption, we store in each Implementing morphisms Implementing Coercion morphisms

days6/sprint/prog_guide/prog_guide/outline (last edited 2008-11-14 13:41:55 by localhost)