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

Migrate to hydromt v1 #162

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft

Migrate to hydromt v1 #162

wants to merge 34 commits into from

Conversation

veenstrajelmer
Copy link
Collaborator

@veenstrajelmer veenstrajelmer commented Sep 30, 2024

Issue addressed

Fixes #137

Explanation

Since hydromt v1 is now officially out, I think it is wise to update to that new code. This will avoid dependency issues in the future. The API's are quite different so I have a bit of trouble with converting the code.

What I did:

Error status on 23-10-2024:

=========================== short test summary info ===========================
FAILED tests/test_dflowfm.py::test_read_write_config_empty_paths - TypeError: expected str, bytes or os.PathLike object, not ModelRoot
FAILED tests/test_dflowfm.py::test_setup_mesh2d_refine - KeyError: 'get_mesh'
FAILED tests/test_dflowfm.py::test_setup_channels - TypeError: expected str, bytes or os.PathLike object, not ModelRoot
FAILED tests/test_dflowfm.py::test_write_structures - TypeError: expected str, bytes or os.PathLike object, not ModelRoot
FAILED tests/test_hydromt.py::test_model_class[piave] - TypeError: expected str, bytes or os.PathLike object, not ModelRoot
FAILED tests/test_hydromt.py::test_model_class[local] - TypeError: expected str, bytes or os.PathLike object, not ModelRoot
FAILED tests/test_hydromt.py::test_model_build[piave] - ImportError: HTTPFileSystem requires "requests" and "aiohttp" to be installed
FAILED tests/test_hydromt.py::test_model_build[local] - TypeError: Model.build() got an unexpected keyword argument 'opt'
FAILED tests/test_hydromt.py::test_model_build_local_code - ImportError: HTTPFileSystem requires "requests" and "aiohttp" to be installed
FAILED tests/test_hydromt.py::test_model_build_piave_code - ImportError: HTTPFileSystem requires "requests" and "aiohttp" to be installed
FAILED tests/test_workflows_mesh.py::test_hydrolib_network_from_mesh - TypeError: expected str, bytes or os.PathLike object, not ModelRoot
FAILED tests/test_workflows_mesh.py::test_setup_links1d2d_add_links - TypeError: expected str, bytes or os.PathLike object, not ModelRoot
================== 12 failed, 1 passed, 4 warnings in 10.79s ==================

Blocking hydromt issues:

Feedback for hydromt:

  • would be useful to include in the migration manual something about deprecating self._is_read_mode() and self.is_write_mode() and how to replace these. The same for self._read() and the fact that self.root has to be replaced by self.root.path.

Checklist

  • Updated tests or added new tests
  • Branch is up to date with main
  • Tests & pre-commit hooks pass
  • Updated documentation if needed
  • Updated changelog.rst if needed >> useful to put this in the changelog to make users aware

@veenstrajelmer veenstrajelmer linked an issue Sep 30, 2024 that may be closed by this pull request
@veenstrajelmer veenstrajelmer marked this pull request as draft September 30, 2024 09:51
@veenstrajelmer veenstrajelmer changed the title first steps to hydromt v1 Migrate to hydromt v1 Sep 30, 2024
Copy link

sonarcloud bot commented Oct 24, 2024

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.

Support for hydromt>=1
1 participant