I currently have a parent abstract class that has many children that inherit from it. Basic structure looks like this:
import sqlite3
import os
from abc import ABCMeta, abstractmethod
class ParentClass(object):
"""DOCSTRING"""
__metaclass__ = ABCMeta
def __init__(self, base_path, state_name):
... other methods etc
class ChildClass1(ParentClass):
def __init__(self, base_path):
"""DOCSTRING"""
state_name = 'chromosome'
super().__init__(base_path, state_name)
...other methods etc
class ChildClass2(ParentClass):
def __init__(self, base_path):
"""DOCSTRING"""
state_name = 'ftszRing'
super().__init__(base_path, state_name)
...other methods etc
...other child classes that all inherit from the abstract parent class.
To me it makes much more sense to split this code into files: parent_class.py child_class1.py child_class2.py child_class3.py etc etc
I could do this and just import the parent class into the child class but it doesn't make sense to have a parent module. The parent class is abstract and it doesn't make sense to have an instance of the parent. In addition I like the way things are currently inherited and importing the parent class seems like it will change this.
Essentially is it possible to split this code into files as above without making significant changes to the code? The only way I can figure out how to do this is to have the parent class in every file but this doesn't seem "right"....