Skip to content
Commits on Source (17)
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
......@@ -16,10 +16,9 @@ var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__
tmp/
# virtual environment
venv/
......
......@@ -4,14 +4,12 @@ branches:
only:
- master
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
env:
- PYSAL_PLUS=false
- PYSAL_PLUS=true
- PYSAL_PLUS=false MPLBACKEND="pdf"
- PYSAL_PLUS=true MPLBACKEND="pdf"
before_install:
- wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
......@@ -22,7 +20,6 @@ before_install:
- conda config --add channels conda-forge
- conda create -y -q -n test-env python=$TRAVIS_PYTHON_VERSION
- source activate test-env
- if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then 2to3 -nw pysal/ > /dev/null; fi
install:
- conda install --yes pip
......@@ -30,12 +27,15 @@ install:
echo 'plus testing'; conda install --yes --file requirements_plus.txt;
else conda install --yes --file requirements.txt;
fi;
- conda install --yes geopandas
- pip install -r requirements_dev.txt
script:
- python setup.py sdist >/dev/null
- echo "check_stable=False" >pysal/config.py
- nosetests --verbose --with-coverage --cover-package=pysal;
- python setup.py install
- travis_wait 45 nosetests --verbose --with-coverage --cover-package=pysal;
#- cd doc; make pickle; make doctest
notifications:
email:
......
if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then
nosetests --with-coverage --cover-package=pysal --exclude-dir=pysal/contrib
else
nosetests --with-coverage --cover-package=pysal;
fi
This diff is collapsed.
# Migrating to PySAL 2.0
<div align='left'>
![https://gitter.im/pysal/pysal](https://badges.gitter.im/pysal/pysal.svg)
</div>
PySAL, the Python spatial analysis library, will be changing its package structure.
......@@ -238,7 +235,7 @@ model2 = spreg.ML_Lag.from_formula('HOVAL ~ CRIME + INC',
import pysal
file_handler = pysal.open(pysal.examples.get_path('columbus.dbf'))
y = np.asarray(file_handler.by_col('HOVAL'))
graph = pysal.open(pysal.examples.get_path('columbus.gal')).read()
graph = pysal.opPySALen(pysal.examples.get_path('columbus.gal')).read()
moran_stat = pysal.Moran(y,graph)
print(moran_stat.I, moran_stat.p_z_sim)
```
......@@ -273,6 +270,6 @@ print(moran_stat.I, moran_stat.p_z_sim)
<font color='red'><bf>This is not recommended.</bf></font>
For a longer change window, feel free to `import pysal._legacy as pysal`. We urge you to not do this, since we plan on deprecating this as well. If you can make the changes described above, you will have a much more stable and future-proof API. We feel these changes are reasonable and will greatly enhance how easy it is for us to maintain `pysal` and move new functionality forward.
You can stay on [1.14.4](https://github.com/pysal/pysal/releases/tag/v1.14.4). However, that is the last Python 2.0 compatible release and it will only be receiving bug fixes. All new enhancements to PySAL will be made in the 2.0+ releases.
### Please contact us on [gitter](https://gitter.com/pysal/pysal) if there are any remaining concerns or questions, and for help or advice.
......@@ -2,6 +2,12 @@
#
.PHONY: clean
download:
python gitreleases.py
convert:
python convert.py
test:
nosetests
......@@ -17,9 +23,15 @@ src:
win:
python setup.py bdist_wininst >/dev/null
prep:
rm -rf pysal/lib
mkdir pysal/lib
clean:
find . -name "*.pyc" -exec rm '{}' ';'
find pysal -name "__pycache__" -exec rm -rf '{}' ';'
rm -rf dist
rm -rf build
rm -rf PySAL.egg-info
rm -rf tmp
Python Spatial Analysis Library
===============================
[![image](https://travis-ci.org/pysal/pysal.svg)](https://travis-ci.org/pysal)
[![image](https://coveralls.io/repos/pysal/pysal/badge.svg?branch=master)](https://coveralls.io/r/pysal/pysal?branch=master)
[![image](https://badges.gitter.im/pysal/pysal.svg)](https://gitter.im/pysal/pysal)
[![image](https://readthedocs.org/projects/pip/badge/?version=latest)](http://pysal.readthedocs.io/en/latest/index.html)
[![LISA Maps of US County Homicide Rates](https://farm2.staticflickr.com/1699/23937788493_1b9d147b9f_z.jpg){width="100.0%"}](http://nbviewer.ipython.org/urls/gist.githubusercontent.com/darribas/657e0568df7a63362762/raw/pysal_lisa_maps.ipynb)
*Above: Local Indicators of Spatial Association for Homicide Rates in US
Counties 1990.*
PySAL, the Python spatial analysis library, is an open source
cross-platform library for geospatial data science with an emphasis on
geospatial vector data written in Python. It supports the development of
high level applications for spatial analysis, such as
> - detection of spatial clusters, hot-spots, and outliers
> - construction of graphs from spatial data
> - spatial regression and statistical modeling on geographically
> embedded networks
> - spatial econometrics
> - exploratory spatio-temporal data analysis
PySAL Components
================
- **explore** - modules to conduct exploratory analysis of spatial and spatio-temporal data, including statistical testing on points, networks, and
polygonal lattices. Also includes methods for spatial inequality and distributional dynamics.
- **viz** - visualize patterns in spatial data to detect clusters,
outliers, and hot-spots.
- **model** - model spatial relationships in data with a variety of
linear, generalized-linear, generalized-additive, and nonlinear
models.
- **lib** - solve a wide variety of computational geometry problems:
- graph construction from polygonal lattices, lines, and points.
- construction and interactive editing of spatial weights matrices
& graphs
- computation of alpha shapes, spatial indices, and
spatial-topological relationships
- reading and writing of sparse graph data, as well as pure python
readers of spatial vector data.
Installation
============
PySAL is available through
[Anaconda](https://www.continuum.io/downloads) (in the defaults or
conda-forge channel) and [Enthought
Canopy](https://www.enthought.com/products/canopy/). We recommend
installing PySAL from conda-forge:
``` {.sourceCode .bash}
conda install pysal
```
PySAL can be installed using pip:
``` {.sourceCode .bash}
pip install pysal
```
As of version 2.0.0 PySAL has shifted to Python 3 only.
Users who need an older stable version of PySAL that is Python 2
compatible can install version 1.14.3 through pip or conda:
``` {.sourceCode .bash}
conda install pysal==1.14.3
```
Documentation
=============
For help on using PySAL, check out the following resources:
- [User
Guide](http://pysal.readthedocs.org/en/latest/users/index.html)
- [Tutorials and Short
Courses](https://github.com/pysal/notebooks/blob/master/courses.md)
Development
===========
As of version 2.0.0, PySAL is now a collection of affiliated geographic
data science packages. Changes to the code for any of the subpackages
should be directed at the respective upstream repositories, and not made
here. Infrastructural changes for the meta-package, like those for
tooling, building the package, and code standards, will be considered.
Development is hosted on [github](https://github.com/pysal/pysal).
Discussions of development as well as help for users occurs on the
[developer list](http://groups.google.com/group/pysal-dev) as well as
[gitter](https://gitter.im/pysal/pysal?).
Getting Involved
================
If you are interested in contributing to PySAL please see our
development guidelines \<https://github.com/pysal/pysal/wiki/GitHub-Standard-Operating-Procedures\>
Bug reports
===========
To search for or report bugs, please see PySAL\'s
[issues](http://github.com/pysal/pysal/issues).
License information
===================
See the file \"LICENSE.txt\" for information on the history of this
software, terms & conditions for usage, and a DISCLAIMER OF ALL
WARRANTIES.
......@@ -13,48 +13,62 @@ Python Spatial Analysis Library
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest
:target: http://pysal.readthedocs.io/en/latest/index.html
PySAL_ is an open source cross-platform library of spatial analysis functions
written in Python. It is intended to support the development of high level
applications for spatial analysis.
.. image:: https://farm2.staticflickr.com/1699/23937788493_1b9d147b9f_z.jpg
:width: 25%
:scale: 25%
:width: 100%
:target: http://nbviewer.ipython.org/urls/gist.githubusercontent.com/darribas/657e0568df7a63362762/raw/pysal_lisa_maps.ipynb
:alt: LISA Maps of US County Homicide Rates
*Above: Local Indicators of Spatial Association for Homicide Rates in US
Counties 1990.*
PySAL, the Python spatial analysis library, is an open source cross-platform
library for geospatial data science with an
emphasis on geospatial vector data written in Python. It supports the
development of high level applications for spatial analysis, such as
PySAL modules
=============
- detection of spatial clusters, hot-spots, and outliers
- construction of graphs from spatial data
- spatial regression and statistical modeling on geographically embedded networks
- spatial econometrics
- exploratory spatio-temporal data analysis
PySAL Components
================
* pysal.cg Computational geometry
* pysal.contrib Contributed modules
* pysal.core Core data structures and IO
* pysal.esda Exploratory spatial data analysis
* pysal.examples Data sets
* pysal.inequality Spatial inequality analysis
* pysal.network Spatial analysis on networks
* pysal.region Spatially constrained clustering
* pysal.spatial_dynamics Spatial dynamics
* pysal.spreg Spatial econometrics and diagnostics
* pysal.weights Spatial weights
* **explore** - modules to conduct exploratory analysis of spatial data, including statistical testing on points, networks, and polygonal lattices.
* **viz** - visualize patterns in spatial data to detect clusters, outliers, and hot-spots.
* **model** - model spatial relationships in data with a variety of linear, generalized-linear, generalized-additive, and nonlinear models.
* **dynamics** - characterize distributional change, both internally and externally, for spatial and nonspatial distributions.
* **lib** - solve a wide variety of computational geometry problems:
- graph construction from polygonal lattices, lines, and points.
- construction and interactive editing of spatial weights matrices & graphs
- computation of alpha shapes, spatial indices, and spatial-topological relationships
- reading and writing of sparse graph data, as well as pure python readers of spatial vector data.
Installation
============
PySAL is available through
`Anaconda <https://www.continuum.io/downloads>`__ (in the `defaults` or `conda-forge` channel) and `Enthought Canopy <https://www.enthought.com/products/canopy/>`__. We recommend installing PySAL from conda-forge:
.. code-block:: bash
conda install pysal
PySAL can be installed using pip:
.. code-block:: bash
$ pip install pysal
pip install pysal
PySAL is also available through
`Anaconda <https://www.continuum.io/downloads>`__ and `Enthought Canopy <https://www.enthought.com/products/canopy/>`__.
As of version 2.0.0 PySAL has shifted to Python 3 only.
Users who need an older stable version of PySAL that is Python 2 compatible can install version 1.14.3 through `pip` or `conda`:
.. code-block:: bash
conda install pysal==1.14.3
Documentation
=============
......@@ -63,19 +77,20 @@ For help on using PySAL, check out the following resources:
* `User Guide <http://pysal.readthedocs.org/en/latest/users/index.html>`_
* `Tutorials and Short Courses <https://github.com/pysal/notebooks/blob/master/courses.md>`_
* `Notebooks <https://github.com/pysal/notebooks>`_
* `User List <http://groups.google.com/group/openspace-list>`_
Development
===========
PySAL development is hosted on github_.
As of version 2.0.0, PySAL is now a collection of affiliated geographic data science packages.
Changes to the code for any of the subpackages should be directed at the respective upstream repository, and not made here.
Infrastructural changes for the meta-package, like those for tooling, building the package, and code standards, will be considered.
Development is hosted on github_.
.. _github : https://github.com/pysal/pysal
Discussions of development occurs on the
Discussions of development as well as help for users occurs on the
`developer list <http://groups.google.com/group/pysal-dev>`_
as well as gitter_.
......@@ -85,7 +100,7 @@ Getting Involved
================
If you are interested in contributing to PySAL please see our
`development guidelines <http://pysal.readthedocs.org/en/latest/developers/index.html>`_.
`development guidelines <https://github.com/pysal/pysal/wiki/GitHub-Standard-Operating-Procedures>`
Bug reports
......
# Building pysal source release
As of version 2.0.0 PySAL has become a meta-package that combines a family of spatial analysis packages into a single source distribution.
This document provides instructions on the preparation of the meta-package
## Building
0. Edit [subtags](subtags) to pin release versions for federated packages
1. `make download`
2. edit convert.py and change `init_lines` at the bottom to have new version number
2. `make convert`
3. `make test`
4. create changelong
5. make src
6. test source release
## Files
Makefile - build scripts
subtags - lists the release tags for each package that are part of the meta-package release
package.yml - hierarchy of pysal meta-package structure. Note that only the packages listed in `subtags` are released.
## Change Log and Release Notes
After building, detailed tables and reports for the changelog can be generated by running the two notebooks:
- `gitcount.ipynb`
- `gitcount_tables.ipynb`
The second script will create a file [changes.md](changes.md) that has the details on the release. Add a table of contents at the top of the file, which can be done [online](https://ecotrust-canada.github.io/markdown-toc/) or with a [package for emacs](https://github.com/ardumont/markdown-toc/blob/master/README.md).
The final file should be posted under a new [release on GitHub](https://github.com/pysal/pysal/releases).
import yaml
import os
import subprocess
import sys
TARGETROOT ="pysal/"
with open('packages.yml') as package_file:
packages = yaml.load(package_file)
os.system('mkdir tmp')
for package in packages:
#print(package)
subpackages = packages[package].split()
for subpackage in subpackages:
"""
#print(package, subpackage)
#print(upstream)
# get the zip of the current master branch (or release?) for the subpackage
pipcom = 'pip download '+subpackage+' --no-binary :all: --no-deps -d tmp'
tarcom = 'tar xzf tmp/'+subpackage+"*.tar.gz -C tmp; rm tmp/*.gz"
zipcom = 'unzip tmp/'+subpackage+"*.zip -d tmp"
cpcom = 'cp -fr tmp/'+subpackage+"*/"+subpackage+" "+"pysal/"+package+"/"
#print(pipcom)
os.system(pipcom)
#print(tarcom)
tar_res = os.system(tarcom)
if tar_res != 0:
zip_res = os.system(zipcom)
if zip_res != 0:
print('Neither a zip or tarball is available for %s'% subpackage)
#print(mvcom)
os.system(cpcom)
# pip download subpackage -d tmp --no-deps
# tar xzf tmp/subpackage*.gz -C tmp
# mv tmp/subpackage*/subpackage subparent/
"""
pkgstr = "https://github.com/pysal/%s/archive/master.zip" % subpackage
downloadcommand = "wget %s; mv master.zip tmp/." % pkgstr
#downloadcommand = "wget https://github.com/pysal/splot/archive/master.zip; mv master.zip tmp/."
os.system(downloadcommand)
os.system('unzip tmp/master.zip -d tmp')
os.system('rm tmp/master.zip')
cpcom = 'cp -fr tmp/'+subpackage+"*/"+subpackage+" "+"pysal/"+package+"/"
os.system(cpcom)
print("%s via wget from github" % subpackage)
#os.system('git clean -fd')
# libpysal
os.system('pip download libpysal --no-binary :all: --no-deps -d tmp')
os.system('tar xzf tmp/libpysal*.tar.gz -C tmp; rm tmp/*.gz')
os.system('cp -fr tmp/libpysal*/libpysal/* pysal/lib/.')
# handle libpysal if python=3.+
if sys.version_info[0] == 3:
twothreecom = '2to3 -nw pysal/lib/'
print(twothreecom)
os.system(twothreecom)
"""
# replace all references to libpysal with pysal.lib
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/libpysal/pysal\.lib/g'"
os.system(c)
# replace all references to esda with pysal.explore.esda
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/esda/pysal\.explore\.esda/g'"
os.system(c)
# replace all references to mapclassify with pysal.viz.mapclassify
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/mapclassify/pysal\.viz\.mapclassify/g'"
os.system(c)
# replace all references to .legendgram with pysal.viz.legendgram
#c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/\.legendgram/pysal\.viz\.legendgram/g'"
#os.system(c)
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/\.vizpysal\./\./g'"
os.system(c)
# replace all references to pysal.spreg with pysal.model.spreg
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/pysal\.spreg/pysal\.model\.spreg/g'"
os.system(c)
# replace all references to spglm with pysal.model.spglm
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/spglm/pysal\.model\.spglm/g'"
os.system(c)
# replace all references to .spint with pysal.model.spint
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/spint\./pysal\.model\.spint\./g'"
os.system(c)
# fix libpysal.api now that it has just been clobbered
c = "find pysal/. -name 'api.py' -print | xargs sed -i -- 's/weights\.pysal\.model\.spint/weights\.spintW/g'"
os.system(c)
# replace all references to gwr with pysal.model.gwr
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/ gwr / pysal\.model\.gwr/g'"
os.system(c)
# replace all references to spvcm with pysal.model.spvcm
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/ spvcm / pysal\.model\.spvcm /g'"
os.system(c)
# replace all references to spvcm with pysal.model.spvcm
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/ spvcm\./ pysal\.model\.spvcm\./g'"
os.system(c)
# replace all references in spglm to spreg with pysal.model.spreg
c = "find pysal/model/spglm/. -name '*.py' -print | xargs sed -i -- 's/ spreg\./ pysal\.model\.spreg\./g'"
os.system(c)
# replace all references in spint to spreg with pysal.model.spreg
c = "find pysal/model/spint/. -name '*.py' -print | xargs sed -i -- 's/ spreg\./ pysal\.model\.spreg\./g'"
os.system(c)
# replace all references in spint to spreg with pysal.model.spreg
c = "find pysal/model/spint/. -name '*.py' -print | xargs sed -i -- 's/from spreg import/from pysal\.model\.spreg import/g'"
os.system(c)
"""
# rewrite pysal/__init__.py at the end
init_lines = [
". import lib",
". explore import esda",
". explore import pointpats",
". viz import mapclassify",
". viz import legendgram",
". dynamics import giddy",
". model import spreg",
". model import spglm",
". model import spint",
". model import spvcm",
". model import gwr"]
init_lines = [ "from "+line for line in init_lines]
lines = "\n".join(init_lines)
with open("pysal/__init__.py", 'w') as outfile:
outfile.write(lines)
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>package</th>
<th>commits</th>
<th>total issues</th>
<th>pulls</th>
</tr>
</thead>
<tbody>
<tr>
<td>spaghetti</td>
<td>282</td>
<td>94</td>
<td>34</td>
</tr>
<tr>
<td>libpysal</td>
<td>276</td>
<td>79</td>
<td>57</td>
</tr>
<tr>
<td>splot</td>
<td>247</td>
<td>27</td>
<td>21</td>
</tr>
<tr>
<td>mgwr</td>
<td>229</td>
<td>30</td>
<td>16</td>
</tr>
<tr>
<td>giddy</td>
<td>137</td>
<td>38</td>
<td>31</td>
</tr>
<tr>
<td>esda</td>
<td>80</td>
<td>29</td>
<td>19</td>
</tr>
<tr>
<td>spglm</td>
<td>70</td>
<td>12</td>
<td>9</td>
</tr>
<tr>
<td>spint</td>
<td>57</td>
<td>11</td>
<td>9</td>
</tr>
<tr>
<td>spreg</td>
<td>57</td>
<td>8</td>
<td>6</td>
</tr>
<tr>
<td>mapclassify</td>
<td>48</td>
<td>9</td>
<td>8</td>
</tr>
<tr>
<td>pointpats</td>
<td>40</td>
<td>10</td>
<td>10</td>
</tr>
<tr>
<td>inequality</td>
<td>36</td>
<td>6</td>
<td>5</td>
</tr>
<tr>
<td>spvcm</td>
<td>21</td>
<td>2</td>
<td>1</td>
</tr>
</tbody>
</table>
\ No newline at end of file
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>commits</th>
</tr>
</thead>
<tbody>
<tr>
<th>Dani Arribas-Bel</th>
<td>25</td>
</tr>
<tr>
<th>Eli Knaap</th>
<td>14</td>
</tr>
<tr>
<th>Hu Shao</th>
<td>5</td>
</tr>
<tr>
<th>James Gaboardi</th>
<td>310</td>
</tr>
<tr>
<th>Jsignell</th>
<td>1</td>
</tr>
<tr>
<th>Levi John Wolf</th>
<td>227</td>
</tr>
<tr>
<th>Philip Kahn</th>
<td>2</td>
</tr>
<tr>
<th>Serge Rey</th>
<td>239</td>
</tr>
<tr>
<th>Stefanie Lumnitz</th>
<td>240</td>
</tr>
<tr>
<th>Taylor Oshan</th>
<td>239</td>
</tr>
<tr>
<th>Thequackdaddy</th>
<td>1</td>
</tr>
<tr>
<th>Wei Kang</th>
<td>217</td>
</tr>
<tr>
<th>Ziqi Li</th>
<td>51</td>
</tr>
</tbody>
</table>
\ No newline at end of file
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Dani Arribas-Bel</th>
<th>Eli Knaap</th>
<th>Hu Shao</th>
<th>James Gaboardi</th>
<th>Jsignell</th>
<th>Levi John Wolf</th>
<th>Philip Kahn</th>
<th>Serge Rey</th>
<th>Stefanie Lumnitz</th>
<th>Taylor Oshan</th>
<th>Thequackdaddy</th>
<th>Wei Kang</th>
<th>Ziqi Li</th>
</tr>
</thead>
<tbody>
<tr>
<th>lib.libpysal</th>
<td>19</td>
<td>12</td>
<td>0</td>
<td>8</td>
<td>0</td>
<td>112</td>
<td>0</td>
<td>101</td>
<td>2</td>
<td>4</td>
<td>0</td>
<td>18</td>
<td>0</td>
</tr>
<tr>
<th>explore.esda</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>11</td>
<td>0</td>
<td>50</td>
<td>10</td>
<td>0</td>
<td>0</td>
<td>8</td>
<td>0</td>
</tr>
<tr>
<th>explore.giddy</th>
<td>0</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>18</td>
<td>10</td>
<td>0</td>
<td>0</td>
<td>106</td>
<td>0</td>
</tr>
<tr>
<th>explore.inequality</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>22</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>13</td>
<td>0</td>
</tr>
<tr>
<th>explore.pointpats</th>
<td>0</td>
<td>0</td>
<td>5</td>
<td>0</td>
<td>0</td>
<td>7</td>
<td>0</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>26</td>
<td>0</td>
</tr>
<tr>
<th>explore.spaghetti</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>278</td>
<td>0</td>
<td>3</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<th>viz.mapclassify</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>3</td>
<td>0</td>
<td>22</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>23</td>
<td>0</td>
</tr>
<tr>
<th>viz.splot</th>
<td>6</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>9</td>
<td>0</td>
<td>7</td>
<td>218</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<th>model.spreg</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>40</td>
<td>0</td>
<td>17</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<th>model.spglm</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>7</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>60</td>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<th>model.spint</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>7</td>
<td>0</td>
<td>8</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>42</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<th>model.mgwr</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>9</td>
<td>0</td>
<td>10</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>133</td>
<td>0</td>
<td>21</td>
<td>51</td>
</tr>
<tr>
<th>model.spvcm</th>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>21</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
\ No newline at end of file
import yaml
import os
import subprocess
import sys
import json
#TARGETROOT ="pysal/"
os.system('rm pysal/*.py')
with open('packages.yml') as package_file:
packages = yaml.load(package_file)
# only tagged packages go in release
with open('tags.json') as tag_file:
tags = json.load(tag_file)
tagged = list(tags.keys())
print(tagged)
for package in packages:
com = "rm -fr pysal/{package}".format(package=package)
os.system(com)
com = "mkdir pysal/{package}".format(package=package)
os.system(com)
#"cp -fr tmp/{subpackage}-master/{subpackage}/* pysal/{package}/".format(package=package, subpackage=subpackage)
subpackages = packages[package].split()
for subpackage in subpackages:
if subpackage == 'libpysal':
com = "cp -rf tmp/{subpackage}/{subpackage}/* pysal/{package}/".format(package=package, subpackage=subpackage)
else:
com = "cp -rf tmp/{subpackage}/{subpackage} pysal/{package}/{subpackage}".format(package=package, subpackage=subpackage)
if subpackage in tagged:
print(com)
os.system(com)
else:
print('skipping: ', subpackage)
# replace all references to libpysal with pysal.lib
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/libpysal/pysal\.lib/g'"
os.system(c)
# replace all references to esda with pysal.explore.esda
c = "find pysal/explore/. -name '*.py' -print | xargs sed -i -- 's/esda/pysal\.explore\.esda/g'"
os.system(c)
# replace all references to mapclassify in esda and viz.mappclassify with pysal.viz.mapclassify
c = "find pysal/viz/mapclassify/. -name '*.py' -print | xargs sed -i -- 's/mapclassify/pysal\.viz\.mapclassify/g'"
os.system(c)
c = "find pysal/explore/. -name '*.py' -print | xargs sed -i -- 's/mapclassify/pysal\.viz\.mapclassify/g'"
os.system(c)
# replace all references to pysal.spreg with pysal.model.spreg
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/pysal\.spreg/pysal\.model\.spreg/g'"
os.system(c)
# replace all references in spglm to spreg with pysal.model.spreg
c = "find pysal/model/spglm/. -name '*.py' -print | xargs sed -i -- 's/ spreg\./ pysal\.model\.spreg\./g'"
os.system(c)
# from spreg import user_output as USER
c = "find pysal/model/spglm/. -name '*.py' -print | xargs sed -i -- 's/from spreg import/from pysal\.model\.spreg import/g'"
os.system(c)
# replace all references in spint to spreg with pysal.model.spreg
c = "find pysal/model/spint/. -name '*.py' -print | xargs sed -i -- 's/from spreg import/from pysal\.model\.spreg import/g'"
os.system(c)
# replace all references in spint to spreg with pysal.model.spreg
c = "find pysal/model/spint/. -name '*.py' -print | xargs sed -i -- 's/ spreg\./ pysal\.model\.spreg\./g'"
os.system(c)
# replace import spreg.user_output as USER to from pysal.model.spreg import user_output as USER
#c = "find pysal/model/spreg/. -name '*.py' -print | xargs sed -i -- 's/import spreg\.user_output as USER/from pysal\.model\.spreg import user_output as USER/g'"
#os.system(c)
c = "find pysal/model/spglm/. -name '*.py' -print | xargs sed -i -- 's/import spreg\.user_output as USER/from pysal\.model\.spreg import user_output as USER/g'"
os.system(c)
c = "find pysal/model/spglm/. -name '*.py' -print | xargs sed -i -- 's/import spreg\.user_output as USER/from pysal\.model\.spreg import user_output as USER/g'"
os.system(c)
# undo a side effect in spglm
c = "find pysal/model/spglm/. -name '*.py' -print | xargs sed -i -- 's/import pysal\.model\.spreg\.user_output as USER/from pysal\.model\.spreg import user_output as USER/g'"
os.system(c)
c = "find pysal/model/spint/. -name '*.py' -print | xargs sed -i -- 's/import spreg\.user_output as USER/from pysal\.model\.spreg import user_output as USER/g'"
os.system(c)
c = "find pysal/model/mgwr/. -name '*.py' -print | xargs sed -i -- 's/import spreg\.user_output as USER/from pysal\.model\.spreg import user_output as USER/g'"
os.system(c)
# replace all references to spglm with pysal.model.spglm
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/spglm/pysal\.model\.spglm/g'"
os.system(c)
# replace all references to spvcm with pysal.model.spvcm
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/ spvcm / pysal\.model\.spvcm /g'"
os.system(c)
# replace all references to spvcm with pysal.model.spvcm
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/ spvcm\./ pysal\.model\.spvcm\./g'"
os.system(c)
# fix in spvcm from spreg -> from pysal.model.spreg
c = "find pysal/model/spvcm/. -name '*.py' -print | xargs sed -i -- 's/from spreg/from pysal\.model\.spreg/g'"
os.system(c)
# fix giddy
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/ giddy\.api/ pysal\.explore\.giddy\.api/g'"
os.system(c)
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/import giddy/import pysal\.explore\.giddy/g'"
os.system(c)
c = "find pysal/. -name '*.py' -print | xargs sed -i -- 's/from giddy/from pysal\.explore\.giddy/g'"
os.system(c)
# fix mgwr
c = "find pysal/model/mgwr/. -name '*.py' -print | xargs sed -i -- 's/pysal\.open/pysal\.lib\.open/g'"
os.system(c)
c = "find pysal/model/mgwr/. -name '*.py' -print | xargs sed -i -- 's/pysal\.examples/pysal\.lib\.examples/g'"
os.system(c)
# fix spreg
c = "find pysal/model/spreg/. -name '*.py' -print | xargs sed -i -- 's/from spreg/from pysal\.model\.spreg/g'"
os.system(c)
c = "find pysal/model/spreg/. -name '*.py' -print | xargs sed -i -- 's/import spreg/import pysal\.model\.spreg/g'"
os.system(c)
c = "find pysal/model/spreg/. -name '*.py' -print | xargs sed -i -- 's/ spreg/ pysal\.model\.spreg/g'"
os.system(c)
# fix spvcm
c = "find pysal/model/spvcm/. -name '*.py' -print | xargs sed -i -- 's/pysal\.examples/pysal\.lib\.examples/g'"
os.system(c)
#pysal.queen_from_shapefile
c = "find pysal/model/spvcm/. -name '*.py' -print | xargs sed -i -- 's/pysal\.queen/pysal\.lib\.weights\.user\.queen/g'"
os.system(c)
c = "find pysal/model/spvcm/. -name '*.py' -print | xargs sed -i -- 's/pysal\.w_subset/pysal\.lib\.weights\.Wsets\.w_subset/g'"
os.system(c)
if 'splot' in tagged:
# fix splot
#from splot.libpysal import plot_spatial_weights
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from splot\.libpysal/from pysal\.viz\.splot\.libpysal/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from splot\.bk/from pysal\.viz\.splot\.bk/g'"
os.system(c)
#from esda.moran import Moran_Local, Moran, Moran_BV, Moran_Local_BV
#c = "find pysalnext/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from esda/from pysal\.explore\.esda/g'"
#os.system(c)
# from pysal.viz.splot.pysal.explore.esda import
# from splot.esda
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from pysal\.viz\.splot\.pysal\.explore\.esda/from pysal\.viz\.splot\.esda/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from splot\.pysal\.explore\.esda/from pysal\.viz\.splot\.pysal\.explore\.esda/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/import pysal as ps/import pysal/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/ps\.spreg/pysal\.model\.spreg/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/ps\.lag_spatial/pysal\.lib\.weights\.spatial_lag\.lag_spatial/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from esda/from pysal\.explore\.esda/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/import esda/import pysal\.explore\.esda/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/import pysal\.explore\.esda/import pysal\.explore\.esda as esda/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from splot\.esda/from pysal\.viz\.splot\.esda/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from spreg/from pysal\.model\.spreg/g'"
os.system(c)
#from splot.libpysal import plot_spatial_weights
#from splot.pysal.lib import plot_spatial_weights
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from splot\.pysal\.lib/from pysal\.viz\.splot\.libpysal/g'"
os.system(c)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from splot\.giddy/from pysal\.viz\.splot\.giddy/g'"
os.system(c)
#from ._viz_pysal.lib_mpl import (plot_spatial_weights)
#from ._viz_libpysal_mpl import (plot_spatial_weights)
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/_viz_pysal\.lib_mpl/_viz_libpysal_mpl/g'"
os.system(c)
# import mapclassify as classify -> import pysal.viz.mapclassify as classify
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/import mapclassify/import pysal\.viz\.mapclassify/g'"
os.system(c)
# from splot.mapping -> from pysal.viz.splot.mapping
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from splot\.mapping /from pysal\.viz\.splot\.mapping /g'"
os.system(c)
# from splot._ -> from pysal.viz.splot._
c = "find pysal/viz/splot/. -name '*.py' -print | xargs sed -i -- 's/from splot\._/from pysal\.viz\.splot\._/g'"
os.system(c)
#
#
#c = "find pysalnext/model/mgwr/. -name '*.py' -print | xargs sed -i -- 's/pysal\.open/pysal\.lib\.examples\.open/g'"
#os.system(c)
# handle inequality
c = "find pysal/explore/inequality/. -name '*.py' -print | xargs sed -i -- 's/from inequality/from pysal\.explore\.inequality/g'"
os.system(c)
# handle mgwr
c = "find pysal/model/mgwr/. -name '*.py' -print | xargs sed -i -- 's/from spreg/from pysal\.model\.spreg/g'"
os.system(c)
c = "find pysal/model/mgwr/. -name '*.py' -print | xargs sed -i -- 's/import spreg/import pysal\.model\.spreg/g'"
os.system(c)
# handle spaghetti
c = "find pysal/explore/spaghetti/. -name '*.py' -print | xargs sed -i -- 's/from spaghetti/from pysal\.explore\.spaghetti/g'"
os.system(c)
c = "find pysal/explore/spaghetti/. -name '*.py' -print | xargs sed -i -- 's/import spaghetti/import pysal\.explore\.spaghetti/g'"
os.system(c)
init_lines = ["__version__='2.0rc2'"]
for package in packages:
os.system('touch pysal/{package}/__init__.py'.format(package=package))
subpackages = packages[package].split()
if package == 'lib':
pass
else:
subpackage_lines = ['from . import {}'.format(s) for s in subpackages]
with open('pysal/{package}/__init__.py'.format(package=package), 'w') as f:
f.write('\n'.join(subpackage_lines))
init_lines.append('from . import {}'.format(package))
lines = "\n".join(init_lines)
with open("pysal/__init__.py", 'w') as outfile:
outfile.write(lines)
import yaml
import os
import subprocess
import sys
import json
import pybtex.database
#TARGETROOT ="pysal/"
with open('packages.yml') as package_file:
packages = yaml.load(package_file)
# only tagged packages go in release
with open('tags.json') as tag_file:
tags = json.load(tag_file)
tagged = list(tags.keys())
from pybtex.database import BibliographyData, Entry
master_data = BibliographyData( {
'article-minimal': Entry('article', [
('author', 'Leslie B. Lamport'),
('title', "blah blah blah"),
('journal', "Some outlet"),
('year', '1986'),
]),
})
# handle duplicates
for package in packages:
subpackages = packages[package].split()
for subpackage in subpackages:
package_bib = "tmp/{subpackage}/doc/_static/references.bib".format(subpackage=subpackage)
if os.path.isfile(package_bib):
local = pybtex.database.parse_file(package_bib)
for entry in local.entries:
if entry not in master_data.entries:
master_data.add_entry(entry, local.entries[entry])
print('adding', entry)
with open("doc/_static/references.bib", 'w') as master_bib:
master_bib.write(master_data.to_string('bibtex'))
pysal (1.14.4-4) UNRELEASED; urgency=medium
pysal (2.0.0-1) unstable; urgency=medium
* Team upload.
* Update dh_install override to use --list-missing.
* Update gbp.conf to use --source-only-changes by default.
* Move from experimental to unstable.
-- Bas Couwenberg <sebastic@debian.org> Mon, 08 Jul 2019 08:20:21 +0200
pysal (2.0.0-1~exp1) experimental; urgency=medium
* Team upload.
* New upstream release.
* Bump Standards-Version to 4.3.0, no changes.
* Drop Python 2 package, no longer supported upstream.
* Add python3-{rtree,statsmodels} to build dependencies.
* Copy test data to build dir.
* Remove executable bit from test files.
* Drop unused lintian overrides.
* Add overrides for package-contains-documentation-outside-usr-share-doc.
* Remove lattice.dbf from Python module directory.
-- Bas Couwenberg <sebastic@debian.org> Tue, 28 Aug 2018 15:20:05 +0200
-- Bas Couwenberg <sebastic@debian.org> Mon, 04 Feb 2019 18:09:52 +0100
pysal (1.14.4-3) unstable; urgency=medium
......
......@@ -5,74 +5,26 @@ Section: python
Priority: optional
Build-Depends: debhelper (>= 9),
dh-python,
python-all,
python3-all,
python-geojson,
python3-geojson,
python-geopandas,
python3-geopandas,
python-matplotlib,
python3-matplotlib,
python-nose-exclude,
python3-nose-exclude,
python-numexpr,
python3-numexpr,
python-numpy,
python3-numpy,
python-pandas,
python3-pandas,
python-scipy,
python3-rtree,
python3-scipy,
python-seaborn,
python3-seaborn,
python-setuptools,
python3-setuptools,
python-shapely,
python3-shapely,
python-sklearn,
python3-sklearn
python3-sklearn,
python3-statsmodels
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/debian-gis-team/pysal
Vcs-Git: https://salsa.debian.org/debian-gis-team/pysal.git
Homepage: https://pysal.readthedocs.org/en/latest/
Package: python-pysal
Architecture: all
Depends: python-lxml,
python-pandas,
python-scipy,
${python:Depends},
${misc:Depends}
Recommends: python-geojson,
python-geopandas,
python-matplotlib,
python-numexpr,
python-seaborn,
python-shapely,
python-sklearn
Description: Python Spatial Analysis Library - Python 2
PySAL is an open source library of spatial analysis functions written in
Python intended to support the development of high level applications.
.
It is important to underscore what PySAL is, and is not, designed to do. First
and foremost, PySAL is a library in the fullest sense of the word. Developers
looking for a suite of spatial analytical methods that they can incorporate
into application development should feel at home using PySAL. Spatial analysts
who may be carrying out research projects requiring customized scripting,
extensive simulation analysis, or those seeking to advance the state of the art
in spatial analysis should also find PySAL to be a useful foundation for their
work.
.
End users looking for a user friendly graphical user interface for spatial
analysis should not turn to PySAL directly. Instead, they should consider
projects like STARS and the GeoDaX suite of software products which wrap PySAL
functionality in GUIs. At the same time, it's expected that with developments
such as the Python based plug-in architectures for QGIS, GRASS, and the
toolbox extensions for ArcGIS, that end user access to PySAL functionality
will be widening in the near future.
.
This package contains the pysal library for Python 2.
Package: python3-pysal
Architecture: all
Depends: python3-lxml,
......@@ -86,7 +38,8 @@ Recommends: python3-geojson,
python3-numexpr,
python3-seaborn,
python3-shapely,
python3-sklearn
python3-sklearn,
python3-statsmodels
Description: Python Spatial Analysis Library - Python 3
PySAL is an open source library of spatial analysis functions written in
Python intended to support the development of high level applications.
......
#!/bin/sh
set -e
version="$1"
interpreter="$2"
dir="$3"
destdir="$4"
home_dir="$5"
build_dir="$6"
install_dir="$7"
package="$8"
cp -rv ${dir}/pysal/lib/cg/tests/data ${build_dir}/pysal/lib/cg/tests/
cp -rv ${dir}/pysal/model/mgwr/tests ${build_dir}/pysal/model/mgwr/
cp -rv ${dir}/pysal/model/spvcm/both_levels/tests/data ${build_dir}/pysal/model/spvcm/both_levels/tests/
cp -rv ${dir}/pysal/model/spvcm/lower_level/tests/data ${build_dir}/pysal/model/spvcm/lower_level/tests/
cp -rv ${dir}/pysal/model/spvcm/upper_level/tests/data ${build_dir}/pysal/model/spvcm/upper_level/tests/
cp -rv ${dir}/pysal/model/spvcm/tests/data ${build_dir}/pysal/model/spvcm/tests/
cp -rv ${dir}/pysal/viz/mapclassify/datasets/calemp ${build_dir}/pysal/viz/mapclassify/datasets/