You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@MarkRivers@decarlof I see huge code duplication with the current inheritance scheme. For instance, we have 3 classes tomoscan2bm, tomoscan2bm_step, and tomoscan2b_stream inherited from tomoscan_pso, tomoscan_step, and tomoscan_stream, respectively. However, functionality of these inherited classes is very similar (or even just 100% copy). I suggest to employ dynamic conditional inheritance implemented like this:
class TomoscanPSO():
def __init__(self):
print(f'inheritance from class Pso')
class TomoscanSTEP():
def __init__(self):
print(f'inheritance from class Step')
class TomoscanStream():
def __init__(self):
print(f'inheritance from class Stream')
mdict = {'STEP': TomoscanSTEP,
'PSO': TomoscanPSO,
'STREAM': TomoscanStream
}
def makeclass(type):
class Tomoscan2BM(mdict[type]):
def __init__(self):
super().__init__()
print(f'class 2BM')
return Tomoscan2BM()
a = makeclass('STEP')
In this case, there will be only one class Tomoscan2BM instead of 3, variable 'type' can be taken from the command line.
The text was updated successfully, but these errors were encountered:
@nikitinvv this is a good idea and will eliminate python code duplication but we need also to propagate the conditional inheritance to the IOC/medm screens. Now for example when we run the fly, step or stream we have customized IOC Pvs and associated medm screens.
@MarkRivers @decarlof I see huge code duplication with the current inheritance scheme. For instance, we have 3 classes tomoscan2bm, tomoscan2bm_step, and tomoscan2b_stream inherited from tomoscan_pso, tomoscan_step, and tomoscan_stream, respectively. However, functionality of these inherited classes is very similar (or even just 100% copy). I suggest to employ dynamic conditional inheritance implemented like this:
In this case, there will be only one class Tomoscan2BM instead of 3, variable 'type' can be taken from the command line.
The text was updated successfully, but these errors were encountered: