Skip to content

Commit

Permalink
Merge pull request #137 from XAITK/update-to-v0.7
Browse files Browse the repository at this point in the history
Update to v0.7.
  • Loading branch information
bjrichardwebster authored Jun 19, 2023
2 parents b8b26ff + 98cab12 commit a3ebf59
Show file tree
Hide file tree
Showing 34 changed files with 3,691 additions and 2,386 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-example-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Just one python version, using our base supported version.
container:
image: python:3.7
image: python:3.8
options: "--shm-size 2GB"

# Steps represent a sequence of tasks that will be executed as part of the job
Expand Down Expand Up @@ -72,9 +72,9 @@ jobs:
~/.local
# Using a different key due to additional things the notebook
# examples ad-hoc install.
key: python-3.7-${{ hashFiles('poetry.lock') }}-Examples
key: python-3.8-${{ hashFiles('poetry.lock') }}-Examples
restore-keys: |
python-3.7-${{ hashFiles('poetry.lock') }}
python-3.8-${{ hashFiles('poetry.lock') }}
- name: Setup Environment
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-a-public-action-in-a-subdirectory
Expand All @@ -89,7 +89,7 @@ jobs:
path: |
~/.cache/torch/
examples/data/
key: python-3.7-${{ hashFiles('poetry.lock') }}-ExampleData-${{ matrix.notebook-file }}
key: python-3.8-${{ hashFiles('poetry.lock') }}-ExampleData-${{ matrix.notebook-file }}
# pretty unique, no restore-keys.

- name: Run Notebook
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defaults:
jobs:
lint:
runs-on: ubuntu-latest
container: python:3.7
container: python:3.8
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
Expand All @@ -45,7 +45,7 @@ jobs:
path: |
~/.cache/pypoetry/virtualenvs/
~/.local
key: python-3.7-${{ hashFiles('poetry.lock') }}
key: python-3.8-${{ hashFiles('poetry.lock') }}
- name: Setup Environment
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-a-public-action-in-a-subdirectory
uses: Kitware/SMQTK-Core/.github/actions/python-poetry-setup@master
Expand All @@ -54,7 +54,7 @@ jobs:

typecheck:
runs-on: ubuntu-latest
container: python:3.7
container: python:3.8
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
Expand All @@ -71,7 +71,7 @@ jobs:
path: |
~/.cache/pypoetry/virtualenvs/
~/.local
key: python-3.7-${{ hashFiles('poetry.lock') }}
key: python-3.8-${{ hashFiles('poetry.lock') }}
- name: Setup Environment
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-a-public-action-in-a-subdirectory
uses: Kitware/SMQTK-Core/.github/actions/python-poetry-setup@master
Expand All @@ -82,7 +82,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8","3.9","3.10","3.11"]
# Extras for included, optional plugin support (space-separated lists)
opt-extra: [
"", # no extras
Expand Down Expand Up @@ -128,8 +128,9 @@ jobs:
run: poetry run pytest

- name: CodeCov report submission
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: coverage.xml
flags: unittests
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defaults:
jobs:
publish:
runs-on: ubuntu-latest
container: python:3.7
container: python:3.8
# This should only be run for tags on the "official" repository org.
if: github.repository_owner == 'XAITK'
steps:
Expand All @@ -41,7 +41,7 @@ jobs:
path: |
~/.cache/pypoetry/virtualenvs/
~/.local
key: python-3.7-${{ hashFiles('poetry.lock') }}
key: python-3.8-${{ hashFiles('poetry.lock') }}

- name: Setup Environment
# Using non-relative path for correct behavior when used as a remote
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
formats:
- pdf
python:
version: 3.7
version: 3.8
install:
- requirements: docs/readthedocs-reqs.txt
- method: pip
Expand Down
2 changes: 1 addition & 1 deletion docs/readthedocs-reqs.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Additional requirements for building our documentation in read-the-docs build
sphinx-prompt==1.4.0
sphinx-prompt
1 change: 1 addition & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Release Notes
release_notes/v0.5.0
release_notes/v0.6.0
release_notes/v0.6.1
release_notes/v0.7.0
44 changes: 44 additions & 0 deletions docs/release_notes/v0.7.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
v0.7.0
======

This minor release updates the mimumum supported python to `python = "^3.8"`, addresses dependency vulnerabilities, and updates typing to conform with current mypy and pytest standards.

Updates / New Features
----------------------

Build

* New minimum supported python changed to `python = "^3.8"`.

CI

* Updated codecov action version to 3.

* Added explicit use of codecov token to facilitate successful coverage
submission.

Dependencies

* Updated ``notebook`` dependency due to a vulnerability alert.

* Periodic update of locked dep versions within abstract version constraints.

* Updated sphinx versions to fix local documentation building issue.

* Updated python minimum requirement to 3.8 (up from 3.6). This involved a
number of updates and bifurcations of abstract requirements, an update to
pinned versions for development/CI, and expansion of CI to cover python
versions 3.10 and 3.11 (latest current release).

Fixes
-----

Docs

* Added missing step to the release process about creating the release on
GitHub's Releases section.

Examples

* Added a note to each example about restarting the runtime for compatibility
with Colab, as well as a step to create a data directory if necessary.
39 changes: 27 additions & 12 deletions docs/release_process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ and functionalities.
$ git merge --log --no-ff upstream/release
$ git push upstream master
7. Update version reference in the `XAITK/xaitk.github.io home page`_ to the
8. `Draft a new release on GitHub`_ for the new version.

9. Update version reference in the `XAITK/xaitk.github.io home page`_ to the
new version.

Patch Release
Expand Down Expand Up @@ -120,7 +122,9 @@ If a patch release for an older release version is being created, see the
$ git merge --log --no-ff upstream/release
$ git push upstream master
8. If this patch release now represents the highest version of the package,
8. `Draft a new release on GitHub`_ for the new version.

9. If this patch release now represents the highest version of the package,
update version reference in the `XAITK/xaitk.github.io home page`_ to the
new version.

Expand Down Expand Up @@ -159,22 +163,33 @@ current package version.
.. code-block:: bash
$ git checkout HASH
# VERSION="v$(poetry version -s)"
$ VERSION="v$(poetry version -s)"
$ git tag -a "$VERSION" -F docs/release_notes/"$VERSION".rst
$ git push UPSTREAM "$VERSION"
Draft a new release on Github
-----------------------------
After creating and pushing a new version tag, a GitHub "release" should be
made.
Navigate to the `releases page on GitHub`_ and click the ``Draft a new
release`` button in the upper right.
The newly added tag should be selected in the "Choose a tag" drop-down.
The "Release Title" should be the version tag (i.e. "v#.#.#").
Copy and paste this version's release notes into the ``Describe this release``
text box.
Remember to check the ``This is a pre-release`` check-box if appropriate.
Click the ``Public release`` button at the bottom of the page when complete.

a. Navigate to the GitHub `Releases page`_ for the xaitk-saliency repository.

b. Click the "Draft a new release" button (or go `here
<https://github.com/XAITK/xaitk-saliency/releases/new>`_).

c. Select from the "Choose a tag" drop down the tag version just created and
pushed

d. Enter the version number as the title, e.g. "v1.2.3".

e. Copy and paste the release notes for this version into the description
field.

f. Select the "This is a pre-release" check-box if applicable.

g. Click the "Publish Release" button to create the GitHub release!


.. _Poetry's version command: https://python-poetry.org/docs/cli/#version
.. _releases page on GitHub: https://github.com/XAITK/xaitk-saliency/releases
.. _Releases page: https://github.com/XAITK/xaitk-saliency/releases
.. _XAITK/xaitk.github.io home page: https://github.com/XAITK/xaitk.github.io/edit/master/_pages/home.md#L12
7 changes: 5 additions & 2 deletions examples/DRISE.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"id": "9db07c5f",
"metadata": {},
"source": [
"# Set Up Environment"
"# Set Up Environment\n",
"**Note for Colab users**: after setting up the environment, you may need to \"Restart Runtime\" in order to resolve package version conflicts (see the [README](https://github.com/XAITK/xaitk-saliency/blob/master/examples/README.md#run-the-notebooks-from-colab) for more info)."
]
},
{
Expand Down Expand Up @@ -102,6 +103,7 @@
}
],
"source": [
"import os\n",
"import PIL.Image\n",
"import matplotlib.pyplot as plt\n",
"import urllib.request\n",
Expand All @@ -112,6 +114,7 @@
"\n",
"\n",
"# Test image to be explained\n",
"os.makedirs('data', exist_ok=True)\n",
"test_image_filename = 'data/catdog.jpg'\n",
"urllib.request.urlretrieve('https://farm1.staticflickr.com/74/202734059_fcce636dcd_z.jpg', test_image_filename)\n",
"plt.figure(figsize=(12, 8))\n",
Expand Down Expand Up @@ -255,7 +258,7 @@
"blackbox_detector = ResNetFRCNN(\n",
" box_thresh=0.05,\n",
" img_batch_size=1,\n",
" use_cuda=True\n",
" use_cuda=False\n",
")\n",
"\n",
"model_mean = [0.485, 0.456, 0.406]\n",
Expand Down
3 changes: 2 additions & 1 deletion examples/MNIST_scikit_saliency.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
},
"source": [
"# MNIST Dataset Example <a name=\"MNIST-Dataset-Example-mnist\"></a>\n",
"## Set Up Environment <a name=\"Set-Up-Environment-mnist\"></a>"
"## Set Up Environment <a name=\"Set-Up-Environment-mnist\"></a>\n",
"**Note for Colab users**: after setting up the environment, you may need to \"Restart Runtime\" in order to resolve package version conflicts (see the [README](https://github.com/XAITK/xaitk-saliency/blob/master/examples/README.md#run-the-notebooks-from-colab) for more info)."
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions examples/ModelComparisonWithSaliency.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"source": [
"## Setup Environment\n",
"\n",
"Here we install `xaitk-saliency` and the \"centernet\" extra for `smqtk-detection` which includes the dependencies for the PyTorch-based `CenterNetVisdrone` class."
"Here we install `xaitk-saliency` and the \"centernet\" extra for `smqtk-detection` which includes the dependencies for the PyTorch-based `CenterNetVisdrone` class.\n",
"\n",
"**Note for Colab users**: after setting up the environment, you may need to \"Restart Runtime\" in order to resolve package version conflicts (see the [README](https://github.com/XAITK/xaitk-saliency/blob/master/examples/README.md#run-the-notebooks-from-colab) for more info)."
]
},
{
Expand Down Expand Up @@ -404,7 +406,6 @@
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import urllib\n",
"\n",
"from smqtk_detection.impls.detect_image_objects.centernet import CenterNetVisdrone\n",
Expand Down
28 changes: 20 additions & 8 deletions examples/OcclusionSaliency.ipynb

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions examples/Radial_Image_Perturbation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,30 @@
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/XAITK/xaitk-saliency/blob/master/examples/Radial_Image_Perturbation.ipynb)"
]
},
{
"cell_type": "markdown",
"id": "9f91a2fd",
"metadata": {},
"source": [
"# Set Up Environment\n",
"**Note for Colab users**: after setting up the environment, you may need to \"Restart Runtime\" in order to resolve package version conflicts (see the [README](https://github.com/XAITK/xaitk-saliency/blob/master/examples/README.md#run-the-notebooks-from-colab) for more info)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "f129287c",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"# Python dependencies\n",
"!{sys.executable} -m pip install -qU pip\n",
"!{sys.executable} -m pip install -q xaitk-saliency\n",
"\n",
"# Data dependencies\n",
"os.makedirs('data', exist_ok=True)\n",
"image_filepath = \"data/Grace_Hopper.jpg\"\n",
"![ ! -f \"{image_filepath}\" ] && wget https://upload.wikimedia.org/wikipedia/commons/5/55/Grace_Hopper.jpg -O {image_filepath}"
]
Expand Down
18 changes: 15 additions & 3 deletions examples/SerializedDetectionSaliency.ipynb

Large diffs are not rendered by default.

25 changes: 17 additions & 8 deletions examples/SimilarityScoring.ipynb

Large diffs are not rendered by default.

74 changes: 43 additions & 31 deletions examples/SuperPixelSaliency.ipynb

Large diffs are not rendered by default.

23 changes: 19 additions & 4 deletions examples/VIAME_OcclusionSaliency.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit a3ebf59

Please sign in to comment.