Skip to content

Fix slow test#438

Merged
dbrakenhoff merged 9 commits intodevfrom
fix_slow_test
Apr 24, 2025
Merged

Fix slow test#438
dbrakenhoff merged 9 commits intodevfrom
fix_slow_test

Conversation

@dbrakenhoff
Copy link
Collaborator

@dbrakenhoff dbrakenhoff commented Mar 27, 2025

Addresses #437

Just realized, this change will only work if hydropandas is up to date 😇 . Maybe try to pick period with partially available data instead.

@dbrakenhoff dbrakenhoff self-assigned this Mar 27, 2025
@github-project-automation github-project-automation bot moved this to Todo in NHFLO Mar 27, 2025
@dbrakenhoff dbrakenhoff linked an issue Mar 27, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses the slow test issue reported in #437 by modifying the time parameter for the test and updating documentation in the KNMI recharge module.

  • Modified test_get_recharge_not_available() in tests to use a normalized current timestamp and a shifted start time.
  • Updated the docstring and error handling in get_recharge() in nlmod/read/knmi.py.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/test_005_external_data.py Changed time parameter to a normalized timestamp and shifted start date to speed up tests
nlmod/read/knmi.py Revised docstring wording and added error handling for unexpected grid types
Comments suppressed due to low confidence (2)

tests/test_005_external_data.py:44

  • Verify that passing a list containing a single timestamp to set_ds_time is consistent with its expected API. If set_ds_time expects a pd.DatetimeIndex or a different time format, consider updating this accordingly.
time = [pd.Timestamp.now().normalize()]

nlmod/read/knmi.py:75

  • [nitpick] Consider including the actual gridtype in the ValueError message to help with debugging, for example by using f'Unexpected gridtype: {ds.gridtype}. Expected "structured" or "vertex".'
else:

@dbrakenhoff
Copy link
Collaborator Author

This test will keep being super slow until we make a new release of hydropandas or force nlmod to use the dev version of hydropandas in its tests.

@dbrakenhoff dbrakenhoff merged commit ffc1c6e into dev Apr 24, 2025
2 of 4 checks passed
@dbrakenhoff dbrakenhoff deleted the fix_slow_test branch April 24, 2025 12:02
@github-project-automation github-project-automation bot moved this from Todo to Done in NHFLO Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test test_get_recharge_not_available is taking ~800s

2 participants