maxmahlke/rocks

`rocks diameters` broken

Closed this issue · 1 comments

Hi Max,

It seems that rocks diameters is currently (in version 1.7.2) broken for all (?) asteroids. This is a regression - 1.6.12 worked fine. I updated today and cleared the cache and the issue appeared.
Example terminal output:

$ rocks diameters Ryugu
Traceback (most recent call last):
  File "/home/lauri/.local/bin/rocks", line 8, in <module>
    sys.exit(cli_rocks())
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1651, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1698, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "/home/lauri/.local/lib/python3.10/site-packages/rocks/cli.py", line 45, in get_command
    return echo()
  File "/home/lauri/.local/lib/python3.10/site-packages/rocks/cli.py", line 357, in echo
    datacloud.pretty_print(rock, core.rgetattr(rock, param), param)
  File "/home/lauri/.local/lib/python3.10/site-packages/rocks/datacloud.py", line 43, in pretty_print
    catalogue = catalogue.dropna(subset=["diameters"])
  File "/usr/lib/python3.10/site-packages/pandas/util/_decorators.py", line 331, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pandas/core/frame.py", line 6561, in dropna
    raise KeyError(np.array(subset)[check].tolist())
KeyError: ['diameters']

Thanks Lauri! The column is named diameter, not diameters. Fixed in 1.7.3.