That looks quite cool. spkg's are generally for non-Python files. The way to put a Python file into sage is to convert your .sage file to a .py file (for example, changing "^" to "**" throughout) and then putting it somewhere with the sage library files (for example, in $SAGE_ROOT/devel/sage-main/sage/schemes/generic/) Then you could, from the command line do from sage.schemes.generic.hodge_numbers_ci import * and have access to all of your functionality. Once you do so, get an account on sage_trac (e-mail William), post this as a ticket to include in Sage, get someone to review it and you're all set.
At some point we need to get around to improving the documentation for people in exactly your situation: just starting to contribute to the sage library. It was a project started at Sage Days 6, but hasn't gone very far since then. I like making a CompleteIntersection class eventually. David On Jan 14, 2008 8:38 AM, D. Benjamin Antieau <[EMAIL PROTECTED]> wrote: > To all, > > I've created a sage file to calculate, among other things, the Hodge > numbers of an arbitrary complete intersection. Attached is the .sage file. I > also attempted to create a .spkg file, but it does not seem to work. Mine > contains simply a .py file that the install script puts it > $SAGE_ROOT/local/bin. But, I cannot seem to use it from within sage. Any > help on that front would be appreciated. On the other hand, loading the > .sage file works fine. > > The file itself is well-documented. I would love suggestions for further > methods to add. For instance, at some point I will add the ability to > compute the degrees of the top Chern classes of a threefold. > > I don't see putting this in sage at the moment, but it does lead to the > question: should there be a CompleteIntersection class, which would inherit > from AlgebraicScheme_subscheme_projective. If so, then I could put this code > in that class in the characteristic zero case. > > Ben Antieau > > Example: > > The Hodge numbers of a crazy fourfold. The list of integers is the list of > degrees of the complete intersection. > sage: hodge_numbers_ci([2,4,6,3,6,4,3,2,9,5],4) > [ 1 0 0 0 2658146543] > [ 0 1 0 22238665343 0] > [ 0 0 42452753184 0 0] > [ 0 22238665343 0 1 0] > [ 2658146543 0 0 0 1] > > The file provides the following functions: > chiy_characteristic_ci(degrees,index,yprecision,zprecision) > hodge_numbers_ci(degrees,dimension) > betti_numbers_ci(degrees,dimension) > euler_characteristic_ci(degrees,dimension) > topological_euler_characteristic_ci(degrees,dimension) > arithmetic_genus_ci(degrees,dimension) > geometric_genus_ci(degrees,dimension) [==arithmetic_genus_ci] > K_squared_surface_ci(degrees,dimension) [computes the degree of K^2 of a > complete intersection surface] > c2_surface_ci(degrees,dimension) [computes the degree of the second Chern > class of a complete intersection surface] > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---