Skip to content

Commit 080cbe7

Browse files
committed
added line to validate comet name
Added a line to disallow comet names that have a number in the second position in order to avoid having parse_comet() incorrectly interpret input like "2015XN77" as a well-formed comet designation (where number=2015, type=X, and name=N77)
1 parent 9360983 commit 080cbe7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sbpy/data/names.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ def parse_comet(s):
436436
if len(el[5]) > 0:
437437
if len(el[5]) > 1:
438438
r['name'] = el[5]
439+
if r['name'][1].isdigit():
440+
raise TargetNameParseError('{} does not appear to be a '
441+
' comet identifier'.format(s))
439442

440443
if len(r) == 0 or 'type' not in r:
441444
raise TargetNameParseError(('{} does not appear to be a '

0 commit comments

Comments
 (0)