Opened 14 years ago

Closed 14 years ago

#4755 closed defect (fixed)

[with patch, positive review] CremonaDatabase().number_of_curves() should work when the optional database isn't installed.

Reported by: Mike Hansen Owned by: Carl Witty
Priority: minor Milestone: sage-3.3
Component: misc Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

sage: CremonaDatabase().number_of_curves()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)

/home/mike/.sage/temp/mike_laptop/12400/_home_mike__sage_init_sage_0.py in <module>()
----> 1 
      2 
      3 
      4 
      5 

/opt/sage/local/lib/python2.5/site-packages/sage/databases/cremona.pyc in number_of_curves(self, N, i)
    680         """
    681         if N == 0:
--> 682             return self['number_of_curves']
    683         C = self.allcurves(N)
    684         if i == 0:

/opt/sage/local/lib/python2.5/site-packages/sage/databases/cremona.pyc in __getitem__(self, N)
    345         if isinstance(N, str) and len(N) > 0:
    346             if N[0].isalpha():
--> 347                 return sage.databases.db.Database.__getitem__(self, N)
    348             else:
    349                 return self.elliptic_curve(N)

/opt/sage/local/lib/python2.5/site-packages/sage/databases/db.pyc in __getitem__(self, x)
    258         try:
    259             if not isinstance(x, slice):
--> 260                 return self.root[x]
    261             return [self[k] for k in range(x.start, x.stop, x.step)]
    262         except AttributeError:

KeyError: 'number_of_curves'

Attachments (1)

trac_4755.patch (4.8 KB) - added by Alex Ghitza 14 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 14 years ago by Alex Ghitza

Same issue with number_of_isogeny_classes().

comment:2 Changed 14 years ago by Alex Ghitza

Summary: CremonaDatabase().number_of_curves() should work when the optional database isn't installed.[with patch, needs review] CremonaDatabase().number_of_curves() should work when the optional database isn't installed.

The attached patch fixes the two issues, as well as a number of smaller issues that I noticed while looking through cremona.py.

Changed 14 years ago by Alex Ghitza

Attachment: trac_4755.patch added

comment:3 Changed 14 years ago by Robert Bradshaw

Summary: [with patch, needs review] CremonaDatabase().number_of_curves() should work when the optional database isn't installed.[with patch, positive review] CremonaDatabase().number_of_curves() should work when the optional database isn't installed.

Looks and works good for me. Lots of other documentation and other typo fixes too.

comment:4 Changed 14 years ago by Michael Abshoff

Milestone: sage-3.4.1sage-3.3
Resolution: fixed
Status: newclosed

Merged in Sage 3.3.alpha2.

Cheers,

Michael

Note: See TracTickets for help on using tickets.