Skip to content

Commit

Permalink
Merge pull request #95 from pastas/dev
Browse files Browse the repository at this point in the history
Minor update
  • Loading branch information
dbrakenhoff authored May 12, 2023
2 parents b6ef41e + 0043423 commit 44df9ab
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 20 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
pastas-version:
[
"git+https://github.com/pastas/[email protected]",
Expand All @@ -81,7 +81,12 @@ jobs:
- name: Run pytest
run: |
pytest
pytest -m "not bgmap"
- name: Test backgroundmap once
if: ${{ matrix.python-version == '3.9' && matrix.pastas-version == 'git+https://github.com/pastas/pastas.git@dev' }}
run: |
pytest -m "bgmap"
- name: Run codacy-coverage-reporter
if: ${{ github.repository == 'pastas/pastastore' && success() }}
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
8 changes: 0 additions & 8 deletions pastastore/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def _get_library(self, libname: str):
lib : Any
handle to the library
"""
pass

@abstractmethod
def _add_item(
Expand All @@ -94,7 +93,6 @@ def _add_item(
metadata : dict, optional
dictionary containing metadata, by default None
"""
pass

@abstractmethod
def _get_item(self, libname: str, name: str) -> Union[FrameorSeriesUnion, Dict]:
Expand All @@ -114,7 +112,6 @@ def _get_item(self, libname: str, name: str) -> Union[FrameorSeriesUnion, Dict]:
item : FrameorSeriesUnion or dict
item (time series or pastas.Model)
"""
pass

@abstractmethod
def _del_item(self, libname: str, name: str) -> None:
Expand All @@ -129,7 +126,6 @@ def _del_item(self, libname: str, name: str) -> None:
name : str
name of item to delete
"""
pass

@abstractmethod
def _get_metadata(self, libname: str, name: str) -> Dict:
Expand All @@ -149,31 +145,27 @@ def _get_metadata(self, libname: str, name: str) -> Dict:
metadata : dict
dictionary containing metadata
"""
pass

@abstractproperty
def oseries_names(self):
"""List of oseries names.
Property must be overriden by subclass.
"""
pass

@abstractproperty
def stresses_names(self):
"""List of stresses names.
Property must be overriden by subclass.
"""
pass

@abstractproperty
def model_names(self):
"""List of model names.
Property must be overriden by subclass.
"""
pass

def set_check_model_series_values(self, b: bool):
"""Turn CHECK_MODEL_SERIES_VALUES option on (True) or off (False).
Expand Down
2 changes: 1 addition & 1 deletion pastastore/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ def get_model_timeseries_names(
enam = sm["evap"]["name"]
structure.loc[mlnam, pnam] = 1
structure.loc[mlnam, enam] = 1
else:
elif "stress" in sm:
for s in sm["stress"]:
structure.loc[mlnam, s["name"]] = 1
if dropna:
Expand Down
5 changes: 3 additions & 2 deletions pastastore/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,8 @@ def frontiers_checks(
else:
check_gain_passed = np.abs(gain) > 2 * gain_std
checks.loc[
f"gain > 2*std: {sm_name}-{iw:02g} ({sm.distances.index[iw]})"
f"gain > 2*std: {sm_name}-{iw:02g} ({sm.distances.index[iw]})",
:,
] = (
gain,
2 * gain_std,
Expand All @@ -763,7 +764,7 @@ def frontiers_checks(
else:
check_gain_passed = np.abs(gain) > 2 * gain_std
check_gain_passed = np.abs(gain) > 2 * gain_std
checks.loc[f"gain > 2*std: {sm_name}"] = (
checks.loc[f"gain > 2*std: {sm_name}", :] = (
gain,
2 * gain_std,
"(unit head)/(unit well stress)",
Expand Down
2 changes: 1 addition & 1 deletion pastastore/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
PASTAS_VERSION = parse_version(ps.__version__)
PASTAS_LEQ_022 = PASTAS_VERSION <= parse_version("0.22.0")

__version__ = "1.2.0"
__version__ = "1.2.1"
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Hydrology",
]
Expand Down Expand Up @@ -61,9 +62,7 @@ pystore = ["fsspec>=0.3.3", "python-snappy", "dask[dataframe]"]
arctic = [
"arctic", # will not work as releases not uploaded to PyPI
]
arcticdb = [
"arcticdb",
]
arcticdb = ["arcticdb"]
docs = [
"pastastore[optional]",
"sphinx_rtd_theme",
Expand Down
4 changes: 3 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[pytest]
addopts=--durations=0 --cov-report xml:coverage.xml --cov pastastore -v
addopts=--durations=0 --cov-report xml:coverage.xml --cov pastastore -v
markers =
bgmap: test tile download for background map
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import pytest

import pastastore as pst
import arcticdb_ext

# prevent segmentationfault in GH Actions
arcticdb_ext.set_config_int("VersionStore.NumIOThreads", 1)

# "arctic" and "pystore" removed for CI, can be tested locally
params = ["dict", "pas", "arcticdb"]
Expand Down Expand Up @@ -134,7 +138,7 @@ def has_pkg(pkg):
"""
Determines if the given Python package is installed.
Originally written by Mike Toews ([email protected]) for FloPy.
Originally written by Mike Toews for FloPy.
"""
if pkg not in _has_pkg_cache:
# for some dependencies, package name and import name are different
Expand Down
1 change: 1 addition & 0 deletions tests/test_005_maps_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_cumulative_hist(request, pstore):
# %% maps


@pytest.mark.bgmap
def test_map_oseries_w_bgmap(pstore):
ax = pstore.maps.oseries()
# only test bgmap once for pas
Expand Down

0 comments on commit 44df9ab

Please sign in to comment.