Couldn't find the answer to this question in any old threads, probably because I don't know the terminology involved well enough.
I have a program which takes in data and writes it into a numpy array at the beginning of a pipeline. I use a class called Masterarray to take in the data and form it into an array.
Now I need to add the ability to take in the data and return a modified, but similar array. The new array, call it Darkarray, has all of the same dimensions and properties as the Masterarray, but the values are changed. To make this easy on myself, I set darkarray as an inheritance class so that my metacode looks like:
class Masterarray: def __init__(self, inlist, x_col, dark_col, ref_col): ...... ...... def fcn1: ...... def fcn2: ...... class Dynamic_dark(Masterarray): def __init__(self, inlist, x_col, dark_col, ref_col, sstart, ssend, lstart, lend): ...... ......
My problem is that I have these functions, fcn1 fcn2 etc... that do very simple things, like return columns, rows and other simple operations. Since my inherited class, dynamic_dark is an array of equal dimensions, I thought I could just have these functions be inherited as well. But in my main program, when I call fcn1 or fcn2 even after instantiating the Dynamic_dark class, it returns values for these based on the original class. How do you inherit functions so to speak so that I can call them same function for either array?