Skip to content

Commit

Permalink
Merge pull request #130 from pastas/hpd_extension
Browse files Browse the repository at this point in the history
Add hydropandas extension
  • Loading branch information
dbrakenhoff committed Aug 6, 2024
2 parents 4f8a662 + 3a1c07c commit fa7cee4
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ jobs:
- name: Run pytest
run: |
pytest -m "not bgmap"
pytest -m "not (bgmap or pastas150)"
- name: Test backgroundmap once
- name: Run all tests once
if: ${{ matrix.python-version == '3.11' && matrix.pastas-version == 'git+https://github.com/pastas/pastas.git@dev' }}
run: |
pytest -m "bgmap"
pytest -m ""
- name: Run codacy-coverage-reporter
if: ${{ github.repository == 'pastas/pastastore' && success() }}
Expand Down
14 changes: 14 additions & 0 deletions pastastore/extensions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ruff: noqa: D104 F401
from pastastore.extensions.accessor import (
register_pastastore_accessor as register_pastastore_accessor,
)


def activate_hydropandas_extension():
"""Register Plotly extension for pastas.Model class for interactive plotting."""
from pastastore.extensions.hpd import HydroPandasExtension as _

print(
"Registered HydroPandas extension in PastaStore class, "
"e.g. `pstore.hpd.download_bro()`."
)
15 changes: 15 additions & 0 deletions pastastore/extensions/accessor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ruff: noqa: D100
from pastas.extensions.accessor import _register_accessor


def register_pastastore_accessor(name: str):
"""Register an extension in the PastaStore class.
Parameters
----------
name : str
name of the extension to register
"""
from pastastore.store import PastaStore

return _register_accessor(name, PastaStore)
Loading

0 comments on commit fa7cee4

Please sign in to comment.