I have an object with a lot of methods. These methods can be grouped or clustered. Groups are e.g. 'model1', 'model2',..., which have methods like calc_density
,calc_temperature
, get_temperature
,...
Another group 'modify' would collect all methods to modify the data of the object (a dict).
Right now I have all methods in the single file, which will in future grow (roughly 50-200 methods). I "solve" the problem with adding the group name to the method name, which I think is not nice.
my_object.model1CalcDensity
my_object.model2CalcTemperature
my_object.modifyApplyLimits
Ideally, I would like to have a structure like
my_object.model1.CalcDensity
my_object.model2.CalcTemperature
my_object.modify.ApplyLimits
and the methods of a group should be in a separate file for each group. I know, how I would do this with simple functions in a module, but am not sure how this works with methods of an object. (But I have to admit that my Python knowledge is very limited) Is there a "standard" solution?