Pandas 3.0, create new HDF5 close() method #216
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.
Ready to merge @PaulDudaRESPEC -- All fixes with respect to the pandas 3.0 transition are now passing with full coverage from
python 3.9-12. There was one lingering issue with thetransform()function that just needed me to understand it a little more fully to insure that the calculations would be correct. Thus,SOLRADwas the only timeseries that was not identical (intest10), but that resulted in many changes to the PWATER simulation, which then cascaded into differences in HYDR, and other NPS constituents. This is also preliminarily valid for pandas 3.0.0, that is, code the will execute without error under pandas 3.0.0 and and this same code produces identical results to hspf inpandas < 3.0.0. So this is a good step forward IMO.Under pandas 3.0.0 the test coverage fails -- an error related to pandas, I suspect that there may be deprecated pandas code in
RegressTest, and if so, likely it can be resolved, and then we can see if the test coverage is actually valid. That will be tracked in the formal pandas 3.0.0 issue #209close()method to the custom localHDF5classrun()function to insure that the hdf5 is handled cleanly -- will at last eliminate a warning.pytesterror:ValueError: The file '/opt/model/HSPsquared/tests/test10/HSPFresults/test10.h5' is already opened, but not in read-only mode (as requested).inpandas >= 3.0.0utilities.pyandmain.pyfrom a brief comment to trigger git #207python < 3.11cmd_regression.pythat creates a command prompt friendly tester, as well as leveraging the intermediate products of theRegressTestclass for simulation debugging.RegressTestin the filetests/convert/regression_base.pyto have a silent mode to be a bit more screen friendly (@austinorr this is False by default so no change in previous behavior is made).pandas-3.0.0errorpandas.errors.IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match)THIS IS NOT YET Pandas 3.0 safe. The change to pandas3 are substantial. Most specifically, there have been some things removed from classes, such as the
to_timedelta()method of the.deltaproperty of apandas.timerseries.freq, but most importantly, pandas no longer allowsTimedeltato have things likeY, orMme valid intervals, since they are non-ambiguous. Thus, I am not super optimistic about the IF-THEN constructs in theutilities.pytransform()function continuing to work since it looks at things like the string value of a frequency to see if they have the charactersYandM. The results look OK with test10, but I think we should consider that with more complicated datasets we could definitely encounter timeseries resampling issues. Or maybe not. We can track that in #209