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

Move to pyproject.toml #170

Merged
merged 29 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cc98281
move to pyproject.toml
dbrakenhoff May 1, 2023
125c8ed
forgot to include linting in ci install
dbrakenhoff May 1, 2023
6a853f5
fix
dbrakenhoff May 1, 2023
9978392
set correct netcdf version for gh actions
dbrakenhoff May 1, 2023
b61b20d
fix nb
dbrakenhoff May 2, 2023
17bd391
try to fix 'no such kernel' error in rtd
OnnoEbbens May 3, 2023
7bf05e7
revert change because of weird error
OnnoEbbens May 3, 2023
b8e227e
add methods:
dbrakenhoff May 1, 2023
c0770dd
add modelgrid_to_ds function
dbrakenhoff May 1, 2023
1b6488b
code formatting
dbrakenhoff May 1, 2023
224f8ba
improve x, y-origin calculation
dbrakenhoff May 1, 2023
8576c3c
codacy suggestion
dbrakenhoff May 1, 2023
8d242ca
some improvements:
dbrakenhoff May 8, 2023
c4ca68d
set gridgen_ws
dbrakenhoff May 8, 2023
f7b65ed
improve dealing with ssm packages
dbrakenhoff May 8, 2023
0de78bb
fix reading ascii file header if key is not in header
martinvonk May 2, 2023
ad39be6
Minor change in surface_water.py
rubencalje May 3, 2023
f1c920e
Knmi stations (#174)
rubencalje May 8, 2023
f931206
Knmi stations (#174)
rubencalje May 8, 2023
ae08bd1
update pyproject toml
dbrakenhoff May 9, 2023
d7d7f16
codacy
dbrakenhoff May 9, 2023
cbf54e6
Merge remote-tracking branch 'origin/dev' into pyproject_toml2
dbrakenhoff May 9, 2023
fc5839a
merge again...
dbrakenhoff May 9, 2023
9a970d9
modify dependency grouping for rtd
dbrakenhoff May 9, 2023
e42e066
add ipython
dbrakenhoff May 9, 2023
a9f6299
attempt to remove metadata
dbrakenhoff May 9, 2023
d271581
attempt to remove metadata
dbrakenhoff May 9, 2023
2bc181c
attempt to remove metadata
dbrakenhoff May 9, 2023
5312c0f
add ipykernel
dbrakenhoff May 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest-cov
pip install pytest-dependency
pip install codacy-coverage
pip install -e .
pip install -e .[ci]

- name: Lint with flake8
run: |
Expand Down
8 changes: 6 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ sphinx:

# Optionally declare the Python requirements required to build your docs
python:
system_packages: true
install:
- requirements: docs/requirements.txt
- method: setuptools
- method: pip
path: .
extra_requirements:
- ci
- rtd

3 changes: 2 additions & 1 deletion docs/examples/01_basic_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -49,7 +50,7 @@
"- a structured grid based on the subsurface models [Regis](https://www.dinoloket.nl/regis-ii-het-hydrogeologische-model) and [Geotop](https://www.dinoloket.nl/detaillering-van-de-bovenste-lagen-met-geotop). The Regis layers that are not present within the extent are removed. In this case we use 'MSz1' as the bottom layer of the model. Use `nlmod.read.regis.get_layer_names()` to get all the layer names of Regis. All Regis layers below this layer are not used in the model. Geotop is used to replace the holoceen layer in Regis because there is no kh or kv defined for the holoceen in Regis. Part of the model is in the North sea. Regis and Geotop have no data there. Therefore the Regis and Geotop layers are extrapolated from the shore and the seabed is added using bathymetry data from [Jarkus](https://www.openearth.nl/rws-bathymetry/2018.html).\n",
"- starting heads of 1 in every cell.\n",
"- the model is a steady state model of a single time step.\n",
"- big surface water bodies (Northsea, IJsselmeer, Markermeer, Noordzeekanaal) within the extent are added as a general head boundary. The surface water bodies are obtained from a [shapefile](..\\data\\opp_water.shp).\n",
"- big surface water bodies (Northsea, IJsselmeer, Markermeer, Noordzeekanaal) within the extent are added as a general head boundary. The surface water bodies are obtained from a [shapefile](..\\data\\shapes\\opp_water.shp).\n",
"- surface drainage is added using [ahn](https://www.ahn.nl) data and a default conductance of $1000 m^2/d$\n",
"- recharge is added using data from the [knmi](https://www.knmi.nl/nederland-nu/klimatologie/daggegevens) using the following steps:~~\n",
" 1. Check for each cell which KNMI weather and/or rainfall station is closest.\n",
Expand Down
16 changes: 1 addition & 15 deletions docs/examples/03_local_grid_refinement.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -399,22 +399,8 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "artesia",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"name": "python"
}
},
"nbformat": 4,
Expand Down
16 changes: 1 addition & 15 deletions docs/examples/11_grid_rotation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -358,22 +358,8 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "artesia",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"name": "python"
}
},
"nbformat": 4,
Expand Down
16 changes: 1 addition & 15 deletions docs/examples/16_groundwater_transport.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -553,22 +553,8 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "artesia",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"name": "python"
}
},
"nbformat": 4,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion nlmod/read/rws.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_gdf_surface_water(ds):
surface water geodataframe.
"""
# laad bestanden in
fname = os.path.join(nlmod.NLMOD_DATADIR, "opp_water.shp")
fname = os.path.join(nlmod.NLMOD_DATADIR, "shapes", "opp_water.shp")
gdf_swater = gpd.read_file(fname)
extent = dims.get_extent(ds)
gdf_swater = util.gdf_within_extent(gdf_swater, extent)
Expand Down
87 changes: 87 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[build-system]
requires = ["setuptools>=64.0.0", "wheel"]
build-backend = "setuptools.build_meta"


[project]
name = "nlmod"
dynamic = ["version"]
description = "nlmod is an open-source Python package for building Modflow 6 groundwater models from online data sources in The Netherlands"
license = { file = "LICENSE" }
readme = "README.md"
authors = [
{ name = "O. Ebbens" },
{ name = "R. Caljé" },
{ name = "D.A. Brakenhoff" },
]
maintainers = [
{ name = "O. Ebbens", email = "o.ebbens@artesia-water.nl" },
{ name = "R. Calje", email = "r.calje@artesia-water.nl" },
{ name = "D.A. Brakenhoff", email = "d.brakenhoff@artesia-water.nl" },
]
requires-python = ">= 3.8"
dependencies = [
"flopy>=3.3.6",
"xarray>=0.16.1",
"netcdf4>=1.5.7",
"rasterio>=1.1.0",
"rioxarray",
"affine>=0.3.1",
"geopandas",
"owslib>=0.24.1",
"hydropandas>=0.7.1",
"shapely>=2.0.0",
"pyshp>=2.1.3",
"matplotlib",
"dask",
"colorama",
]
keywords = ["hydrology", "groundwater", "modeling", "Modflow 6", "flopy"]
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Intended Audience :: Other Audience',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Scientific/Engineering :: Hydrology',
]

[project.urls]
homepage = "https://github.com/ArtesiaWater/nlmod"
repository = "https://github.com/ArtesiaWater/nlmod"
documentation = "https://nlmod.readthedocs.io/en/latest/"

[project.optional-dependencies]
full = ["gdown", "rasterstats", "geocube", "gdown", "bottleneck", "contextily"]
test = ["pytest>=7", "pytest-cov", "pytest-dependency", "nbformat", "nbconvert>6.4.5"]
lint = ["flake8", "isort", "black[jupyter]"]
ci = ["nlmod[full,lint,test]", "netCDF4==1.5.7"]
rtd = ["nbsphinx", "nbconvert>6.4.5"]

[tool.setuptools.dynamic]
version = { attr = "nlmod.version.__version__" }

[tool.setuptools.packages.find]
where = ["."]

[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
"nlmod.data" = ["*.gleg"]
"nlmod.data.geotop" = ["*.csv"]
"nlmod.data.shapes" = ["*"]

[tool.black]
line-length = 88

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
addopts = "--strict-markers --durations=0"
markers = ["notebooks: run notebooks"]

7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

53 changes: 0 additions & 53 deletions setup.py

This file was deleted.