Skip to content

Commit

Permalink
v2.0.0 New release compatible with Landlab 2.0 (#150)
Browse files Browse the repository at this point in the history
* specify landlab less than version 2 (#147)

* Update Terrainbento to be compliant with Landlab version 2.0 (#149)

* specify version

* boundary condition flags

* geq instead of g

* pytest terrainbento passes

* update to new HexModelGrid init signature

* disable warnings

* update notebook

* use assert_array_equal instead of round

* update makefile

* remove unnecessary imports

* uncheck a lint exception

* use correct version number

* add 3.8

* print durations

* two new fixtures

* reduce testing time

* fix small bug for 2.0 transition

* reduce time

* reduce time

* reduce notebook grid times

* reduce test times.

* reduce test time

* pretty

* ci cleanup/updating

* install landlab with --pre

* getting docs to build

* put appveyor  back to prior commit

0a57b95
  • Loading branch information
kbarnhart committed Feb 13, 2020
1 parent fb45a80 commit ba0e353
Show file tree
Hide file tree
Showing 72 changed files with 835 additions and 889 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ os:
- osx
env:
matrix:
- CONDA_ENV=3.7
- CONDA_ENV=3.6
- CONDA_ENV=3.7
- CONDA_ENV=3.8
global:
- MPLBACKEND=Agg
- secure: JPEQfViEt1HJ4G1jAahCf1epqwvFqiH2VMNJkLmf/KGBouWQVM/dUXKAybueRFK8MFgblx1WXFo9usJDxugF4Gok4FVKd3h7qRfREVfJwmZ/Cul3z9Lq61cIpSicPsaRWKB8jks1B+oGolWnY0C4Mq6vNewcWmZ/5OTfqEGt+6qMVFBFep2iHnNn556v4YKvjeVoYhl4nZIYXXnQ7TpWRAL2tLvxe65VEn9EOfgpDmpnTKbKeBtWE2yxFKruTGB194CbHnDaw1Rkp90No6KFqzq5l5kksAvtS7YYjoPRlPP8PzUcprymPwakANQ5kSr66fkaWCXApbVU8VUE+MPDR0YKtVmw0TJWKipCzkQOtginE/ZAcD326VHKPho+nRBfWGwxr4rnc303dSmwYKL1x+sowCaMuS74cARPhQRMxQDT2FpBglKazjeqX4euvG/IMGc7YQVdSDkxnNGO5+1GsAVN4Xfd/3tI2NgvMg0FVdD3rKJLEWb912wTwl4mm2dm2mMU3YvYrFVRvNtNZPNNJGlVtf93pNKxyyCDdFDfs4kh2tbrVfSin3Ku5s/qxtcjGeYGbEETbUUoBlQSemYiNrgbv+fn+snr+x7q1kV49vE+C5pxjtaaAnCp+oxWuzpXGwDvwthIT/3U6P5R6HE8l49FABGHOeX8PJcC2TJ8ZcI=
Expand All @@ -24,13 +25,13 @@ jobs:
- conda activate terrainbento_docs
- pip install -e .
script:
- make -C docs clean html
- make -C docs clean html linkcheck

- &deploy
stage: deploy
if: tag =~ v.*$
os: osx
env: CONDA_ENV=3.7
env: CONDA_ENV=3.8
script:
- pip install twine wheel
- python setup.py bdist_wheel
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ clean-test: ## remove test and coverage artifacts
rm -fr .pytest_cache

lint: ## check style with flake8
flake8 terrainbento --exclude=examples
flake8 terrainbento
flake8 tests

pretty: ## reformat files to make them look pretty
Expand Down
9 changes: 7 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ environment:
- TARGET_ARCH: x64
CONDA_NPY: 111
CONDA_INSTALL_LOCN: C:\\Miniconda37-x64
CONDA_PY: 3.7
CONDA_PY: 3.6

- TARGET_ARCH: x64
CONDA_NPY: 111
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
CONDA_PY: 3.6
CONDA_PY: 3.7

- TARGET_ARCH: x64
CONDA_NPY: 111
CONDA_INSTALL_LOCN: C:\\Miniconda37-x64
CONDA_PY: 3.8

platform:
- x64
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -W
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def test():
"landlab.io",
"landlab.io.netcdf",
"landlab.components",
"landlab.components.depression_finder.lake_mapper",
"landlab.graph",
"Graph",
"Component",
"FlowAccumulator",
"PrecipitationDistribution",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/terrainbento.boundary_handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Domain Boundary Elevation Modifiers
Valid Landlab Components
------------------------

- `NormalFault <https://landlab.readthedocs.io/en/latest/landlab.components.normal_fault.html>`_.
- `NormalFault <https://landlab.readthedocs.io/en/master/reference/components/normal_fault.html>`_.
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name: terrainbento-dev
- numpy
- xarray
- dask
- landlab>=1.9, <2.0
- landlab>=2.0.0b4
- jupyter
- holoviews
- pandas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
" # Create the Grid\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [\n",
" (50, 80),\n",
" (25, 40),\n",
" {\n",
" \"xy_spacing\": 20\n",
" \"xy_spacing\": 40\n",
" },\n",
" {\n",
" \"fields\": {\n",
Expand Down Expand Up @@ -279,7 +279,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"# in this example we will create a grid, a clock, a boundary handler,\n",
"# and an output writer. We will then use these to construct the model.\n",
"\n",
"grid = RasterModelGrid((50, 80), xy_spacing=20) \n",
"grid = RasterModelGrid((25, 40), xy_spacing=40) \n",
"\n",
"z = random(grid, \"topographic__elevation\", where=\"CORE_NODE\")\n",
"\n",
Expand Down Expand Up @@ -279,7 +279,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"\n",
" # Create the Grid.\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [(50, 80), {\n",
" \"xy_spacing\": 20\n",
" \"RasterModelGrid\": [(25, 40), {\n",
" \"xy_spacing\": 40\n",
" }, {\n",
" \"fields\": {\n",
" \"node\": {\n",
Expand Down Expand Up @@ -295,7 +295,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
" # Create the Grid\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [\n",
" (50, 80),\n",
" (25, 40),\n",
" {\n",
" \"xy_spacing\": 20\n",
" \"xy_spacing\": 40\n",
" },\n",
" {\n",
" \"fields\": {\n",
Expand Down Expand Up @@ -293,7 +293,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
" # Create the Grid\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [\n",
" (50, 80),\n",
" (25, 40),\n",
" {\n",
" \"xy_spacing\": 20\n",
" \"xy_spacing\": 40\n",
" },\n",
" {\n",
" \"fields\": {\n",
Expand Down Expand Up @@ -115,7 +115,7 @@
"outputs": [],
"source": [
"# the tolerance here is high, so that this can run on binder and for tests. (recommended value = 0.001 or lower).\n",
"tolerance = 20.0"
"tolerance = 5.0"
]
},
{
Expand Down Expand Up @@ -275,7 +275,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions notebooks/coupled_process_elements/readme_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
" # Create the Grid\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [\n",
" (50, 80), # the real readme uses (200, 320), here we use a smaller grid so testing works quickly\n",
" (25, 40), # the real readme uses (200, 320), here we use a smaller grid so testing works quickly\n",
" {\n",
" \"xy_spacing\": 10\n",
" },\n",
Expand Down Expand Up @@ -142,7 +142,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions notebooks/example_usage/Introduction_to_terrainbento.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
" # Create the Grid\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [\n",
" (50, 80),\n",
" (25, 40),\n",
" {\n",
" \"xy_spacing\": 20\n",
" \"xy_spacing\": 40\n",
" },\n",
" {\n",
" \"fields\": {\n",
Expand Down Expand Up @@ -274,8 +274,8 @@
"\n",
" # Create the Grid.\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [(50, 80), {\n",
" \"xy_spacing\": 20\n",
" \"RasterModelGrid\": [(25, 40), {\n",
" \"xy_spacing\": 40\n",
" }, {\n",
" \"fields\": {\n",
" \"node\": {\n",
Expand Down Expand Up @@ -428,7 +428,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
"\n",
" # Create the Grid.\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [(50, 80), {\n",
" \"xy_spacing\": 20\n",
" \"RasterModelGrid\": [(25, 40), {\n",
" \"xy_spacing\": 40\n",
" }, {\n",
" \"fields\": {\n",
" \"node\": {\n",
Expand Down Expand Up @@ -233,8 +233,8 @@
"\n",
" # Create the Grid.\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [(50, 80), {\n",
" \"xy_spacing\": 20\n",
" \"RasterModelGrid\": [(25, 40), {\n",
" \"xy_spacing\": 40\n",
" }, {\n",
" \"fields\": {\n",
" \"node\": {\n",
Expand Down Expand Up @@ -367,7 +367,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions notebooks/example_usage/introduction_to_output_writers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
" area_exponent=0.5,\n",
" slope_exponent=0.6,\n",
" channelization_threshold=0.35)\n",
" mean_drainage_density = dd.calc_drainage_density()\n",
" mean_drainage_density = dd.calculate_drainage_density()\n",
" if np.isinf(mean_drainage_density):\n",
" mean_drainage_density = 0.0\n",
" fname = 'drainage_density.txt'\n",
Expand Down Expand Up @@ -150,9 +150,9 @@
" # Create the Grid\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [\n",
" (50, 80),\n",
" (25, 40),\n",
" {\n",
" \"xy_spacing\": 20\n",
" \"xy_spacing\": 40\n",
" },\n",
" {\n",
" \"fields\": {\n",
Expand Down Expand Up @@ -405,9 +405,9 @@
" # Create the Grid\n",
" \"grid\": {\n",
" \"RasterModelGrid\": [\n",
" (50, 80),\n",
" (25, 40),\n",
" {\n",
" \"xy_spacing\": 20\n",
" \"xy_spacing\": 40\n",
" },\n",
" {\n",
" \"fields\": {\n",
Expand Down Expand Up @@ -548,7 +548,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.1"
}
},
"nbformat": 4,
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ filterwarnings =
testpaths = terrainbento tests
norecursedirs = .* *.egg* build dist examples
addopts =
--disable-pytest-warnings
--ignore setup.py
--ignore versioneer.py
--ignore terrainbento/_version.py
Expand All @@ -24,6 +25,7 @@ addopts =
--doctest-modules
--cov=terrainbento
--cov-report term-missing
--durations=0

doctest_optionflags =
NORMALIZE_WHITESPACE
Expand Down Expand Up @@ -53,7 +55,6 @@ line_length=88
exclude = docs
ignore =
E203 # some white space in version
F401 # unused imports
E501 # some lines too long
W503 # line break before binary operator
W605 # invalid escape sequences (latex math)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"pandas",
"xarray",
"dask[complete]",
"landlab>=1.9, <2.0",
"landlab>=2.0.0b4",
],
package_data={"": ["tests/*txt", "data/*txt", "data/*asc", "data/*nc"]},
)

0 comments on commit ba0e353

Please sign in to comment.