PropertSet/List v. python

https://jira.lsstcorp.org/browse/DM-5643 adds a method to convert PropertyList to a nested dict. There’s some discussion on github of the desirability of this approach, and I’d like to move it here.

If we started now, we’d never have designed PropertyList the way it is now, with an API inconsistent with dict (e.g. a names() method not keys). However, there was pushback to simply making PropertyList quack like a dict as this has been tried by various people and it isn’t as simple as it might seem.

Do or should we have plans to do some or all of:

  • retiring PropertySet/List in favour of some new class
  • doing a “proper” rewrite to make them fully pythonic (stealing ideas from e.g. astropy.io.fits.Header)
  • providing a way to make the pythonic interfaces visible transparently from python, while preserving the underlying C++ interfaces (which are rarely used, certainly in new code)

DM-5643 is intended to provide a way to play better with astropy so I’m not trying to derail it, but it isn’t the final solution.

As someone coming to the stack from the Python side, I would support a rewrite of PropertyList and PropertySet to be Pythonic.

I’m very much in favor of rewriting PropertyList and PropertySet; my only concern is that we take our time and thoroughly review any design before proceeding with it (and, as @rhl said, that we don’t hold up DM-5643, which was intended to be a small and easy ticket).

I’ll also note that this is the sort of “we should do this” project that typically goes nowhere unless it’s clearly assigned to a Team, so we probably need to figure out who it belongs to if we want to get it done.

1 Like