Skip to content

Commit

Permalink
Merge pull request #13 from weikang9009/master
Browse files Browse the repository at this point in the history
Prepare for the release
  • Loading branch information
shaohu authored May 18, 2018
2 parents 08b5a16 + ae9dc2b commit 3cecbf5
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 56 deletions.
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,24 @@
.rope*
.idea/
notebooks/.ipynb_checkpoints/
.DS_Store
.DS_Store
.ipynb_checkpoints/
*.bak
.eggs/
*.egg-info/

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__
28 changes: 28 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
v<1.1.0>, 2018-05-17

This release is the first tagged release of pointpats on Github.
Starting from this release, pointpats supports python 3.5 and 3.6 only.

GitHub stats for 2017/04/22 - 2018/05/17

These lists are automatically generated, and may be incomplete or contain duplicates.


We closed a total of 9 issues, 4 pull requests and 5 regular issues;
this is the full list (generated with the script
:file:`tools/github_stats.py`):

Pull Requests (4):

* :ghpull:`12`: b'chore: libpysal is 3 only now so removing travis tests on python 2'
* :ghpull:`11`: b'try removing conversion and see if this passes'
* :ghpull:`10`: b'updating license'
* :ghpull:`9`: b'Update the Readme file, change the relative URL links to absolute URLs'

Issues (5):

* :ghissue:`12`: b'chore: libpysal is 3 only now so removing travis tests on python 2'
* :ghissue:`11`: b'try removing conversion and see if this passes'
* :ghissue:`10`: b'updating license'
* :ghissue:`9`: b'Update the Readme file, change the relative URL links to absolute URLs'
* :ghissue:`8`: b'Relative links to notebooks on pypi landing page are broken'
44 changes: 26 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Point Pattern Analysis in PySAL
===============================
.. image:: https://travis-ci.org/pysal/pointpats.svg
.. image:: https://api.travis-ci.org/pysal/pointpats.svg
:target: https://travis-ci.org/pysal/pointpats

Statistical analysis of planar point patterns.
Expand All @@ -9,40 +9,48 @@ This package is part of a `refactoring of PySAL
<https://github.com/pysal/pysal/wiki/PEP-13:-Refactor-PySAL-Using-Submodules>`_.


***************
************
Introduction
***************
************

This `PySAL <https://github.com/pysal>`_ package is intended to support the statistical analysis of planar point patterns.
This `pointpats <https://github.com/pysal/pointpats>`_ package is intended to support the statistical analysis of planar point patterns.

It currently works on cartesian coordinates. Users with data in geographic coordinates need to project their data prior to using this module.

***************
Mimicking parts of the original PySAL api can be done with

``import pointpats.api as ps``

********
Examples
***************
********

- `Basic point pattern structure <https://github.com/pysal/pointpats/tree/master/notebooks/pointpattern.ipynb>`_
- `Centrography and visualization <https://github.com/pysal/pointpats/tree/master/notebooks/centrography.ipynb>`_
- `Marks <https://github.com/pysal/pointpats/tree/master/notebooks/marks.ipynb>`_
- `Simulation of point processes <https://github.com/pysal/pointpats/tree/master/notebooks/process.ipynb>`_
- `Distance based statistics <https://github.com/pysal/pointpats/tree/master/notebooks/distance_statistics.ipynb>`_

***************
************
Installation
***************
************

Install pointpats by running:

Requirements
------------------
- libpysal
- descartes
::

***************
$ pip install pointpats

***********
Development
***************
***********

pointpats development is hosted on `github <https://github.com/pysal/pointpats>`_.

As part of the PySAL project, pointpat development follows these `guidelines <http://pysal.readthedocs.io/en/latest/developers/index.html>`_.
As part of the PySAL project, pointpats development follows these `guidelines <http://pysal.readthedocs.io/en/latest/developers/index.html>`_.

***********
Bug reports
***********

***************
Bug rereports
***************
To search for or report bugs, please see pointpat's `issues <https://github.com/pysal/pointpats/issues>`_.
1 change: 1 addition & 0 deletions pointpats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
from .centrography import ellipse, mean_center
from .process import PointProcess, PoissonPointProcess
from .process import PoissonClusterPointProcess
from .version import version as __version__
50 changes: 25 additions & 25 deletions pointpats/distance_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,11 @@ class Genv(Envelopes):
Examples
--------
>>> import pysal as ps
>>> from points.distance_statistics import Genv
>>> from pysal.contrib import shapely_ext
>>> from points.process import PoissonPointProcess
>>> from points.window import Window
>>> import libpysal as ps
>>> from pointpats.distance_statistics import Genv
>>> from libpysal.cg import shapely_ext
>>> from pointpats.process import PoissonPointProcess
>>> from pointpats.window import Window
>>> va = ps.open(ps.examples.get_path("vautm17n.shp"))
>>> polys = [shp for shp in va]
>>> state = shapely_ext.cascaded_union(polys)
Expand Down Expand Up @@ -748,11 +748,11 @@ class Fenv(Envelopes):
Examples
--------
>>> import pysal as ps
>>> from points.distance_statistics import Fenv
>>> from pysal.contrib import shapely_ext
>>> from points.process import PoissonPointProcess
>>> from points.window import Window
>>> import libpysal as ps
>>> from pointpats.distance_statistics import Fenv
>>> from libpysal.cg import shapely_ext
>>> from pointpats.process import PoissonPointProcess
>>> from pointpats.window import Window
>>> va = ps.open(ps.examples.get_path("vautm17n.shp"))
>>> polys = [shp for shp in va]
>>> state = shapely_ext.cascaded_union(polys)
Expand Down Expand Up @@ -828,11 +828,11 @@ class Jenv(Envelopes):
Examples
--------
>>> import pysal as ps
>>> from points.distance_statistics import Jenv
>>> from pysal.contrib import shapely_ext
>>> from points.process import PoissonPointProcess
>>> from points.window import Window
>>> import libpysal as ps
>>> from pointpats.distance_statistics import Jenv
>>> from libpysal.cg import shapely_ext
>>> from pointpats.process import PoissonPointProcess
>>> from pointpats.window import Window
>>> va = ps.open(ps.examples.get_path("vautm17n.shp"))
>>> polys = [shp for shp in va]
>>> state = shapely_ext.cascaded_union(polys)
Expand Down Expand Up @@ -905,11 +905,11 @@ class Kenv(Envelopes):
Examples
--------
>>> import pysal as ps
>>> from points.distance_statistics import Kenv
>>> from pysal.contrib import shapely_ext
>>> from points.process import PoissonPointProcess
>>> from points.window import Window
>>> import libpysal as ps
>>> from pointpats.distance_statistics import Kenv
>>> from libpysal.cg import shapely_ext
>>> from pointpats.process import PoissonPointProcess
>>> from pointpats.window import Window
>>> va = ps.open(ps.examples.get_path("vautm17n.shp"))
>>> polys = [shp for shp in va]
>>> state = shapely_ext.cascaded_union(polys)
Expand Down Expand Up @@ -980,11 +980,11 @@ class Lenv(Envelopes):
Examples
--------
>>> import pysal as ps
>>> from points.distance_statistics import Lenv
>>> from pysal.contrib import shapely_ext
>>> from points.process import PoissonPointProcess
>>> from points.window import Window
>>> import libpysal as ps
>>> from pointpats.distance_statistics import Lenv
>>> from libpysal.cg import shapely_ext
>>> from pointpats.process import PoissonPointProcess
>>> from pointpats.window import Window
>>> va = ps.open(ps.examples.get_path("vautm17n.shp"))
>>> polys = [shp for shp in va]
>>> state = shapely_ext.cascaded_union(polys)
Expand Down
6 changes: 3 additions & 3 deletions pointpats/pointpattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PointPattern(object):
Examples
--------
>>> from points.pointpattern import PointPattern
>>> from pointpats.pointpattern import PointPattern
>>> points = [[66.22, 32.54], [22.52, 22.39], [31.01, 81.21],
... [9.47, 31.02], [30.78, 60.10], [75.21, 58.93],
... [79.26, 7.68], [8.23, 39.93], [98.73, 77.17],
Expand All @@ -60,9 +60,9 @@ class PointPattern(object):
>>> pp.lambda_hull
0.0022667153468973137
>>> pp.hull_area
5294.0039500000003
5294.00395
>>> pp.mbb_area
7638.2000000000007
7638.200000000001
"""
def __init__(self, points, window=None, names=None, coord_names=None):
Expand Down
16 changes: 8 additions & 8 deletions pointpats/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ class PoissonPointProcess(PointProcess):
Examples
--------
>>> import pysal as ps
>>> import libpysal as ps
>>> import numpy as np
>>> from points.window import Window, poly_from_bbox
>>> from pysal.contrib import shapely_ext
>>> from pointpats.window import Window, poly_from_bbox
>>> from libpysal.cg import shapely_ext
Open the virginia polygon shapefile
>>> va = ps.open(ps.examples.get_path("virginia.shp"))
Expand Down Expand Up @@ -339,10 +339,10 @@ class PoissonClusterPointProcess(PointProcess):
Examples
--------
>>> import pysal as ps
>>> import libpysal as ps
>>> import numpy as np
>>> from points.window import Window, poly_from_bbox
>>> from pysal.contrib import shapely_ext
>>> from pointpats.window import Window, poly_from_bbox
>>> from libpysal.cg import shapely_ext
Open the virginia polygon shapefile
>>> va = ps.open(ps.examples.get_path("virginia.shp"))
Expand Down Expand Up @@ -433,8 +433,8 @@ def realize(self, n):
l, b, r, t = self.window.bbox
d = self.radius
# get parent points
pxs = np.random.uniform(l, r, (n/self.children, 1))
pys = np.random.uniform(b, t, (n/self.children, 1))
pxs = np.random.uniform(l, r, (int(n/self.children), 1))
pys = np.random.uniform(b, t, (int(n/self.children), 1))
cents = np.hstack((pxs, pys))
# generate children points
pnts = [runif_in_circle(self.children, d, center) for center in cents]
Expand Down
6 changes: 6 additions & 0 deletions pointpats/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import datetime
Major = 1
Feature = 1
Bug = 0
version = '%d.%d.%d' % (Major, Feature, Bug)
stable_release_date = datetime.date(2018, 5, 17)
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,27 @@

from distutils.command.build_py import build_py

with open('README.rst') as file:
long_description = file.read()

pth = os.path.dirname(os.path.abspath(__file__))+ '/requirements.txt'

REQUIREMENTS = [i.strip() for i in open(pth).readlines()]

Major = 1
Feature = 1
Bug = 0
version = '%d.%d.%d' % (Major, Feature, Bug)

setup(name='pointpats',
version='1.0.1',
version=version,
description='Methods and Functions for planar point pattern analysis',
long_description = long_description,
url='https://github.com/pysal/pointpats',
maintainer='Hu Shao',
maintainer_email='shaohutiger@gmail.com',
py_modules=['pointpats'],
python_requires='>3.4',
test_suite = 'nose.collector',
tests_require=['nose'],
keywords='spatial statistics',
Expand Down
Loading

0 comments on commit 3cecbf5

Please sign in to comment.