TWOEARS / blackboard-system

Two!Ears Auditory Model - Blackboard system module
http://docs.twoears.eu/en/latest/blackboard/
GNU General Public License v2.0
3 stars 2 forks source link

check flag instead of multiple isfield checks #51

Closed kashefy closed 7 years ago

kashefy commented 7 years ago

localizations data is either available in LocationHypothesis or SourcesAzimuthsDistributionHypothesis objects depending on which KS wrote the data to the blackboard. StreamSegregation will try to use the polished LocationHypothesis data and will resort to the data stored as SourcesAzimuthsDistributionHypothesis if the former is not available.

Both Hypthesis classes don't share the exact attribute names, therefore several isfield() calls are made to access the correct properties. This PR replaces the isfield calls with checking a flag that is set, once it is determined which hypothesis class will be used.

Why do we need this? For some reason the isfield method returns false even though the property is available and accessible. I don't know why it wouldn't work in this particular case, but this avoids this odd behavior altogether.

ivo--t commented 7 years ago

Can be merged, with or without my "cleaner" comment above.

kashefy commented 7 years ago

clean up done. Better this way.