glasgowcompbio / vimms

A programmable and modular LC/MS simulator in Python
MIT License
19 stars 6 forks source link

Controller has too many parameters in the constructor #77

Closed joewandy closed 4 years ago

joewandy commented 4 years ago

When creating say the TopN or the SmartROI controllers, there are too many parameters that can be passed in. This makes the codes messy -- especially when we create a new controller that extends from an existing one, and need to pass all those parameters to the super constructor.

Example: https://github.com/sdrogers/vimms/blob/master/vimms/Controller/roi.py#L253-L269.

Should wrap all those common parameters into its own class.

sdrogers commented 4 years ago

Does it need a whole class? What about just a dictionary?

sdrogers commented 4 years ago

and would it be one class to hold options for all controllers? Or subclass for each controller?

joewandy commented 4 years ago

I'm thinking just one class for the common parameters shared by all controllers, e.g. (AGC, maxit, etc). The others remain as they are, ie. passed as arguments in the constructor.