diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index b012b34..9ca5356 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -19,7 +19,7 @@ strategy: matrix: os: ['ubuntu-latest'] - environment-file: [ci/311.yaml] + environment-file: [ci/312-latest.yaml] experimental: [false] defaults: run: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 794e0b0..b833a11 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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: | @@ -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 \ diff --git a/README.md b/README.md index 0cbeef7..04bf11e 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 -------------- @@ -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 ---------- diff --git a/ci/310.yaml b/ci/310-latest.yaml similarity index 65% rename from ci/310.yaml rename to ci/310-latest.yaml index 963b8ff..cc13039 100644 --- a/ci/310.yaml +++ b/ci/310-latest.yaml @@ -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 diff --git a/ci/39-MIN.yaml b/ci/310-oldest.yaml similarity index 60% rename from ci/39-MIN.yaml rename to ci/310-oldest.yaml index fca5467..ae5514f 100644 --- a/ci/39-MIN.yaml +++ b/ci/310-oldest.yaml @@ -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 diff --git a/ci/311-DEV.yaml b/ci/311-DEV.yaml deleted file mode 100644 index dfba346..0000000 --- a/ci/311-DEV.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: test -channels: - - conda-forge -dependencies: - - python=3.11 - # required - - geopandas>=0.4.0 - - pip - - quantecon>=0.4.7 - - scipy>=1.3.0 - - esda>=2.1.1 - - libpysal>=4.0.1 - - mapclassify>=2.1.1 - - splot - # testing - - codecov - - ipywidgets - - matplotlib - - pandas - - pytest - - pytest-cov - - pytest-xdist - - pytest-doctestplus - # docs (this env only) - - nbsphinx - - numpydoc - - sphinx>=1.4.3 - - sphinxcontrib-bibtex - - sphinx_bootstrap_theme diff --git a/ci/311.yaml b/ci/311-latest.yaml similarity index 65% rename from ci/311.yaml rename to ci/311-latest.yaml index 850a5d3..4f00ee5 100644 --- a/ci/311.yaml +++ b/ci/311-latest.yaml @@ -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 diff --git a/ci/312-dev.yaml b/ci/312-dev.yaml new file mode 100644 index 0000000..7f1f6a6 --- /dev/null +++ b/ci/312-dev.yaml @@ -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 + + diff --git a/ci/312-latest.yaml b/ci/312-latest.yaml new file mode 100644 index 0000000..34ded22 --- /dev/null +++ b/ci/312-latest.yaml @@ -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 diff --git a/docs/installation.rst b/docs/installation.rst index b8378dc..78d334f 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -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 @@ -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/ diff --git a/environment.yml b/environment.yml index 0390679..d8810da 100644 --- a/environment.yml +++ b/environment.yml @@ -3,12 +3,11 @@ channels: - conda-forge dependencies: - python - - jupyterlab - esda + - geopandas + - jupyterlab - libpysal + - mapclassify - quantecon - scipy - - geopandas - splot - - pip - diff --git a/giddy/directional.py b/giddy/directional.py index 522a573..f74cbd1 100644 --- a/giddy/directional.py +++ b/giddy/directional.py @@ -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 diff --git a/giddy/markov.py b/giddy/markov.py index 367f252..858e550 100644 --- a/giddy/markov.py +++ b/giddy/markov.py @@ -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))) diff --git a/giddy/sequence.py b/giddy/sequence.py index 0b07a12..045f6cd 100644 --- a/giddy/sequence.py +++ b/giddy/sequence.py @@ -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: @@ -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]] @@ -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))) diff --git a/giddy/util.py b/giddy/util.py index e31e609..40b3e57 100644 --- a/giddy/util.py +++ b/giddy/util.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 841ed35..9a31ffb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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]