LSSTDESC/healsparse

error for bum inputs

Closed this issue · 6 comments

@erykoff mentioned to me it might be nice to provide a more sane error if a dumb user like me feeds an array in for a scalar for various things (e.g., healsparse.Circle).

Currently this will give a cryptic healpy error if you give an array of circle radii, but we can do better!

Do we want to support the case where if lists of ra, dec, radius of the same size are passed, we generate a list of Circle objects?

That seems far too fancy. Python zip was created for a reason.

The actual reason not to is idioms. Instantiating an object and getting back a list of those objects is unexpected.

If you want to do this, add a class method that is called from_iterable or something?

Thanks @beckermr! I think that's a good point. I'll stick to just clarify the docstrings and the error message.

I addressed this in #108. Please @beckermr feel free to reopen if you feel that the solution implemented is not sufficient. Thanks!