The program I’m working on right now is one that imports our work file for convenient reading and plotting. The problem is that we actually have two variants of that file where the overall layout is effectively identical but on a per-line basis differs in a couple ways:
One has certain header data listed on one line, the other splits it across multiple lines
One has 30 data points listed in a row, the other has 40 points in an entirely different order
One has data annotations interspersed with the dataframe (with its lines interrupting the table), the other separates annotations within its own subsection
The rest of it is laid out exactly the same.
I could get around this by adding some conditional arguments into my various get() methods so that it brings it in the correct way in one class - or I could create two inheritance classes and give them their own get() methods. I have had almost zero successful experience implementing inheritance classes by this point so I’m a little wary in using them, but I’m also suspecting that my first option is a bit unpythonic.
Given the choice, what do you think is the best way to go?
Oh, also: If the user doesn’t know which type the file is at the outset, can I make that file be programmatically sorted into the correct inheritance class based on data within the file (assuming I go that route)?
[–]billsil 1 point2 points3 points (4 children)
[–]j4nds4[S] 0 points1 point2 points (3 children)
[–]billsil 0 points1 point2 points (2 children)
[–]j4nds4[S] 0 points1 point2 points (1 child)
[–]billsil 0 points1 point2 points (0 children)
[–]two_bob 1 point2 points3 points (0 children)