diff --git a/.travis.yml b/.travis.yml index 73c625a..7c3093f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,17 +4,41 @@ language: python os: - linux +env: + matrix: + - ENV_NAME="test-environment" + PYTHON_VERSION=3.7 + PACKAGES="ipython>=7.0.0 numpy scipy matplotlib pandas jupyter cython proj4=5.2.0" + branches: only: - master jobs: include: - - python: 3.7 - dist: xenial + - dist: xenial # Install dependencies install: + # Install miniconda + # ----------------- + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + - bash miniconda.sh -b -p $HOME/miniconda + - export PATH="$HOME/miniconda/bin:$PATH" + + + # Create the basic testing environment + # ------------------------------------ + - conda config --set always_yes yes + - conda config --add channels conda-forge + + # Customise the testing environment + # --------------------------------- + - conda create -n $ENV_NAME python=$PYTHON_VERSION $PACKAGES + - source activate $ENV_NAME + + # Install packages + # ---------------- - pip install -r requirements.travis.txt - pip install --upgrade pip - pip install codecov @@ -25,6 +49,6 @@ install: # command to run tests script: - py.test ./autotest/test_01_basic.py -n 3 - + - py.test ./autotest/test_02_on_topic.py -n 3 after_success: - python-codacy-coverage -r coverage.xml \ No newline at end of file diff --git a/Exercise_notebooks/Basic/basic1_use_jupyter/sources/Notebook Basics.ipynb b/Exercise_notebooks/Basic/basic1_use_jupyter/sources/Notebook Basics.ipynb index 45638eb..95ef0cc 100644 --- a/Exercise_notebooks/Basic/basic1_use_jupyter/sources/Notebook Basics.ipynb +++ b/Exercise_notebooks/Basic/basic1_use_jupyter/sources/Notebook Basics.ipynb @@ -230,11 +230,7 @@ ] } ], - "metadata": { - "language_info": { - "name": "python" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 1 } diff --git a/Exercise_notebooks/On_topic/08_GIS/Geopandas.ipynb b/Exercise_notebooks/On_topic/08_GIS/Geopandas.ipynb index e4fbe4b..6c66530 100644 --- a/Exercise_notebooks/On_topic/08_GIS/Geopandas.ipynb +++ b/Exercise_notebooks/On_topic/08_GIS/Geopandas.ipynb @@ -199,7 +199,7 @@ "metadata": {}, "outputs": [], "source": [ - "df_turbines = pd.read_excel(r'data\\turbines_ohvs.xlsx')\n", + "df_turbines = pd.read_excel(r'data/turbines_ohvs.xlsx')\n", "df_turbines.head()" ] }, @@ -481,7 +481,7 @@ "metadata": {}, "outputs": [], "source": [ - "gdf_nybb = gpd.read_file(r'data\\nybb.shp')\n", + "gdf_nybb = gpd.read_file(r'data/nybb.shp')\n", "gdf_nybb.head()" ] }, @@ -531,7 +531,7 @@ "metadata": {}, "outputs": [], "source": [ - "df_verkeer = pd.read_csv(r'data\\traffic_intensity_Utrecht.csv')\n", + "df_verkeer = pd.read_csv(r'data/traffic_intensity_Utrecht.csv')\n", "geometry = gpd.points_from_xy(df_verkeer['longitude'], df_verkeer['latitude'])\n", "gdf_verkeer = gpd.GeoDataFrame(df_verkeer.copy(), geometry=geometry)\n", "gdf_verkeer.head()" diff --git a/Exercise_notebooks/On_topic/08_GIS/shapefiles/Rotterdam_centraal_resized.dbf b/Exercise_notebooks/On_topic/08_GIS/shapefiles/Rotterdam_centraal_resized.dbf index 2f4317e..6846d34 100644 Binary files a/Exercise_notebooks/On_topic/08_GIS/shapefiles/Rotterdam_centraal_resized.dbf and b/Exercise_notebooks/On_topic/08_GIS/shapefiles/Rotterdam_centraal_resized.dbf differ diff --git a/Exercise_notebooks/On_topic/08_GIS/shapefiles/Rotterdam_centraal_v2.dbf b/Exercise_notebooks/On_topic/08_GIS/shapefiles/Rotterdam_centraal_v2.dbf index 2f4317e..6846d34 100644 Binary files a/Exercise_notebooks/On_topic/08_GIS/shapefiles/Rotterdam_centraal_v2.dbf and b/Exercise_notebooks/On_topic/08_GIS/shapefiles/Rotterdam_centraal_v2.dbf differ diff --git a/Exercise_notebooks/On_topic/09_Code_Quality/03_Quality_ZEN_of_Python.ipynb b/Exercise_notebooks/On_topic/09_Code_Quality/03_Quality_ZEN_of_Python.ipynb index 1553428..cfd6525 100644 --- a/Exercise_notebooks/On_topic/09_Code_Quality/03_Quality_ZEN_of_Python.ipynb +++ b/Exercise_notebooks/On_topic/09_Code_Quality/03_Quality_ZEN_of_Python.ipynb @@ -1204,7 +1204,16 @@ ], "metadata": { "language_info": { - "name": "python" + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.6" } }, "nbformat": 4, diff --git a/Exercise_notebooks/On_topic/24_pastas/3_stressmodels.ipynb b/Exercise_notebooks/On_topic/24_pastas/3_stressmodels.ipynb index a7adc17..b1f7164 100644 --- a/Exercise_notebooks/On_topic/24_pastas/3_stressmodels.ipynb +++ b/Exercise_notebooks/On_topic/24_pastas/3_stressmodels.ipynb @@ -611,7 +611,7 @@ "outputs": [], "source": [ "ini_param = ml.parameters['initial'].values\n", - "sim_ini_param = ml.simulate(parameters=ini_param)\n", + "sim_ini_param = ml.simulate(p=ini_param)\n", "\n", "#visualise results\n", "sim_ini_param.plot(label='model simulation initial parameters')\n", @@ -654,7 +654,7 @@ "source": [ "# simulate groundwater head with optimized parameters\n", "opt_param = ml.parameters['optimal'].values\n", - "sim_opt_param = ml.simulate(parameters=opt_param)\n", + "sim_opt_param = ml.simulate(p=opt_param)\n", "\n", "# or simply use\n", "sim_opt_param = ml.simulate()\n", @@ -688,8 +688,8 @@ "semi_opt_param[3] = 1.0\n", "\n", "\n", - "sim_opt_param = ml.simulate(parameters=opt_param)\n", - "sim_semi_opt = ml.simulate(parameters=semi_opt_param)\n", + "sim_opt_param = ml.simulate(p=opt_param)\n", + "sim_semi_opt = ml.simulate(p=semi_opt_param)\n", "\n", "#visualise results\n", "sim_opt_param.plot(label='model simulation optimal parameters')\n", diff --git a/Exercise_notebooks/On_topic/24_pastas/4_pastas_project.ipynb b/Exercise_notebooks/On_topic/24_pastas/4_pastas_project.ipynb index 6c583e9..3c41d3a 100644 --- a/Exercise_notebooks/On_topic/24_pastas/4_pastas_project.ipynb +++ b/Exercise_notebooks/On_topic/24_pastas/4_pastas_project.ipynb @@ -55,7 +55,7 @@ "outputs": [], "source": [ "# add the observations in all the files in the data-directory that end with _1.csv\n", - "datapath = r'data\\nb4'\n", + "datapath = r'data/nb4'\n", "files = [x for x in os.listdir(datapath) if x.endswith('_1.csv')]\n", "for file in files:\n", " fname = os.path.join(datapath,file)\n", @@ -71,7 +71,7 @@ "metadata": {}, "source": [ "#### Exercise 1 \n", - "Create a pastas project. Add the observations in the `data\\nb4\\ex1` to the model. Which measurements series has the lowest filter?" + "Create a pastas project. Add the observations in the `data/nb4/ex1` directory to the model. Which measurements series has the lowest filter?" ] }, { @@ -430,7 +430,7 @@ "pr_q = ps.Project(name='exercise1')\n", "\n", "# add the observations in all the files in the data-directory that end with _1.csv\n", - "datapath_ex1 = r'data\\nb4\\ex1'\n", + "datapath_ex1 = r'data/nb4/ex1'\n", "files = [x for x in os.listdir(datapath_ex1) if x.endswith('_1.csv')]\n", "for file in files:\n", " fname = os.path.join(datapath_ex1,file)\n", diff --git a/autotest/test_02_on_topic.py b/autotest/test_02_on_topic.py index 549c42c..7440a96 100644 --- a/autotest/test_02_on_topic.py +++ b/autotest/test_02_on_topic.py @@ -791,22 +791,6 @@ def test_11___Running_Bokeh_Applications(): assert out == 0 return 1 -def test_Folium01_and_mplleaflet(): - fpath_rel = ['20_folium', 'Folium01_and_mplleaflet.ipynb'] - subdir = fpath_rel[:-1] - fname = fpath_rel[-1] - fdir = os.path.join(*nb_dir, *subdir) - cwd = os.getcwd() - os.chdir(fdir) - try: - out = tf.run_notebook(fname, clearoutput=True) - os.chdir(cwd) - except Exception as e: - os.chdir(cwd) - raise(e) - assert out == 0 - return 1 - def test_Folium02_CheckZorder(): fpath_rel = ['20_folium', 'Folium02_CheckZorder.ipynb'] subdir = fpath_rel[:-1] diff --git a/requirements.travis.txt b/requirements.travis.txt index 2075bac..aa32278 100644 --- a/requirements.travis.txt +++ b/requirements.travis.txt @@ -1,8 +1,3 @@ -numpy>=1.15 -scipy>=1.2 -matplotlib>=3.0 -pandas>=0.24 -jupyter>=1.0.0 lxml requests zeep @@ -15,4 +10,14 @@ branca folium bokeh pastas -nbformat +xlrd +sqlalchemy +rasterio +cartopy +descartes +mplleaflet +contextily +geographiclib +networkx +gpxpy +pyshp \ No newline at end of file