Skip to content

Commit

Permalink
Merge pull request #409 from jGaboardi/py38
Browse files Browse the repository at this point in the history
adding py3.8 to travis
  • Loading branch information
jGaboardi committed Feb 1, 2020
2 parents ab06908 + 45ea3aa commit c8398fc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
14 changes: 13 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ matrix:
env: PY=3.7 PYSAL_PYPI=true PYSAL_PLUS=false
- name: "python-3.7-pypi-plus"
env: PY=3.7 PYSAL_PYPI=true PYSAL_PLUS=true
- name: "python-3.8-pypi"
env: PY=3.8 PYSAL_PYPI=true PYSAL_PLUS=false
- name: "python-3.8-pypi-plus"
env: PY=3.8 PYSAL_PYPI=true PYSAL_PLUS=true
- name: "tarball-pypi"
env: PY=3.7 PYSAL_PYPI=true PYSAL_PLUS=false
env: PY=3.8 PYSAL_PYPI=true PYSAL_PLUS=false
- name: "python-3.6"
env: PY=3.6 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.6-plus"
Expand All @@ -21,6 +25,10 @@ matrix:
env: PY=3.7 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.7-plus"
env: PY=3.7 PYSAL_PYPI=false PYSAL_PLUS=true
- name: "python-3.8"
env: PY=3.8 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.8-plus"
env: PY=3.8 PYSAL_PYPI=false PYSAL_PLUS=true
allow_failures:
- name: "python-3.6"
env: PY=3.6 PYSAL_PYPI=false PYSAL_PLUS=false
Expand All @@ -30,6 +38,10 @@ matrix:
env: PY=3.7 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.7-plus"
env: PY=3.7 PYSAL_PYPI=false PYSAL_PLUS=true
- name: "python-3.8"
env: PY=3.8 PYSAL_PYPI=false PYSAL_PLUS=false
- name: "python-3.8-plus"
env: PY=3.8 PYSAL_PYPI=false PYSAL_PLUS=true

before_install:
- |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Spaghetti is an open-source Python library for the analysis of network-based spa
|:---:|:---:|:---:|:---:|:---:|
|[![Downloads](https://pepy.tech/badge/spaghetti)](https://pepy.tech/project/spaghetti) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/spaghetti.svg)](https://anaconda.org/conda-forge/spaghetti) | [![Documentation](https://img.shields.io/static/v1.svg?label=docs&message=current&color=9cf)](http://pysal.org/spaghetti/) | [![GitHub issues closed](https://img.shields.io/github/issues-closed/pysal/spaghetti.svg?maxAge=3600)](https://github.com/pysal/spaghetti/issues) | [![Gitter](https://badges.gitter.im/pysal/Spaghetti.svg)](https://gitter.im/pysal/Spaghetti?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
| ![Pypi python versions](https://img.shields.io/pypi/pyversions/spaghetti.svg) | [![Conda Recipe](https://img.shields.io/badge/recipe-spaghetti-red.svg)](https://github.com/conda-forge/spaghetti-feedstock) | [![Coverage Status](https://coveralls.io/repos/github/pysal/spaghetti/badge.svg)](https://coveralls.io/github/pysal/spaghetti) | ![Github pull requests open](https://img.shields.io/github/issues-pr/pysal/spaghetti.svg) | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
| [![image](https://travis-ci.org/pysal/spaghetti.svg)](https://travis-ci.org/spaghetti) | ![conda arch](https://img.shields.io/conda/pn/conda-forge/spaghetti) | [![DOI](https://zenodo.org/badge/88305306.svg)](https://zenodo.org/badge/latestdoi/88305306) | ![Github pull requests closed](https://img.shields.io/github/issues-pr-closed/pysal/spaghetti.svg) | [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
| [![image](https://travis-ci.org/pysal/spaghetti.svg)](https://travis-ci.org/pysal/spaghetti) | ![conda arch](https://img.shields.io/conda/pn/conda-forge/spaghetti) | [![DOI](https://zenodo.org/badge/88305306.svg)](https://zenodo.org/badge/latestdoi/88305306) | ![Github pull requests closed](https://img.shields.io/github/issues-pr-closed/pysal/spaghetti.svg) | [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)


Examples
Expand Down
4 changes: 2 additions & 2 deletions spaghetti/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ def kfunction(nearest, upperbound, intensity, nsteps=10):
for i, r in enumerate(x):

# slice out and count neighbors within radius
y[i] = len(nearest[nearest <= r])
with numpy.errstate(invalid="ignore"):
y[i] = len(nearest[nearest <= r])

# compute k for y-axis vector
y *= intensity ** -1

return x, y

4 changes: 2 additions & 2 deletions spaghetti/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,11 +1452,11 @@ def simulate_observations(self, count, distribution="uniform"):
totallength = stops[-1]

# create lengths with a uniform distribution
if distribution is "uniform":
if distribution == "uniform":
nrandompts = numpy.random.uniform(0, totallength, size=(count,))

# create lengths with a poisson distribution
elif distribution is "poisson":
elif distribution == "poisson":
# calculate poisson from half the network length
mid_length = totallength / 2.0
nrandompts = numpy.random.poisson(mid_length, size=(count,))
Expand Down
5 changes: 2 additions & 3 deletions spaghetti/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ def get_neighbor_distances(ntw, v0, l):
>>> from libpysal import examples
>>> ntw = spaghetti.Network(examples.get_path("streets.shp"))
>>> neighs = spaghetti.util.get_neighbor_distances(ntw, 0, ntw.arc_lengths)
>>> neighs[1]
102.62353453439829
>>> numpy.round(neighs[1], 10)
102.6235345344
"""

# fetch links associated with vertices
Expand Down

0 comments on commit c8398fc

Please sign in to comment.