Fix test_with_attrfile bug and re-enable test #194
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Fixes #3
Summary of changes
Broke subclass parser search in get_parser out into separate function that returns a list of all subclass parsers found
Implementation notes
An unordered set the type of the global variable
_registered_parser_classes
. What causes the bug is the unordered nature of processing this set. Each implementation of the abstractAttributeParser
registers itself when opencsp fires up. WhenSpotAnalysisAttributeParser
is encoutered first duringAttributeManager
/get_parser
, the unordered structure of_registered_parser_classes
can result in the fall-through path to search and returning a subclass parser. This in-turn results in some members of the parser,date_collected
in this instance, not getting initialized. Removing the fall back path of searching for subclass parsers inget_parser
fixes this spurious failure.Submission checklist
develop
, notmain
opencsp/test/test_DocStringsExist.py
are verified to include this change or have been updated accordinglydoc/
are verified to include this change or have been updated accordinglyAdditional information
It's not clear to me what the original intended functionality of
get_parser
was. Reviewers should check the doc strings and any potential breakage via removal of subclass parser searching.