Skip to content

Commit 826f7a2

Browse files
Merge pull request #101 from sgfsweden/dev
2 parents 041dda1 + 7b7c4de commit 826f7a2

File tree

8 files changed

+28
-53
lines changed

8 files changed

+28
-53
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ wheels/
2525
CLAUDE.md
2626

2727
# documentation builds
28-
docs/_build/
28+
docs/_build/
29+
30+
# notebook checkpoints
31+
docs/user_guide/.ipynb_checkpoints/

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ A Python package for detection of deviations in groundwater time series.
1818

1919
## Features
2020

21+
- Manage reference and observation wells with ease
2122
- Programmatically fit observation wells to reference wells
2223
- Visualize fits and deviations
2324
- Save your work, share and pick up later with a custom `.gwref` file format
24-
- More to come...
25+
- Review statistics on fits and deviations
2526

2627
## Installation
2728

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
project = "gwrefpy"
1515
copyright = ""
1616
author = ""
17-
release = "0.4.0"
17+
release = "0.4.1"
1818

1919
# -- General configuration ---------------------------------------------------
2020
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

docs/user_guide/8_using_sgu_wells.ipynb

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@
44
"cell_type": "markdown",
55
"id": "0f0cc3fb-4041-4c96-a87e-c6464a51a4d3",
66
"metadata": {},
7-
"source": [
8-
"# Using SGU wells\n",
9-
"\n",
10-
"This notebook demonstrates the use of the python package `sgu-client` and how to integrate with `gwrefpy`. The package is installed along with `gwrefpy` if recommened add-ons are included: `pip install \"gwrefpy[recommended]\"`\n",
11-
"\n",
12-
"The Geological Survey of Sweden (SGU) serves an API for their groundwater monitoring network. A Python implementation of an API client has been developed in [`sgu-client`](https://github.com/officialankan/sgu-client) which makes getting observed groundwater levels from SGU into Python a breeze. \n",
13-
"\n",
14-
"\n",
15-
"\n",
16-
"```{note}\n",
17-
"The `sgu-client` package is not affiliated with, supported or endorsed by SGU.\n",
18-
"```"
19-
]
7+
"source": "# Using SGU wells\n\nThis notebook demonstrates the use of the python package `sgu-client` and how to integrate with `gwrefpy`. The package is installed along with `gwrefpy` if recommended add-ons are included: `pip install \"gwrefpy[recommended]\"`\n\nThe Geological Survey of Sweden (SGU) serves an API for their groundwater monitoring network. A Python implementation of an API client has been developed in [`sgu-client`](https://github.com/officialankan/sgu-client) which makes getting observed groundwater levels from SGU into Python a breeze. \n\n\n\n```{note}\nThe `sgu-client` package is not affiliated with, supported or endorsed by SGU.\n```"
208
},
219
{
2210
"cell_type": "code",
@@ -45,16 +33,7 @@
4533
"cell_type": "markdown",
4634
"id": "fed96e2d-5a13-4522-a9ce-9274f1fa30d7",
4735
"metadata": {},
48-
"source": [
49-
"## Getting observed groundwater levels\n",
50-
"\n",
51-
"This basic example will show how to fetch observed groundwater levels. For more options, please refer to [these docs](https://github.com/officialankan/sgu-client?tab=readme-ov-file#observed-groundwater-levels).\n",
52-
"\n",
53-
"Below, we wrangle the data in two steps:\n",
54-
"\n",
55-
"1. remove the UTC timezone from the fetched timeseries to achieve compatability with the example model we will load later,\n",
56-
"2. resample to daily medians to align the frequency with that of the example model we will load later"
57-
]
36+
"source": "## Getting observed groundwater levels\n\nThis basic example will show how to fetch observed groundwater levels. For more options, please refer to [these docs](https://github.com/officialankan/sgu-client?tab=readme-ov-file#observed-groundwater-levels).\n\nBelow, we wrangle the data in two steps:\n\n1. remove the UTC timezone from the fetched timeseries to achieve compatibility with the example model we will load later,\n2. resample to daily medians to align the frequency with that of the example model we will load later"
5837
},
5938
{
6039
"cell_type": "code",
@@ -330,19 +309,7 @@
330309
"cell_type": "markdown",
331310
"id": "1ba49a2e-e227-4558-82a0-7e8489a3695c",
332311
"metadata": {},
333-
"source": [
334-
"## Fitting to modeled groundwater levels\n",
335-
"\n",
336-
"SGU serves an API for accessing modeled groundwater levels. Let's explore how we can integrate it with `gwrefpy`. \n",
337-
"\n",
338-
"More examples on fetching modeled groundwater levels can be found [here](https://github.com/officialankan/sgu-client?tab=readme-ov-file#modeled-groundwater-levels).\n",
339-
"\n",
340-
"Below, we first get the metadata for the monitoring well *4_3* to retrieve its coordinates. We use that to get modeled groundwater levels at the site. Lastly, we get the observed levels which we will need for the fitting.\n",
341-
"\n",
342-
"```{note}\n",
343-
"The example below assumes we are interested in modeled **minor resources** (i.e. shallow or fast responding groundwater systems). To use this in production, the user should make sure to now the modeling workflow and the associated uncertainties related to SGUs modeled groundwater levels.\n",
344-
"```"
345-
]
312+
"source": "## Fitting to modeled groundwater levels\n\nSGU serves an API for accessing modeled groundwater levels. Let's explore how we can integrate it with `gwrefpy`. \n\nMore examples on fetching modeled groundwater levels can be found [here](https://github.com/officialankan/sgu-client?tab=readme-ov-file#modeled-groundwater-levels).\n\nBelow, we first get the metadata for the monitoring well *4_3* to retrieve its coordinates. We use that to get modeled groundwater levels at the site. Lastly, we get the observed levels which we will need for the fitting.\n\n```{note}\nThe example below assumes we are interested in modeled **minor resources** (i.e. shallow or fast responding groundwater systems). For real-world applications, users should familiarize themselves with SGU's modeling methodology and the associated uncertainties of the modeled groundwater levels.\n```"
346313
},
347314
{
348315
"cell_type": "code",
@@ -370,9 +337,7 @@
370337
"cell_type": "markdown",
371338
"id": "ee8d43a6-4869-48a1-b85b-529a1182bd4c",
372339
"metadata": {},
373-
"source": [
374-
"Below, we create a model and add the observed levels as a observation well and the modeled levels as a reference well."
375-
]
340+
"source": "Below, we create a model and add the observed levels as an observation well and the modeled levels as a reference well."
376341
},
377342
{
378343
"cell_type": "code",
@@ -660,4 +625,4 @@
660625
},
661626
"nbformat": 4,
662627
"nbformat_minor": 5
663-
}
628+
}

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "gwrefpy"
3-
version = "0.4.0"
4-
description = "A python implementation of the Akvifär reference method for detecting deviations in groundwater level time series."
3+
version = "0.4.1"
4+
description = "A Python package for detection of deviations in groundwater time series."
55
readme = "README.md"
66
license = "MIT"
77
authors = [
@@ -39,6 +39,7 @@ dev = [
3939
"sphinx-autobuild",
4040
"myst-nb>=1.3.0",
4141
"sphinx-design>=0.6.1",
42+
"sgu-client"
4243
]
4344
recommended = ["notebook", "sgu-client"]
4445

src/gwrefpy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__name__ = "gwrefpy"
2-
__version__ = "0.4.0"
2+
__version__ = "0.4.1"
33

44
from .constants import print_constants
55
from .methods.timeseries import analyze_offsets

src/gwrefpy/plotter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,15 @@ def _plot_settings(self, ax, num):
905905
# Skip custom styling, use matplotlib defaults
906906
pass
907907

908-
# limit x axis to data range
909-
ax.set_xlim(left=self._xmin, right=self._xmax)
908+
# limit x axis to data range if not tmax or tmin provided
909+
if self._plot_tmax:
910+
ax.set_xlim(right=pd.Timestamp(self._plot_tmax))
911+
else:
912+
ax.set_xlim(right=self._xmax)
913+
if self._plot_tmin:
914+
ax.set_xlim(left=pd.Timestamp(self._plot_tmin))
915+
else:
916+
ax.set_xlim(left=self._xmin)
910917

911918
# Apply custom formatting only if plot_style is not None
912919
if self._plot_style is not None:

uv.lock

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)