consequently use get_testfile by emanuel-schmid · Pull Request #822 · CLIMADA-project/climada_python
I think the method get_test_file is great. However, the current test file names in CLIMADA are very cryptic. Could we improve on that? Maybe we make better names, or the function allows for a name/description that is more useful?
renaming the test datasets is a very good idea! However - I'd prefer to do it in another PR. This one doesn't touch the names, only the way to get to the data. And it gets rid of the superfluous climada/hazard/test/data/atl_prob_no_name.mat file!
The main reason for not delaying this is the version check, that allows to update test datasets in the data api without having to touch the code too.
| Directory for writing (and subsequent reading) of temporary files created during tests. | ||
| """ | ||
| HAZ_TEST_MAT :Path = Path(hazard_test.__file__).parent.joinpath('data', 'atl_prob_no_name.mat') | ||
| HAZ_TEST_MAT :Path = get_test_file('atl_prob_no_name', file_format='matlab') |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to sometimes use the HAZ_TEST_MAT :Path = style and sometimes HAZ_TEST_MAT = ?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason, except that no type annotation has been changed in this PR.
Can we also add a note in the developers guide to refer to this way of getting test data? Then over time it will harmonize.
I've added the note in the Developer Guide PR: a8c6716
I've added the note in the Developer Guide PR: a8c6716
Excellent!
This file contains hidden or 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