icecube / pisa

Monte Carlo-based data analysis
http://icecube.github.io/pisa/
Apache License 2.0
19 stars 49 forks source link

Two underscores in state attribute of MapSet class #640

Open atrettin opened 4 years ago

atrettin commented 4 years ago

When storing/retrieving Map and MapSet objects from dictionaries, one might need the _state_attrs attribute. There are two inconsistencies:

First:

https://github.com/IceCubeOpenSource/pisa/blob/14ed3716eeb5c7ca3a78e55555ef2ef5b774b966/pisa/core/map.py#L2066

In all other classes, the slots of the serializable state are in the class attribute _state_attrs. Only in MapSet, this begins with two underscores. This makes it impossible to access the attribute.

Second:

https://github.com/IceCubeOpenSource/pisa/blob/14ed3716eeb5c7ca3a78e55555ef2ef5b774b966/pisa/core/map.py#L298

The state attributes listed are not identical to those in the serializable state, because error_hist is missing. Is this intentional? Maybe there is something I am not getting. Is the _state_attrs not supposed to list the keys one expects in a dictionary?

thehrh commented 3 weeks ago

This seems to be related to the structure of the HypoFitResult class (see #827)