Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into attribute_operators
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWalter committed Feb 18, 2019
2 parents 6d55d66 + bfa614a commit ecaedec
Show file tree
Hide file tree
Showing 58 changed files with 960 additions and 904 deletions.
30 changes: 20 additions & 10 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
## Description
[Please provide a general introduction to the issue/proposal.]

[If reporting a bug, attach the entire traceback from Python.]
[If proposing an enhancement/new feature, provide links to related articles, reference examples, etc.]


## Way to reproduce
[If reporting a bug, please include the following important information:]
- [ ] Code example
- [ ] Relevant images (if any)
- [ ] Operating system and version
- [ ] Python version
- [ ] scikit-image version (run `skimage.__version__`)
```python
# Place the full code we need to recreate your issue here
# upload all necessary images to github too!
```


## Version information
```python
# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print("scikit-image version: {}".format(skimage.__version__))
import numpy; print("numpy version: {}".format(numpy.__version__))
```

```python
# your output here

```

22 changes: 11 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
## Description
[Tell us about your new feature, improvement, or fix! If relevant, please supplement the PR with images.]

<!-- If this is a bug-fix or enhancement, state the issue # it closes -->
<!-- If this is a new feature, reference what paper it implements. -->


## Checklist
[It's fine to submit PRs which are a work in progress! But before they are merged, all PRs should provide:]
- [ ] Clean style in [the spirit of PEP8](https://www.python.org/dev/peps/pep-0008/)

<!-- It's fine to submit PRs which are a work in progress! -->
<!-- But before they are merged, all PRs should provide: -->
- [ ] [Docstrings for all functions](https://github.com/numpy/numpy/blob/master/doc/example.py)
- [ ] Gallery example in `./doc/examples` (new features only)
- [ ] Benchmark in `./benchmarks`, if your changes aren't covered by an
existing benchmark
- [ ] Unit tests
- [ ] Clean style in [the spirit of PEP8](https://www.python.org/dev/peps/pep-0008/)

[For detailed information on these and other aspects see [scikit-image contribution guidelines](https://scikit-image.org/docs/dev/contribute.html)]


## References
[If this is a bug-fix or enhancement, it closes issue # ]
[If this is a new feature, it implements the following paper: ]
<!-- For detailed information on these and other aspects see -->
<!-- the scikit-image contribution guidelines. -->
<!-- https://scikit-image.org/docs/dev/contribute.html -->

## For reviewers

(Don't remove the checklist below.)

<!-- Don't remove the checklist below. -->
- [ ] Check that the PR title is short, concise, and will make sense 1 year
later.
- [ ] Check that new functions are imported in corresponding `__init__.py`.
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ doc/source/auto_examples/**/*
doc/source/_static/random.js
.idea/
*.log
doc/release/_release_notes_for_docs.txt
doc/release/_release_notes_for_docs.rst
doc/gh-pages
wheels
skimage/morphology/_skeletonize_3d_cy.pyx
Expand Down
29 changes: 24 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ addons:
- texlive
- texlive-latex-extra
- dvipng
# this became necessary to use matplotlib and qt5.12
# https://github.com/matplotlib/matplotlib/pull/13412
- qtbase5-dev

env:
global:
Expand All @@ -38,7 +41,7 @@ matrix:
include:
- os: linux
python: 3.5
env: OPTIONAL_DEPS=1 WITH_PYSIDE=1 BUILD_DOCS=1
env: OPTIONAL_DEPS=1 WITH_PYSIDE=1 BUILD_DOCS=1 INSTALL_FROM_SDIST=1
- os: linux
python: 3.5
env: QT=PyQt5 MINIMUM_REQUIREMENTS=1
Expand All @@ -53,19 +56,25 @@ matrix:
dist: xenial # Required for Python 3.7
sudo: true # travis-ci/travis-ci#9069
env: QT=PyQt5 OPTIONAL_DEPS=1 BUILD_DOCS=1
services:
- xvfb
- os: linux
python: 3.6
env: QT=PyQt5 OPTIONAL_DEPS=1 PIP_FLAGS="--pre"
# For smooth deployment, the osx_image here should match
# what we set in the wheel generation travis images.
# If not set, it will use the default version from Travis
# https://docs.travis-ci.com/user/reference/osx/#xcode-version
- os: osx
osx_image: xcode10.1
osx_image: xcode9.4
language: objective-c
env: TRAVIS_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode10.1
osx_image: xcode9.4
language: objective-c
env: TRAVIS_PYTHON_VERSION=3.6 OPTIONAL_DEPS=1
- os: osx
osx_image: xcode10.1
osx_image: xcode9.4
language: objective-c
env: TRAVIS_PYTHON_VERSION=3.7

Expand All @@ -87,8 +96,18 @@ before_install:
- tools/check_sdist.py $SDIST_NAME

install:
- python setup.py develop
- ccache --show-stats
# Test installing without cython using the sdist
# --no-build-isolation ensures even in the presense of a pyproject.toml
# pip will not create a virtual environment, just for building the package
# This is problematic because the version of numpy of that virtual environment
# may be higher than the version we want to test with.
- if [[ $INSTALL_FROM_SDIST ]]; then
pip uninstall cython -y;
pip install dist/scikit-image-*.tar.gz;
else
pip install --no-build-isolation .;
fi
# Install testing requirements
- pip install --retries 3 -q $PIP_FLAGS -r requirements/test.txt
# Matplotlib settings - do not show figures during doc examples
Expand Down
44 changes: 44 additions & 0 deletions CONTRIBUTING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,50 @@ Once you've fixed all merge conflicts, do::
<https://scikit-image.org/docs/dev/gitwash/development_workflow.html#rebasing-on-trunk>`__,
but we squash and merge most PRs either way.

Build environment setup
-----------------------

Once you've cloned your fork of the scikit-image repository,
you should setup a Python development environment tailored for scikit-image.
You may choose the environment manager of your choice.
Here we provide instructions for two popular environment managers:
``venv`` (pip based) and ``conda`` (Anaconda or Miniconda).

venv
====
When using ``venv``, you may find the following bash commands useful::

# Create a virtualenv named ``skimage-dev`` that lives in the directory of
# the same name
python -m venv skimage-dev
# Activate it
source skimage-dev/bin/activate
# Install all development and runtime dependencies of scikit-image
pip install -r <(cat requirements/*.txt)
# Build and install scikit-image from source
pip install -e .
# Test your installation
pytest skimage

conda
=====

When using conda, you may find the following bash commands useful::

# Create a conda environment named ``skimage-dev``
conda create --name skimage-dev
# Activate it
conda activate skimage-dev
# Install major development and runtime dependencies of scikit-image
# (the rest can be installed from conda-forge or pip, if needed)
conda install `for i in requirements/{default,build}.txt; do echo -n " --file $i "; done`
# Install minimal testing dependencies
conda install pytest
# Install scikit-image from source
pip install -e . --no-deps
# Test your installation
pytest skimage

Guidelines
----------

Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,6 @@
- Mark Harfouche
Enabled GIL free operation of many algorithms implemented in Cython.
Maintenance of the build and test infrastructure.

- Taylor D. Scott
Simplified _upsampled_dft and extended register_translation to nD images.
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
include setup*.py
include conftest.py
include MANIFEST.in
include *.txt
include *.rst
recursive-include requirements *.txt
include requirements/README.md
include Makefile
include pyproject.toml
include skimage/scripts/skivi
recursive-include skimage *.pyx *.pxd *.pxi *.py *.c *.h *.ini *.npy *.txt *.in *.cpp *.md
recursive-include skimage/data *
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# scikit-image: Image processing in Python
[![Image.sc forum](https://img.shields.io/badge/dynamic/json.svg?label=forum&url=https%3A%2F%2Fforum.image.sc%2Ftags%2Fscikit-image.json&query=%24.topic_list.tags.0.topic_count&colorB=brightgreen&suffix=%20topics&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAABPklEQVR42m3SyyqFURTA8Y2BER0TDyExZ+aSPIKUlPIITFzKeQWXwhBlQrmFgUzMMFLKZeguBu5y+//17dP3nc5vuPdee6299gohUYYaDGOyyACq4JmQVoFujOMR77hNfOAGM+hBOQqB9TjHD36xhAa04RCuuXeKOvwHVWIKL9jCK2bRiV284QgL8MwEjAneeo9VNOEaBhzALGtoRy02cIcWhE34jj5YxgW+E5Z4iTPkMYpPLCNY3hdOYEfNbKYdmNngZ1jyEzw7h7AIb3fRTQ95OAZ6yQpGYHMMtOTgouktYwxuXsHgWLLl+4x++Kx1FJrjLTagA77bTPvYgw1rRqY56e+w7GNYsqX6JfPwi7aR+Y5SA+BXtKIRfkfJAYgj14tpOF6+I46c4/cAM3UhM3JxyKsxiOIhH0IO6SH/A1Kb1WBeUjbkAAAAAElFTkSuQmCC)](https://forum.image.sc/tags/scikit-image)
[![Stackoverflow](https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg)](https://stackoverflow.com/questions/tagged/scikit-image)
[![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://skimage.zulipchat.com)
[![codecov.io](https://codecov.io/github/scikit-image/scikit-image/coverage.svg?branch=master)](https://codecov.io/github/scikit-image/scikit-image?branch=master)
Expand Down
3 changes: 3 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Version 0.16
* In ``skimage.morphology.remove_small_holes``, remove ``min_size`` argument.
* In ``skimage.filters.median``, change default from ``behavior='rank'`` to
``behavior='ndimage'``.
* Remove ``skimage.transform.seam_carve``, including the source code file, the
import and ``__all__`` listing in ``skimage/transform/__init__.py``, and
the test file in ``skimage/transform/tests``.

Version 0.17
------------
Expand Down
41 changes: 40 additions & 1 deletion benchmarks/benchmark_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# https://asv.readthedocs.io/en/latest/writing_benchmarks.html
import numpy as np
from scipy import ndimage as ndi
from skimage import feature, util
from skimage import feature, util, img_as_float
from skimage.data import binary_blobs


class FeatureSuite:
Expand All @@ -24,3 +25,41 @@ def time_glcm(self):
pi = np.pi
result = feature.greycomatrix(self.image_ubyte, distances=[1, 2],
angles=[0, pi/4, pi/2, 3*pi/4])


class RegisterTranslation:
"""Benchmarks for feature.register_translation in scikit-image"""
param_names = ["ndims", "image_size", "upscale_factor"]
params = [(2, 3), (32, 100), (1, 5, 10)]

def setup(self, ndims, image_size, upscale_factor, *args):
shifts = (-2.3, 1.7, 5.4, -3.2)[:ndims]
phantom = img_as_float(binary_blobs(length=image_size, n_dim=ndims))
self.reference_image = np.fft.fftn(phantom)
self.shifted_image = ndi.fourier_shift(self.reference_image, shifts)

def time_register_translation(self, ndims, image_size, upscale_factor):
result = feature.register_translation(self.reference_image,
self.shifted_image,
upscale_factor,
space="fourier")

def peakmem_reference(self, *args):
"""Provide reference for memory measurement with empty benchmark.
Peakmem benchmarks measure the maximum amount of RAM used by a
function. However, this maximum also includes the memory used
during the setup routine (as of asv 0.2.1; see [1]_).
Measuring an empty peakmem function might allow us to disambiguate
between the memory used by setup and the memory used by target (see
other ``peakmem_`` functions below).
References
----------
.. [1]: https://asv.readthedocs.io/en/stable/writing_benchmarks.html#peak-memory
"""
pass

def peakmem_register_translation(self, ndims, image_size, upscale_factor):
result = feature.register_translation(self.reference_image,
self.shifted_image,
upscale_factor,
space="fourier")
1 change: 1 addition & 0 deletions doc/examples/data/plot_scientific.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
images = ('hubble_deep_field',
'immunohistochemistry',
'moon',
'retina',
)


Expand Down
85 changes: 0 additions & 85 deletions doc/examples/transform/plot_seam_carving.py

This file was deleted.

Loading

0 comments on commit ecaedec

Please sign in to comment.