Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid cometary designations with a fragment specifier are successfully packed. #407

Open
mkelley opened this issue Aug 27, 2024 · 0 comments

Comments

@mkelley
Copy link
Member

mkelley commented Aug 27, 2024

High-level problem description

Invalid cometary designations with a fragment specifier are successfully packed.

What did you do?

In [3]: Names.to_packed("2024 A-A")
Out[3]: 'K24A00a'

Note that the invalid target "2024 A" fails as expected.

----> 1 Names.to_packed("2024 A")

File /disks/data0/astro/Projects/sbpy/sbpy/data/names.py:190, in Names.to_packed(s)
    186                     raise TargetNameParseError(
    187                         ('{} cannot be turned into a '
    188                          'packed number or designation').format(s))
    189         except (IndexError, ValueError):
--> 190             raise TargetNameParseError(
    191                 ('{} cannot be turned into a '
    192                  'packed number or designation').format(s))
    193 else:
    194     raise TargetNameParseError(
    195         ('{} cannot be turned into a '
    196          'packed number or designation').format(s))

TargetNameParseError: 2024 A cannot be turned into a packed number or designation

What did you expect?

A TargetNameParseError exception.

Proposed solution

Trim the fragment specifier off the designation, parse the string with the usual rules, then account for the fragment.

@mkelley mkelley added potential bug automated label to indicate issue reports data bug and removed potential bug automated label to indicate issue reports labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant