Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* probably found where the bug #2491 stems from * the DatetimeIndex casting before the index sort was unnecessary and removing it solved the issue * addes a unit test to assert the expected behaviour of the time_index type * Update darts/tests/test_timeseries.py typo in function name Co-authored-by: madtoinou <[email protected]> * * Used set_index for better readability * Included a warning about monotonically increasing index also in the case where time_col is set (analogous to the warning in the case 'time_cole is None and df.index.is_monotonic_increasing) * * changed the testing time index to: i) an unsorted integer list and ii) an unsorted datetimeindex * * only sort if unsorted * potential speed improvement by case distinction within the time column (need to check this again) * * code in comment removed: there is no performance difference between set_index and casting DatetimeIndex when the time_col is of type datetime * * moved the test "test_from_group_dataframe" to where the other test concerning "from_group_dataframe" are allocated * * included a values check * Update darts/timeseries.py Co-authored-by: Dennis Bader <[email protected]> * * included the change in the changelog file * * Changed from_group_datagrame so that it handles different dtypes of time_col values properly (in the prior fix, string dates of the form "2024-01-01" were not coverted to datetimes) * Included a unit test to cover this case * * renamed test to be more descriptive * Update darts/timeseries.py Use else statement for better readability Co-authored-by: madtoinou <[email protected]> * Update darts/timeseries.py cleaner case distinction for the time_index type recasting Co-authored-by: Dennis Bader <[email protected]> * * parametrized the tests with pytest as suggested by Dennis (thanks!) --------- Co-authored-by: madtoinou <[email protected]> Co-authored-by: Dennis Bader <[email protected]>
- Loading branch information