[obspy-users] subclass of obspy.core.event.magnitude.Magnitude object (or other event object)
christian_baillard at hotmail.com
Tue Mar 5 00:02:02 CET 2019
Dear obspy users,
I'm working on some magnitude estimates and I would like do create a subclass inheriting from "magnitude.Magnitude" obspy object. At this point I just want to have the same attributes as the parent class plus some very simple new attributes such as "corner frequency", "omega_0"...
I just did the following:
def __init__(self,*args, **kwargs):
# initialization code
I wanted to get rid of the warning, but I still get the following:
UserWarning: Setting attribute "fc" which is not a default attribute
What would you advise for defining a new attribute for an obspy class without directly modifying the parent class? Is that the best approach? If yes, how can I get rid of the "warnings.warn"?
I thought about using the AttribDict() and the "extra" attribute but I'm not really interested in writing any xml for now and I would prefer a more direct approach.
Thanks for your help,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the obspy-users