diff --git a/infrastructure/booksite/LICENSE b/infrastructure/booksite/LICENSE new file mode 100644 index 00000000..0b93819e --- /dev/null +++ b/infrastructure/booksite/LICENSE @@ -0,0 +1,8 @@ +Geographic Data Science with PySAL and the PyData Stack +======================================================= + +This project is released under a Creative Commons BY-NC-ND license. + +For more information, please visit: + +https://creativecommons.org/licenses/by-nc-nd/4.0/ diff --git a/infrastructure/booksite/build.sh b/infrastructure/booksite/build.sh index 240b9656..95662546 100644 --- a/infrastructure/booksite/build.sh +++ b/infrastructure/booksite/build.sh @@ -21,6 +21,7 @@ cp host/infrastructure/booksite/toc.yml host/tmp_book/_data/toc.yml # Fill in #--------------------------- # LICENSE +cp host/infrastructure/booksite/LICENSE host/tmp_book/LICENSE # Code requirements # Bibliography # Build book @@ -28,7 +29,7 @@ cp host/infrastructure/booksite/toc.yml host/tmp_book/_data/toc.yml echo "Building book..." jupyter-book build host/tmp_book echo "Building site HTML..." -cd host/tmp_book && make site +cd host/tmp_book && make build # Move over to docs folder to be served online echo "Moving build over to docs folder..." cd /home/jovyan diff --git a/infrastructure/booksite/intro.md b/infrastructure/booksite/intro.md index 16dd3ecb..16a1ffa9 100644 --- a/infrastructure/booksite/intro.md +++ b/infrastructure/booksite/intro.md @@ -6,6 +6,6 @@ Placeholder for the introduction to the book -## LICENSE +--- -**IMPORTANT**: this work is under a license! +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/infrastructure/docker/Dockerfile b/infrastructure/docker/Dockerfile index c528ab43..ce2f4c37 100644 --- a/infrastructure/docker/Dockerfile +++ b/infrastructure/docker/Dockerfile @@ -2,25 +2,6 @@ FROM darribas/gds_py:2.0 LABEL maintainer="Dani Arribas-Bel " -#--- Jekyll ---# - -USER root - -RUN apt-get update \ - && apt-get install -y ruby-full build-essential zlib1g-dev - -# Install Ruby Gems to ~/gems -ENV GEM_HOME="/home/$NB_USER/gems" -ENV PATH="/home/$NB_USER/gems/bin:$PATH" - -USER $NB_UID - -RUN gem install jekyll bundler jekyll-scholar - -# Clean up -RUN rm -rf $GEM_HOME/cache -RUN rm -rf /usr/local/bundle/cache - #--- Jupyter-book ---# RUN pip install -U --no-deps \ bs4 \ @@ -30,8 +11,21 @@ RUN pip install -U --no-deps \ pytest \ ruamel.yaml RUN jupyter-book create testbook --demo + +#--- Jekyll ---# +# Taken inspiration from: +# https://github.com/jupyter/jupyter-book/blob/master/jupyter_book/Dockerfile + +USER root +RUN apt-get update \ + && apt-get install -y ruby-full build-essential zlib1g-dev libc-dev +USER $NB_UID +# Install Ruby Gems to ~/gems +ENV GEM_HOME="/home/$NB_USER/gems" +ENV PATH="/home/$NB_USER/gems/bin:$PATH" RUN cd /home/$NB_USER/testbook \ - && gem install bundler -v 1.17.2 \ +#&& mv Gemfile.lock original_Gemfile.lock \ + && gem install bundler -v '2.0.1' \ && bundle install # JupyText @@ -50,7 +44,7 @@ RUN echo "c.NotebookApp.contents_manager_class = "\ RUN rm -rf $GEM_HOME/cache \ && rm -rf /usr/local/bundle/cache \ && rm -r /home/$NB_USER/testbook \ - && conda clean -tipsy + && conda clean --all EXPOSE 4000 diff --git a/notebooks/00_toc.ipynb b/notebooks/00_toc.ipynb index 9d14f6fe..d1d6c583 100644 --- a/notebooks/00_toc.ipynb +++ b/notebooks/00_toc.ipynb @@ -28,7 +28,9 @@ "- [Spatial Inequality](09_spatial_inequality)\n", "- [Clustering and Regionalization](10_clustering_and_regionalization)\n", "- [Spatial Regression](11_regression)\n", - "- [Spatial Feature Engineering](12_feature_engineering)\n" + "- [Spatial Feature Engineering](12_feature_engineering)\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." ] } ], diff --git a/notebooks/00_toc.md b/notebooks/00_toc.md index 1a9ae259..2419f2e4 100644 --- a/notebooks/00_toc.md +++ b/notebooks/00_toc.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -37,4 +37,5 @@ jupyter: - [Spatial Regression](11_regression) - [Spatial Feature Engineering](12_feature_engineering) +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/01_geospatial_computational_environment.ipynb b/notebooks/01_geospatial_computational_environment.ipynb index efa5f0e8..7e4cf206 100644 --- a/notebooks/01_geospatial_computational_environment.ipynb +++ b/notebooks/01_geospatial_computational_environment.ipynb @@ -2610,25 +2610,11 @@ ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], - "source": [] + "source": [ + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/01_geospatial_computational_environment.md b/notebooks/01_geospatial_computational_environment.md index cf093bce..02244590 100644 --- a/notebooks/01_geospatial_computational_environment.md +++ b/notebooks/01_geospatial_computational_environment.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -994,14 +994,5 @@ Write a properly documented function that: 3. If the number is odd, it should be stored in the dictionary as a key, with a value of "odd." 4. Returns the now-filled dictionary. -```python -``` - -```python - -``` - -```python - -``` +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/02_spatial_data.ipynb b/notebooks/02_spatial_data.ipynb index 7cfa98f4..9203529b 100644 --- a/notebooks/02_spatial_data.ipynb +++ b/notebooks/02_spatial_data.ipynb @@ -6,6 +6,15 @@ "source": [ "# Spatial Data" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/02_spatial_data.md b/notebooks/02_spatial_data.md index 374a5e71..b5aece3d 100644 --- a/notebooks/02_spatial_data.md +++ b/notebooks/02_spatial_data.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -14,3 +14,8 @@ jupyter: --- # Spatial Data + + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/03_spatial_data_processing.ipynb b/notebooks/03_spatial_data_processing.ipynb index a698bfb4..1d82c93b 100644 --- a/notebooks/03_spatial_data_processing.ipynb +++ b/notebooks/03_spatial_data_processing.ipynb @@ -4738,6 +4738,15 @@ "\n", "message is, if you have the column in the table use it, but many cases you do not have the column and need to go the spatial join route" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/03_spatial_data_processing.md b/notebooks/03_spatial_data_processing.md index 7debc464..f67a3eb2 100644 --- a/notebooks/03_spatial_data_processing.md +++ b/notebooks/03_spatial_data_processing.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -138,3 +138,7 @@ df.columns message is, if you have the column in the table use it, but many cases you do not have the column and need to go the spatial join route + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/04_spatial_weights.ipynb b/notebooks/04_spatial_weights.ipynb index 8af9cb53..abad2e4f 100644 --- a/notebooks/04_spatial_weights.ipynb +++ b/notebooks/04_spatial_weights.ipynb @@ -3342,6 +3342,15 @@ "\n", "[4] Dean, N., Dong, G., and Price, G. \"Frontiers in Residential Segregation: Understanding Neighbourhood Boundaries and their Impacts.\" *Tijdschrift voor economische en sociale geografie*, in press" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/04_spatial_weights.md b/notebooks/04_spatial_weights.md index c51dc4f8..c3726346 100644 --- a/notebooks/04_spatial_weights.md +++ b/notebooks/04_spatial_weights.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -1108,3 +1108,8 @@ These are the starkest contrasts in the map, and result in the most distinctive [3] Fitzpatrick, M C.,Preisser, E.L., Porter, A., Elkinton, J., Waller, L.A., Carlin, B. P., and Ellison, A.M. 2010. “Ecological Boundary Detection Using Bayesian Areal Wombling.” *Ecology* 91 (12): 3448–3455. [4] Dean, N., Dong, G., and Price, G. "Frontiers in Residential Segregation: Understanding Neighbourhood Boundaries and their Impacts." *Tijdschrift voor economische en sociale geografie*, in press + + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/05_choropleth.ipynb b/notebooks/05_choropleth.ipynb index 638a54d3..7a43182c 100644 --- a/notebooks/05_choropleth.ipynb +++ b/notebooks/05_choropleth.ipynb @@ -2413,6 +2413,15 @@ "\"Interregional inequality dynamics in Mexico.\" *Spatial Economic Analysis*, 5:\n", "277-298." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/05_choropleth.md b/notebooks/05_choropleth.md index 082625b4..23427060 100644 --- a/notebooks/05_choropleth.md +++ b/notebooks/05_choropleth.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -651,3 +651,8 @@ structure and dynamics." *Cities*, 43: 69-77. Rey, S.J. and M.L. Guitierez. (2010) "Interregional inequality dynamics in Mexico." *Spatial Economic Analysis*, 5: 277-298. + + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/06_spatial_autocorrelation.ipynb b/notebooks/06_spatial_autocorrelation.ipynb index a66653b5..dd573931 100644 --- a/notebooks/06_spatial_autocorrelation.ipynb +++ b/notebooks/06_spatial_autocorrelation.ipynb @@ -1432,11 +1432,13 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], - "source": [] + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/06_spatial_autocorrelation.md b/notebooks/06_spatial_autocorrelation.md index 45c24704..168ed683 100644 --- a/notebooks/06_spatial_autocorrelation.md +++ b/notebooks/06_spatial_autocorrelation.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -459,6 +459,7 @@ Moran, P. A. (1950). Notes on continuous stochastic phenomena. Biometrika, 37(1/ Tukey, J. W. (1977). Exploratory data analysis (Vol. 2). -```python -``` +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/07_local_autocorrelation.ipynb b/notebooks/07_local_autocorrelation.ipynb index d29aba1d..3cf283ff 100644 --- a/notebooks/07_local_autocorrelation.ipynb +++ b/notebooks/07_local_autocorrelation.ipynb @@ -1103,6 +1103,15 @@ "source": [ "As you can see, the results are virtually the same for $G_i$ and $G_i^*$. Also, at first glance, these maps appear to be visually similar to the final LISA map from above, and this leads to the question of why use the $G$ statistics at all. The answer to this question is that the two sets of local statistics, Local $I$ and the local $G$, are complementary statistics. This is because the local $I$ by itself cannot distinguish between the two forms of positive spatial association while the G can. At the same time, the G statistic does not consider negative spatial association, while the local I statistic does." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/07_local_autocorrelation.md b/notebooks/07_local_autocorrelation.md index ed566f57..04d7ffc1 100644 --- a/notebooks/07_local_autocorrelation.md +++ b/notebooks/07_local_autocorrelation.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -423,3 +423,8 @@ plt.show() ``` As you can see, the results are virtually the same for $G_i$ and $G_i^*$. Also, at first glance, these maps appear to be visually similar to the final LISA map from above, and this leads to the question of why use the $G$ statistics at all. The answer to this question is that the two sets of local statistics, Local $I$ and the local $G$, are complementary statistics. This is because the local $I$ by itself cannot distinguish between the two forms of positive spatial association while the G can. At the same time, the G statistic does not consider negative spatial association, while the local I statistic does. + + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/08_point_pattern_analysis.ipynb b/notebooks/08_point_pattern_analysis.ipynb index 4f56f6d6..7c17eeb2 100644 --- a/notebooks/08_point_pattern_analysis.ipynb +++ b/notebooks/08_point_pattern_analysis.ipynb @@ -1817,6 +1817,15 @@ "# Display the figure\n", "plt.show()" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/08_point_pattern_analysis.md b/notebooks/08_point_pattern_analysis.md index 8b753e44..4c13fba7 100644 --- a/notebooks/08_point_pattern_analysis.md +++ b/notebooks/08_point_pattern_analysis.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -528,3 +528,7 @@ ax.set_axis_off() # Display the figure plt.show() ``` + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/09_spatial_inequality.ipynb b/notebooks/09_spatial_inequality.ipynb index 08f090a1..476fe2a7 100644 --- a/notebooks/09_spatial_inequality.ipynb +++ b/notebooks/09_spatial_inequality.ipynb @@ -39,13 +39,13 @@ ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/09_spatial_inequality.md b/notebooks/09_spatial_inequality.md index ef56fddd..5c175db8 100644 --- a/notebooks/09_spatial_inequality.md +++ b/notebooks/09_spatial_inequality.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -38,6 +38,7 @@ jupyter: - need a resolution for the raster lower than tract http://due.esrin.esa.int/page_globcover.php -```python -``` +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/10_clustering_and_regionalization.ipynb b/notebooks/10_clustering_and_regionalization.ipynb index b1e727af..509c279e 100644 --- a/notebooks/10_clustering_and_regionalization.ipynb +++ b/notebooks/10_clustering_and_regionalization.ipynb @@ -2181,6 +2181,15 @@ "determines the spatial structure and data profile of discovered clusters or regions.\n", "Thus, clustering and regionalization are essential tools for the spatial data scientist." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/10_clustering_and_regionalization.md b/notebooks/10_clustering_and_regionalization.md index b11f9824..63c5849d 100644 --- a/notebooks/10_clustering_and_regionalization.md +++ b/notebooks/10_clustering_and_regionalization.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -876,3 +876,8 @@ Clustering and regionalization are intimately related to the analysis of spatial since the spatial structure and covariation in multivariate spatial data is what determines the spatial structure and data profile of discovered clusters or regions. Thus, clustering and regionalization are essential tools for the spatial data scientist. + + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/11_regression.ipynb b/notebooks/11_regression.ipynb index 897485e0..b5e588e1 100644 --- a/notebooks/11_regression.ipynb +++ b/notebooks/11_regression.ipynb @@ -1741,6 +1741,15 @@ "\n", "[8] Cressie, N., and Christopher K. W. *Statistics for spatio-temporal data.* (John Wiley & Sons, 2015)." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/11_regression.md b/notebooks/11_regression.md index 7a3394d7..be99ac7d 100644 --- a/notebooks/11_regression.md +++ b/notebooks/11_regression.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -641,3 +641,8 @@ This means that our over- and under-predictions are likely to cluster. [7] Banerjee, S., A. E. Gelfand, A. O. Finley, and H. Sang. "Gaussian predictive process models for large spatial data sets." Journal of the Royal Statistical Society: Series B (Statistical Methodology) 70, no. 4 (2008): 825-848. [8] Cressie, N., and Christopher K. W. *Statistics for spatio-temporal data.* (John Wiley & Sons, 2015). + + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. diff --git a/notebooks/12_feature_engineering.ipynb b/notebooks/12_feature_engineering.ipynb index 162fe91c..1f229f13 100644 --- a/notebooks/12_feature_engineering.ipynb +++ b/notebooks/12_feature_engineering.ipynb @@ -6,6 +6,15 @@ "source": [ "# Spatial feature engineering" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License." + ] } ], "metadata": { diff --git a/notebooks/12_feature_engineering.md b/notebooks/12_feature_engineering.md index cb0c27f1..0324ac42 100644 --- a/notebooks/12_feature_engineering.md +++ b/notebooks/12_feature_engineering.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.1.1 + jupytext_version: 1.1.6 kernelspec: display_name: Python 3 language: python @@ -14,3 +14,8 @@ jupyter: --- # Spatial feature engineering + + +--- + +Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.