You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest to resolve this issue by introducing a base class, like this:
class Observation:
"""Observation base class."""
# empty, nothing for now
# will grow methods, might become an abc.ABC
class MemoryObservation(Observation):
# exactly what we have now
class DataStoreObservation(Observation):
# exactly what we have now
and to adapt docstrings like in MapDatasetMaker (and isinstance checks if we have any).
That's something that can be done in ~ 1 hour, and IMO is the right, achievable solution for v1.0.
The Observation and Observations parallels the design of Dataset and Datasets, where Dataset is a small base class: https://docs.gammapy.org/dev/api/gammapy.modeling.Dataset.html
- add Observation base class for DataStoreObservation and MemoryObservation as suggested in gammapy#2638
- change Observations inheritance to MutableSequence to gain .append(), .extend(), .pop(), .remove() methods as discussed in gammapy#2678
- add Observation base class for DataStoreObservation and MemoryObservation as suggested in gammapy#2638
- change Observations inheritance to MutableSequence to gain .append(), .extend(), .pop(), .remove() methods as discussed in gammapy#2678
QRemy
added a commit
to QRemy/gammapy
that referenced
this issue
Jan 30, 2020
- add Observation base class for DataStoreObservation and MemoryObservation as suggested in gammapy#2638
- change Observations inheritance to MutableSequence to gain .append(), .extend(), .pop(), .remove() methods as discussed in gammapy#2678
I noticed in https://docs.gammapy.org/dev/api/gammapy.cube.MapDatasetMaker.html that all the docstrings say that they support
DataStoreObservation
.Really now we have two classes that are (or should be) supported here and in other places where an observation is used:
I suggest to resolve this issue by introducing a base class, like this:
and to adapt docstrings like in
MapDatasetMaker
(and isinstance checks if we have any).That's something that can be done in ~ 1 hour, and IMO is the right, achievable solution for v1.0.
The
Observation
andObservations
parallels the design ofDataset
andDatasets
, whereDataset
is a small base class: https://docs.gammapy.org/dev/api/gammapy.modeling.Dataset.html@AtreyeeS @adonath @registerrier - Thoughts?
Anyone willing to send a PR? (otherwise I'd be happy to do it, if it's agreed that it's an improvement)
The text was updated successfully, but these errors were encountered: