Supplement 1. The Python source code to conduct the analyses of Harte et al.’s (2008, 2009) and Harte's (2011) model and compare it to alternative models, including both raw and calculated data. P. WhiteEthan ThibaultKatherine M. XiaoXiao 2016 <h2>File List</h2><blockquote> <p><a href="mete_sads_data.py">mete_sads_data.py</a></p> <p>Python script that extracts data from the primary MySQL databases.</p> <br> <p><a href="mete_sads.py">mete_sads.py</a></p> <p>Core python script for replicating the complete set of analyses in the paper.</p> <br> <p><a href="mete.py">mete.py</a></p> <p>Module containing the core functions for working with Harte et al.'s Maximum Entropy Theory of Ecology.</p> <br> <p><a href="mete_distributions.py">mete_distributions.py</a></p> <p>Module containing some distributions for use in analyses of Harte et al.'s Maximum Entropy Theory of Ecology.</p> <br> <p><a href="macroecotools.py">macroecotools.py</a></p> <p>Module containing tools for conducting macroecological analyses.</p> <br> <p><a href="macroeco_distributions.py">macroeco_distributions.py</a></p> <p>Module containing some common macroecological distributions, including the Poisson log-normal used in this paper.</p> <br> <p><a href="data.zip">data.zip</a></p> <p>Intermediate data files from various phases of the analysis. Includes the raw data from the MySQL exports, and latitude and longitude information for mapping, for 4 of the 6 data sets (BBS, MCDB, FIA, and Gentry). The other two datasets were obtained under agreements restricting the publication of raw data. This file should be extracted in the same directory as the other files.</p> </blockquote><h2>Description</h2><blockquote> <p>The code and data in this supplement allow the analyses in the paper to be fully replicated for four of the six data sets BBS, MCDB, FIA, and Gentry). The other two data sets were obtained under agreements restricting the publication of raw data, but simulation results and figures can still be generated for these data sets.</p> <p>Requirements: Python 2.x and the following Python modules: numpy, scipy, matplotlib, and mpmath. Two additional modules, mpl_toolkits, and mpl_toolkits.basemap, are required for generating the figures.</p> <p>All files should be placed in a single directory and the data.zip file should be extracted into that directory. The analyses can then be replicated by running the following commands from the command line.</p> <p>Run all analyses and generate figures: python mete_sads.py ./data/ all</p> <p>Run portions of the analysis pipeline:<br> Empirical analyses: python mete_sads.py ./data/ empir<br> Simulation analyses: python mete_sads.py ./data/ sims<br> Figures: python mete_sads.py ./data/ figs</p> <p>On Windows ./data/ should be replaced with .\data\ to match the relevant path conventions.</p> <p>Please note that these analyses involve both a large amount of data and a lot of computational work and therefore take a long time to run. Expect the empirical analysis to take up to a day. Simulations may take up to several weeks on an 8-core server. This can be decreased to about a week by downloading the beta_lookup_table.pck file from the repository described below and placing it in the same folder as the other files. Generating figures takes about one hour due to the neighborhood calculations required for the color ramps on the observed-predicted plots.</p> <p>Version Control Repository: The full version control repository for this project (including post-publication improvements) is publicly available at <a href="https://github.com/weecology/white-et-al-2012">https://github.com/weecology/white-et-al-2012</a>. The code in this repository relies on two additional modules: <a href="https://github.com/weecology/METE">https://github.com/weecology/METE</a> and <a href="https://github.com/weecology/macroecotools">https://github.com/weecology/macroecotools</a>. If you would like to use the code in this Supplement for your own analyses it is strongly suggested that you use the equivalent code in the repositories as this is the code that is being actively maintained and developed. If for some reason the repositories are moved, links will always be available at <a href="http://weecology.org/">http://weecology.org</a>.</p> <p>Data Use: Data is provided in this supplement for the purposes of replication and is not presented in such a way as to be generally useful for additional analyses. If you wish to use these data sets for additional research they should be obtained from relevant data providers. For BBS, MCDB, FIA, and Gentry this can be done automatically by using the EcoData Retriever (http://ecologicaldata.org/ecodata-retriever).</p> <p>Software License: All code is licensed using the standard MIT license.</p> <p>Copyright (c) 2011 Weecology</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> </blockquote>