Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix various warnings revealed by pytest (#273)
* Update time frequency in test_get_onc_ferry test Change to lowercase "s" for seconds frequency in the sample time pandas date range generation in test_get_onc_ferry unit test. This change resolves: FutureWarning: 'S' is deprecated and will be removed in a future version, please use 's' instead. * Update delimiter in daily_river_flows CSV read The delimiter for the pandas.read_csv() function has been changed from `delim_whitespace=True` to `sep="\s+"`. This change resolves: FutureWarning: The 'delim_whitespace' keyword in pd.read_csv is deprecated and will be removed in a future version. Use ``sep='\s+'`` instead. * Update dimension assertions in several tests Changed the assertions to use 'sizes' instead of 'dims'. This change resolves: FutureWarning: The return type of `Dataset.dims` will be changed to return a set of dimension names in future, in order to be more consistent with `DataArray.dims`. To access a mapping from dimension names to lengths, please use `Dataset.sizes`. * Add assertions for expected CSV read ParserWarning Updated the test_daily_river_flows.TestReadRiverCSV.test_one_long_line() test to assert the expected ParserWarning. This warning is raised when there are differences in the lengths of the lines being parsed in the CSV data. Now, the test checks the warning's content to confirm its origin from mismatched length. * Update pandas Series value assignment re: pandas 3 Modified how Theodosia "Secondary River Flow" data is filled in case of null values in the 'daily_river_flows' and 'make_v202111_runoff_file' workers. Instead of using inplace=True method, a more explicit assignment operation has been used to ensure compatibility with pandas 3.0. This change resolves: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method. The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy. For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.
- Loading branch information