Now process inchannels, not outchannels
Merged
requested to merge ghsc/users/erigler/geomag-algorithms:process_inchannels_not_outchannels_AverageAlgorithm into master
The original version of AverageAlgorithm.py seemed to be written
to process the Controller's --outchannels
. It "worked" for several
years because --outchannels
defaulted to --inchannels
. But what
we actually always wanted was to process --inchannels
.
Mostly this was just a matter of semantics, but when I recently added
the ability to average fewer than the full complement of inputs, it
was also necessary to change the can_produce_data()
method to check
for "any" instead of "all" channels, which in turn required that the
AverageAlgorithm class properly instantiate its _inchannels
and
_outchannels
class variables, instead of just set them to None
.
To briefly explain the different changes in this commit:
- added
Algorithm.__init__(self, inchannels=[channel])
to ensure thatcan_produce_data()
would work when run via programmatic interface. - added
Algorithm.configure(self, arguments)
toAverageAlgorithm.configure()
to ensure thatcan_produce_data()
would work when run via Controller.py. - changed all variations of
outchannel
toinchannel
- cleaned up where class variables were modified inside process() method