Skip to content

Commit

Permalink
Merge pull request #228 from jGaboardi/GH225_CI_maint
Browse files Browse the repository at this point in the history
update CI - minimum versions, naming, etc.
  • Loading branch information
weikang9009 authored Aug 15, 2024
2 parents d3770a8 + fb4321f commit 161a285
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [ci/311.yaml]
environment-file: [ci/312-latest.yaml]
experimental: [false]
defaults:
run:
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ jobs:
matrix:
os: [ubuntu-latest]
environment-file:
- ci/39-MIN.yaml
- ci/310.yaml
- ci/311.yaml
- ci/311-DEV.yaml
- ci/310-oldest.yaml
- ci/310-latest.yaml
- ci/311-latest.yaml
- ci/312-latest.yaml
- ci/312-dev.yaml
include:
- environment-file: ci/311.yaml
- environment-file: ci/312-latest.yaml
os: macos-13 # Intel
- environment-file: ci/311.yaml
- environment-file: ci/312-latest.yaml
os: macos-14 # Apple Silicon
- environment-file: ci/311.yaml
- environment-file: ci/312-latest.yaml
os: windows-latest
fail-fast: false

Expand All @@ -51,15 +52,6 @@ jobs:
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'

- name: install bleeding edge libpysal, esda, mapclassify & splot (Ubuntu / Python 3.11)
shell: bash -l {0}
run: |
pip install git+https://github.com/pysal/libpysal.git@main
pip install git+https://github.com/pysal/esda.git@main
pip install git+https://github.com/pysal/mapclassify.git@main
pip install git+https://github.com/pysal/splot.git@main
if: matrix.os == 'ubuntu-latest' && contains(matrix.environment-file, 'DEV')

- name: environment info
shell: bash -l {0}
run: |
Expand All @@ -69,13 +61,13 @@ jobs:
- name: spatial versions (if geopandas is installed)
shell: bash -l {0}
run: 'python -c "import geopandas; geopandas.show_versions();"'
if: contains(matrix.environment-file, 'DEV')
if: contains(matrix.environment-file, 'dev')

- name: run pytest
run: pytest giddy -r a -v -n auto --cov giddy --cov-report xml --color yes --cov-append --cov-report term-missing

- name: run docstring tests
if: contains(matrix.environment-file, '311-DEV') && contains(matrix.os, 'ubuntu')
if: contains(matrix.environment-file, '312-dev') && contains(matrix.os, 'ubuntu')
run: |
pytest \
-v \
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PySAL-giddy for exploratory spatiotemporal data analysis

[![Continuous Integration](https://github.com/pysal/giddy/actions/workflows/tests.yml/badge.svg)](https://github.com/pysal/giddy/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/pysal/giddy/branch/main/graph/badge.svg)](https://codecov.io/gh/pysal/giddy)
[![Gitter room](https://badges.gitter.im/pysal/giddy.svg)](https://gitter.im/pysal/giddy)
[![Discord](https://img.shields.io/badge/Discord-join%20chat-7289da?style=flat&logo=discord&logoColor=cccccc&link=https://discord.gg/qUvMmdEmnp)](https://discord.gg/qUvMmdEmnp)
[![PyPI version](https://badge.fury.io/py/giddy.svg)](https://badge.fury.io/py/giddy)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1322825.svg)](https://doi.org/10.5281/zenodo.1322825)
[![badge](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pysal/giddy/main)
Expand Down Expand Up @@ -73,11 +73,11 @@ pip install git+https://github.com/pysal/giddy

#### Requirements

- scipy>=1.3.0
- libpysal>=4.0.1
- mapclassify>=2.1.1
- esda>=2.1.1
- quantecon>=0.4.7
- scipy>=1.8
- libpysal>=4.8
- mapclassify>=2.5
- esda>=2.4
- quantecon>=0.7

Contribute
--------------
Expand All @@ -89,7 +89,7 @@ If you have any suggestion, feature request, or bug report, please open a new [i
Support
-----------

If you are having issues, please talk to us in the [gitter room](https://gitter.im/pysal/giddy).
If you are having issues, please talk to us in the [discord channel](https://discord.gg/qUvMmdEmnp).

License
----------
Expand Down
10 changes: 5 additions & 5 deletions ci/310.yaml → ci/310-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ channels:
dependencies:
- python=3.10
# required
- esda>=2.1.1
- libpysal>=4.0.1
- mapclassify>=2.1.1
- quantecon>=0.4.7
- scipy>=1.3.0
- esda
- libpysal
- mapclassify
- quantecon
- scipy
- splot
# testing
- codecov
Expand Down
12 changes: 6 additions & 6 deletions ci/39-MIN.yaml → ci/310-oldest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: test
channels:
- conda-forge
dependencies:
- python=3.9
- python=3.10
# required
- esda>=2.1.1
- libpysal>=4.0.1
- mapclassify>=2.1.1
- quantecon>=0.4.7
- scipy>=1.3.0
- esda=2.4
- libpysal=4.8
- mapclassify=2.5
- quantecon=0.7
- scipy=1.8
- splot
# testing
- codecov
Expand Down
29 changes: 0 additions & 29 deletions ci/311-DEV.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions ci/311.yaml → ci/311-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ channels:
dependencies:
- python=3.11
# required
- esda>=2.1.1
- libpysal>=4.0.1
- mapclassify>=2.1.1
- quantecon>=0.4.7
- scipy>=1.3.0
- esda
- libpysal
- mapclassify
- quantecon
- scipy
- splot
# testing
- codecov
Expand Down
31 changes: 31 additions & 0 deletions ci/312-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.12
# required
- pip
# testing
- codecov
- ipywidgets
- matplotlib
- pytest
- pytest-cov
- pytest-xdist
- pytest-doctestplus
- pip:
# dev versions of packages
- --pre \
--index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
--extra-index-url https://pypi.org/simple
- numpy
- pandas
- scipy
- git+https://github.com/pysal/esda.git@main
- git+https://github.com/geopandas/geopandas.git@main
- git+https://github.com/pysal/libpysal.git@main
- git+https://github.com/pysal/mapclassify.git@main
- git+https://github.com/QuantEcon/QuantEcon.py.git@main
- git+https://github.com/pysal/splot.git@main


19 changes: 19 additions & 0 deletions ci/312-latest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.12
# required
- esda
- libpysal
- mapclassify
- quantecon
- scipy
- splot
# testing
- codecov
- ipywidgets
- matplotlib
- pytest
- pytest-cov
- pytest-xdist
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Installation
============

giddy currently supports python `3.9`_, `3.10`_, and `3.11`_.
giddy currently supports python `3.10`_, `3.11`_, and `3.12`_.
Please make sure that you are operating in a python 3 environment.

Installing released version
Expand Down Expand Up @@ -41,9 +41,9 @@ your fork. By making changes
to your local clone and submitting a pull request to `pysal/giddy`_, you can
contribute to the giddy development.

.. _3.9: https://docs.python.org/3.9/
.. _3.10: https://docs.python.org/3.10/
.. _3.11: https://docs.python.org/3.11/
.. _3.12: https://docs.python.org/3.12/
.. _Python Package Index: https://pypi.org/project/giddy/
.. _pysal/giddy: https://github.com/pysal/giddy
.. _fork: https://help.github.com/articles/fork-a-repo/
Expand Down
7 changes: 3 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ channels:
- conda-forge
dependencies:
- python
- jupyterlab
- esda
- geopandas
- jupyterlab
- libpysal
- mapclassify
- quantecon
- scipy
- geopandas
- splot
- pip

2 changes: 1 addition & 1 deletion giddy/directional.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def plot_origin(self): # TODO add attribute option to color vectors

xlim = [self._dx.min(), self._dx.max()]
ylim = [self._dy.min(), self._dy.max()]
for x, y in zip(self._dx, self._dy):
for x, y in zip(self._dx, self._dy, strict=False):
xs = [0, x]
ys = [0, y]
plt.plot(xs, ys, "-b") # TODO change this to scale with attribute
Expand Down
2 changes: 1 addition & 1 deletion giddy/markov.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ def __init__(
self.classes = classes
self.k = len(classes)
self.m = self.k
label_dict = dict(zip(classes, range(self.k)))
label_dict = dict(zip(classes, range(self.k), strict=False))
y_int = []
for yi in y:
y_int.append(list(map(label_dict.get, yi)))
Expand Down
10 changes: 7 additions & 3 deletions giddy/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __init__(self, y, subs_mat=None, dist_type=None, indel=None, cluster_type=No
self.indel = indel
self.subs_mat = subs_mat
self.cluster_type = cluster_type
self.label_dict = dict(zip(self.classes, range(self.k)))
self.label_dict = dict(zip(self.classes, range(self.k), strict=False))

y_int = []
for yi in y:
Expand Down Expand Up @@ -267,7 +267,11 @@ def __init__(self, y, subs_mat=None, dist_type=None, indel=None, cluster_type=No
y_tran_index = np.zeros_like(y_int)
y_tran = []
for i in range(y_int.shape[1]):
y_tran.append(list(zip(y_int_ext[:, i], y_int_ext[:, i + 1])))
y_tran.append(
list(
zip(y_int_ext[:, i], y_int_ext[:, i + 1], strict=False)
)
)
for i in range(y_int.shape[0]):
for j in range(y_int.shape[1]):
y_tran_index[i, j] = dict_trans_state[y_tran[j][i]]
Expand Down Expand Up @@ -337,7 +341,7 @@ def _om_dist(self, y_int):
moves_str, unique_indices = np.unique(y_str, axis=0, return_index=True)
moves_int = y_int[unique_indices]
uni_num = len(moves_str)
dict_move_index = dict(zip(map(tuple, moves_int), range(uni_num)))
dict_move_index = dict(zip(map(tuple, moves_int), range(uni_num), strict=False))

# dict_move_index = dict(zip(map(tuple, moves_str), range(uni_num)))

Expand Down
2 changes: 1 addition & 1 deletion giddy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _fill_empty_diagonal_3d(p):
p0 = p_temp.sum(axis=2) == 0
if p0.sum() > 0:
rows, cols = np.where(p0)
row_zero_i = list(zip(rows, cols))
row_zero_i = list(zip(rows, cols, strict=False))
for row in row_zero_i:
i, j = row
p_temp[i, j, j] = 1
Expand Down
14 changes: 6 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,18 @@ keywords = ["spatial statistics", "spatiotemporal analysis"]
readme = "README.md"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: GIS",
]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"esda>=2.1.1",
"libpysal>=4.0.1",
"quantecon>=0.4.7",
"scipy>=1.3",
"esda>=2.4",
"libpysal>=4.8",
"mapclassify>=2.5",
"quantecon>=0.7",
"scipy>=1.8",
]

[project.urls]
Expand Down

0 comments on commit 161a285

Please sign in to comment.