-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cut new version #30
Cut new version #30
Conversation
This option was dropped in SMRF with PR#205
This deprecates the HRRR class, which was broken up into the data.hrrr structure in a previous commit. The class was kept around for backwards compatibility and this change will also include a version bump.
The file contained had dependencies that were not met in this repository and usage with this library has changes since.
The method has moved to the FileHandler.
Right now, this requires a manual push to pypi. I want to move this to Github actions and add the deployment piece to it. Then creating a release would publish to pypi. I can get to that next week, WFR isn't too complicated for testing and deployment. |
@@ -10,8 +10,7 @@ class RMETestCase(unittest.TestCase): | |||
""" | |||
Base class for all unit tests using the RME data | |||
""" | |||
test_dir = Path(__file__).parent | |||
basin_dir = test_dir.joinpath('RME') | |||
basin_dir = Path(__file__).parent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain moving this file? It seems to go against how SMRF/AWSM are setup to test with basins. Just trying to think of how the format fits with the other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this in here because I see this as the next improvement over how SMRF/AWSM does it and would also like to see this change propagate to there. If you look at the class, it basically describes the structure of the basin dir test data and is all you need in order to use the data in tests.
It also clearly separates test data from test logic, moving it in there.
Last argument I see is that the test_dir
property was removed and this was never used anywhere else, showing that moving the class into the folder is the better place to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does seem to be cleaner if we move that route. Then in SMRF, the RME/Lakes would be under their presepective directories.
The one major downside I see is discoverability for that class. You pretty much have to know that it's there, as in the SMRF case, it'll be buried a few directories down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see this downside addressed with documentation. Currently we have a need for that as a whole, on how they are set up, what parts tests what, or when it is appropriate to updated the gold files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes to documentation. But it's way easier to just code.
Rename parameter in method to `file_dir` from `output_dir` and add as class property. The current implementation utilized the 'output_dir' property from the base class, which is parsing the `output_dir` value from a config file. However, calling this method should not overwrite this property.
The start and end date are already initialized in the ConfigFile base class.
There were two separate places where the dataframe was read and data manipulated. This combines them into one method.
if key == 'cloud_factor': | ||
dataframe['cloud_factor'] = 1 - dataframe['cloud_factor'] / 100 | ||
|
||
return metadata, dataframe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this into the convert_to_dataframes
method. Seems a better place and consolidates any dataframe logic.
@@ -26,10 +26,8 @@ def __init__(self, config_file=None, external_logger=None): | |||
__name__, config_file=config_file, external_logger=external_logger | |||
) | |||
|
|||
self.start_date = None | |||
self.end_date = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary double initialization. Already happening in the parent base class.
@@ -3,7 +3,7 @@ | |||
|
|||
import pandas as pd | |||
|
|||
from tests.RME_test_case import RMETestCase | |||
from tests.RME import RMETestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this as a readability improvement and another argument for moving the class into the folder.
Move the basic parameters for file type and file directory to the initializer. This separates the type of data from the `get_saved_data` method, where filters for the data are given with parameters.
Rename the `config_file` parameter and rename to config to support either a .ini style file or a dictionary.
Consolidate the log messages by using the same logger.
There is no need to record an initialization entry in the log when using an external logger. This also combines the logic for creating a logger and then recording the above mentioned entry.
No version of less than 3.5 is supported by this library anymore.
@@ -10,8 +10,7 @@ class RMETestCase(unittest.TestCase): | |||
""" | |||
Base class for all unit tests using the RME data | |||
""" | |||
test_dir = Path(__file__).parent | |||
basin_dir = test_dir.joinpath('RME') | |||
basin_dir = Path(__file__).parent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does seem to be cleaner if we move that route. Then in SMRF, the RME/Lakes would be under their presepective directories.
The one major downside I see is discoverability for that class. You pretty much have to know that it's there, as in the SMRF case, it'll be buried a few directories down.
I will be working on the new release over the next couple of days. I'll also be moving to |
|
I would like to cut a new version for the library as I:
forecast_flag
option when loading data onget_saved_data
output_dir
parameter toinput_dir
onget_saved_data
Can we make this 0.7?
I would need guidance on how you usually cut a new release.
Then I can follow up with SMRF to either pin the version to below the suggested new one or change the one call we do from SMRF.
Update 20210424
Got carried a way a bit and changed a few more things.
FileLoader
now takes thefile_dir
and'file_type
as initialize argumentsconfig_file
toconfig
See more explanations in the commit message for each change.