ToFuProject / datastock

Provides a generic DataStock class, useful for containing classes and multiple data arrays, with interactive plots
MIT License
3 stars 0 forks source link

show() calls object-specific method that can overloaded #140

Closed dvezinet closed 9 months ago

dvezinet commented 9 months ago

Main changes:

Issues:

Fixes, in devel, issue #139

Examples:

To overload just add a method:

    def _get_show_obj(self, which=None):
        if which == 'inversions':
            def func(coll=None, which=None, lcol=None, lar=None, show=None):
                lcol.append(['inversions', 'b', 'c'])
                lar.append([['inv0', 'A', 'B'], ['inv1', 'C', 'D']])
                return lcol, lar
            return func
        else:
            return super()._get_show_obj(which)