Skip to content
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

Add support for NHI GWO database #319

Merged
merged 5 commits into from
Jan 31, 2024
Merged

Add support for NHI GWO database #319

merged 5 commits into from
Jan 31, 2024

Conversation

rubencalje
Copy link
Collaborator

@rubencalje rubencalje commented Jan 29, 2024

This pull request adds support for the NHI GWO databse with extraction data in the Netherlands, mainly form drinking water companies:
https://gwo.nhi.nu/

Users should register at this website to obtain a username and password. For testing purposes, I added my username and password to the Github-secrets, which are used by the tests.

@rubencalje rubencalje marked this pull request as ready for review January 30, 2024 09:23
assert len(empty_lines) == 2

# read properties
skiprows = list(range(empty_lines[0] + 1)) + [empty_lines[0] + 2]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this hard-coded 100 guaranteed to always work?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment got moved I see, the line in question is a few lines before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If there are less than 100 lines in the returned content, this code still works.

However, there are some situations, where no wells or measurements are found, that will give an unclear error, that is not caught yet. I will try to fix this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But there may be more than 100 wells, then this will fail... I removed the 100



@pytest.mark.skip("too slow")
def test_gwo_entire_pumping_station():
Copy link
Collaborator

Choose a reason for hiding this comment

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

out of curiosity, how long does this request take?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not long, a few seconds, but does not test any new lines. But wanted to store this usefull code somewhere.

Copy link
Collaborator

@dbrakenhoff dbrakenhoff left a comment

Choose a reason for hiding this comment

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

Looks good, I made some typo corrections, and just the one question about the hard-coded index. If that's cleared up, it's good to go!

dbrakenhoff and others added 3 commits January 30, 2024 17:23
Add checks for empty empty content
Determine empty lines in get_gwo_wells, to be used in skiprows
@rubencalje rubencalje merged commit 30197dd into dev Jan 31, 2024
5 checks passed
@rubencalje rubencalje deleted the NHI_GWO branch January 31, 2024 10:07
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.

2 participants