Skip to content

Commit

Permalink
Merge pull request #367 from knaaptime/simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
knaaptime authored Sep 21, 2023
2 parents 8dc2f16 + f76a031 commit 62cb8e9
Show file tree
Hide file tree
Showing 27 changed files with 546 additions and 263 deletions.
7 changes: 1 addition & 6 deletions .ci/310.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ dependencies:
- cenpy
- geopandas >=0.9
- hdbscan
- matplotlib <=3.3.4
- matplotlib
- scikit-learn
- seaborn
- pyarrow >=0.14.1
- platformdirs
- dash
- dash-bootstrap-components
- palettable
- pip
- tqdm
- quilt3 >=3.6
Expand All @@ -26,7 +23,6 @@ dependencies:
- fsspec
- s3fs
- segregation >=2.0
- versioneer
- pyproj >=3
- pandana
- pooch
Expand All @@ -39,7 +35,6 @@ dependencies:
- coverage
- coveralls
- python-wget
- proplot
- contextily
- scikit-plot
- python-graphviz
9 changes: 2 additions & 7 deletions .ci/38.yml → .ci/311.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ name: test
channels:
- conda-forge
dependencies:
- python =3.8
- python =3.11
- pandas
- giddy >=2.2.1
- libpysal
- cenpy
- geopandas >=0.9
- hdbscan
- matplotlib <=3.3.4
- matplotlib
- scikit-learn
- seaborn
- pyarrow >=0.14.1
- platformdirs
- dash
- dash-bootstrap-components
- palettable
- pip
- tqdm
- quilt3 >=3.6
Expand All @@ -26,7 +23,6 @@ dependencies:
- fsspec
- s3fs
- segregation >=2.0
- versioneer
- pyproj >=3
- pandana
- pooch
Expand All @@ -39,7 +35,6 @@ dependencies:
- coverage
- coveralls
- python-wget
- proplot
- contextily
- scikit-plot
- python-graphviz
7 changes: 1 addition & 6 deletions .ci/39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ dependencies:
- libpysal
- cenpy
- geopandas >=0.9
- matplotlib <=3.3.4
- matplotlib
- scikit-learn
- seaborn
- hdbscan
- pyarrow >=0.14.1
- platformdirs
- dash
- dash-bootstrap-components
- palettable
- pip
- tqdm
- quilt3 >=3.6
Expand All @@ -26,7 +23,6 @@ dependencies:
- fsspec
- s3fs
- segregation >=2.0
- versioneer
- pyproj >=3
- pandana
- pooch
Expand All @@ -39,7 +35,6 @@ dependencies:
- coverage
- coveralls
- python-wget
- proplot
- contextily
- scikit-plot
- python-graphviz
Expand Down
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
categories:
- title: Bug Fixes
labels:
- bug
- title: Enhancements
labels:
- enhancement
- title: Other Changes
labels:
- "*"
52 changes: 30 additions & 22 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,42 @@
docs:
name: CI (${{ matrix.os }}-${{ matrix.environment-file }})
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 20
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [.ci/39.yml]

experimental: [false]
defaults:
run:
shell: bash -l {0}
steps:
- name: checkout repo
uses: actions/checkout@v2

- name: setup micromamba
uses: mamba-org/provision-with-micromamba@main
- uses: actions/checkout@v2
- uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'
mamba-version: "*"
channels: conda-forge
channel-priority: true

- name: install geosnap - bash
shell: bash -l {0}
run: pip install -e . --no-deps --force-reinstall
if: matrix.os != 'windows-latest'

- name: build docs
shell: bash -l {0}
run: cd docs; make html

path: ~/conda_pkgs_dir
key: ${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(matrix.environment-file) }}
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
channels: conda-forge
channel-priority: true
auto-update-conda: true
auto-activate-base: false
environment-file: ${{ matrix.environment-file }}
activate-environment: test
use-only-tar-bz2: true
- run: conda info --all
- run: conda list
- run: conda config --show-sources
- run: conda config --show
- run: pip install -e . --no-deps --force-reinstall
- run: |
cd docs
make html
- name: Commit documentation changes
run: |
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
Expand All @@ -46,7 +55,6 @@
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.
- name: Push changes
uses: ad-m/github-push-action@master
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
environment-file: [.ci/38.yml, .ci/39.yml, .ci/310.yml]
environment-file: [.ci/39.yml, .ci/310.yml, .ci/311.yml]

steps:
- name: checkout repo
Expand Down
94 changes: 40 additions & 54 deletions .github/workflows/upload_package.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,50 @@

name: Release Package
name: Release & Publish

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
inputs:
version:
description: Manual Release
default: test
required: false


jobs:
build:
name: Create release & publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine jupyter urllib3 pandas pyyaml
python setup.py develop --no-deps
python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
- name: Run Changelog
run: |
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=python3 tools/gitcount.ipynb
- name: Cat Changelog
uses: pCYSl5EDgo/cat@master
id: changetxt
with:
path: ./tools/changelog.md
env:
TEXT: ${{ steps.changetxt.outputs.text }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changetxt.outputs.text }}
draft: false
prerelease: false
- name: Get Asset name
run: |
export PKG=$(ls dist/)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Create Release Notes
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ The package supports social scientists examining questions such as:
## Installation

The recommended method for installing geosnap is with
[anaconda](https://www.anaconda.com/download/).
[anaconda](https://www.anaconda.com/download/). In particular, we recommend the [mambaforge distribution](https://github.com/conda-forge/miniforge#mambaforge)

```bash
conda install -c conda-forge geosnap
mamba install -c conda-forge geosnap
```

`geosnap` is alaso available on PyPI and can be install with pip via
Expand Down Expand Up @@ -100,7 +100,7 @@ following commands:
```bash
conda env create -f environment.yml
conda activate geosnap
python setup.py develop
pip install -e . --no-deps
```

This will download the appropriate dependencies and install geosnap in its own conda environment.
Expand Down
18 changes: 17 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,25 @@
"sphinx.ext.intersphinx",
"numpydoc",
"matplotlib.sphinxext.plot_directive",
"myst-parser"
]


myst_enable_extensions = [
"amsmath",
"attrs_inline",
"colon_fence",
"deflist",
"dollarmath",
"fieldlist",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
"tasklist",
]

# sphinx_gallery_conf = {
# # path to your examples scripts
Expand Down
4 changes: 1 addition & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- libpysal
- cenpy
- geopandas >=0.9
- matplotlib <=3.3.4 # workaround for proplot missing pin upstream
- matplotlib
- scikit-learn
- seaborn
- pyarrow >=0.14.1
Expand All @@ -18,14 +18,12 @@ dependencies:
- quilt3 >=3.6
- xlrd
- tobler >=0.8.2
- proplot >=0.9
- contextily
- scikit-plot
- mapclassify
- spopt >=0.3.0
- s3fs
- segregation >=2.0
- versioneer
- pyproj >=3
- pandana
- pooch
Loading

0 comments on commit 62cb8e9

Please sign in to comment.