Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 9248: Use safe_load for PyYAML
Introduced a model class look-up table that alleviates the need to specify the desired model class in the YAML file. Referencing classes in YAML files requires unsafe loading, which is undesirable from a security stand-point. Some refactoring along the way, so the code will run without appending "src" to the PYTHONPATH.
- Loading branch information
Neil Dalchau
committed
Sep 17, 2021
1 parent
d3426bb
commit 500994d
Showing
33 changed files
with
296 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# In this module, you must define the set of supported models. | ||
# The YAML loader enables you to reference each model by string. | ||
|
||
from models import debug, dr_constant, dr_growthrate, dr_blackbox | ||
|
||
LOOKUP = { | ||
'debug': debug.Debug_Constant, | ||
'dr_constant': dr_constant.DR_Constant, | ||
'dr_constant_precisions': dr_constant.DR_Constant_Precisions, | ||
'dr_growthrate': dr_growthrate.DR_Growth, | ||
'dr_blackbox': dr_blackbox.DR_Blackbox, | ||
'dr_blackbox_precisions': dr_blackbox.DR_BlackboxPrecisions, | ||
'dr_hierarchical_blackbox': dr_blackbox.DR_HierarchicalBlackbox | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ numpy==1.18.5 | |
matplotlib | ||
pandas | ||
seaborn | ||
pyyaml | ||
pyyaml | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.