From 13caa41fa73174f882c33c70144a87a431201c9f Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Thu, 2 Aug 2012 22:49:53 -0400 Subject: [PATCH 1/3] BUG: Rename modules with duplicate function names. Modules with functions of the same name can cause confusion (in general) and causes issues when running `nosetests --with-doctest`. --- skimage/filter/__init__.py | 6 +++--- skimage/filter/{canny.py => _canny.py} | 0 skimage/filter/{rank_order.py => _rank_order.py} | 0 skimage/filter/{tv_denoise.py => _tv_denoise.py} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename skimage/filter/{canny.py => _canny.py} (100%) rename skimage/filter/{rank_order.py => _rank_order.py} (100%) rename skimage/filter/{tv_denoise.py => _tv_denoise.py} (100%) diff --git a/skimage/filter/__init__.py b/skimage/filter/__init__.py index 04c972cc..bdbbb531 100644 --- a/skimage/filter/__init__.py +++ b/skimage/filter/__init__.py @@ -1,7 +1,7 @@ from .lpi_filter import * from .ctmf import median_filter -from .canny import canny +from ._canny import canny from .edges import sobel, hsobel, vsobel, hprewitt, vprewitt, prewitt -from .tv_denoise import tv_denoise -from .rank_order import rank_order +from ._tv_denoise import tv_denoise +from ._rank_order import rank_order from .thresholding import threshold_otsu, threshold_adaptive diff --git a/skimage/filter/canny.py b/skimage/filter/_canny.py similarity index 100% rename from skimage/filter/canny.py rename to skimage/filter/_canny.py diff --git a/skimage/filter/rank_order.py b/skimage/filter/_rank_order.py similarity index 100% rename from skimage/filter/rank_order.py rename to skimage/filter/_rank_order.py diff --git a/skimage/filter/tv_denoise.py b/skimage/filter/_tv_denoise.py similarity index 100% rename from skimage/filter/tv_denoise.py rename to skimage/filter/_tv_denoise.py From 8a340cc47dbe7674b10810a9d12661c58b67083d Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Thu, 2 Aug 2012 23:08:19 -0400 Subject: [PATCH 2/3] BUG: more module renaming to prevent duplicates. --- skimage/feature/__init__.py | 4 ++-- skimage/feature/{harris.py => _harris.py} | 0 skimage/feature/{hog.py => _hog.py} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename skimage/feature/{harris.py => _harris.py} (100%) rename skimage/feature/{hog.py => _hog.py} (100%) diff --git a/skimage/feature/__init__.py b/skimage/feature/__init__.py index 70c154b8..c067268a 100644 --- a/skimage/feature/__init__.py +++ b/skimage/feature/__init__.py @@ -1,5 +1,5 @@ -from .hog import hog +from ._hog import hog from .greycomatrix import greycomatrix, greycoprops from .peak import peak_local_max -from .harris import harris +from ._harris import harris from .template import match_template diff --git a/skimage/feature/harris.py b/skimage/feature/_harris.py similarity index 100% rename from skimage/feature/harris.py rename to skimage/feature/_harris.py diff --git a/skimage/feature/hog.py b/skimage/feature/_hog.py similarity index 100% rename from skimage/feature/hog.py rename to skimage/feature/_hog.py From 1ea41173b821124e2836e6731ff3d32f98c6e542 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Thu, 16 Aug 2012 22:42:27 -0400 Subject: [PATCH 3/3] BUG: Rename files with similar function, python module, and cython extension names. --- skimage/feature/__init__.py | 2 +- skimage/feature/{greycomatrix.py => _greycomatrix.py} | 2 +- skimage/feature/{_greycomatrix.pyx => _greycomatrix_cy.pyx} | 0 skimage/feature/setup.py | 4 ++-- skimage/morphology/__init__.py | 2 +- skimage/morphology/{skeletonize.py => _skeletonize.py} | 2 +- skimage/morphology/{_skeletonize.pyx => _skeletonize_cy.pyx} | 0 skimage/morphology/setup.py | 4 ++-- 8 files changed, 8 insertions(+), 8 deletions(-) rename skimage/feature/{greycomatrix.py => _greycomatrix.py} (99%) rename skimage/feature/{_greycomatrix.pyx => _greycomatrix_cy.pyx} (100%) rename skimage/morphology/{skeletonize.py => _skeletonize.py} (99%) rename skimage/morphology/{_skeletonize.pyx => _skeletonize_cy.pyx} (100%) diff --git a/skimage/feature/__init__.py b/skimage/feature/__init__.py index c067268a..eb98945c 100644 --- a/skimage/feature/__init__.py +++ b/skimage/feature/__init__.py @@ -1,5 +1,5 @@ from ._hog import hog -from .greycomatrix import greycomatrix, greycoprops +from ._greycomatrix import greycomatrix, greycoprops from .peak import peak_local_max from ._harris import harris from .template import match_template diff --git a/skimage/feature/greycomatrix.py b/skimage/feature/_greycomatrix.py similarity index 99% rename from skimage/feature/greycomatrix.py rename to skimage/feature/_greycomatrix.py index 5b2b92db..0926117b 100644 --- a/skimage/feature/greycomatrix.py +++ b/skimage/feature/_greycomatrix.py @@ -5,7 +5,7 @@ properties to characterize image textures. import numpy as np -from ._greycomatrix import _glcm_loop +from ._greycomatrix_cy import _glcm_loop def greycomatrix(image, distances, angles, levels=256, symmetric=False, diff --git a/skimage/feature/_greycomatrix.pyx b/skimage/feature/_greycomatrix_cy.pyx similarity index 100% rename from skimage/feature/_greycomatrix.pyx rename to skimage/feature/_greycomatrix_cy.pyx diff --git a/skimage/feature/setup.py b/skimage/feature/setup.py index 39358fd3..2c50a592 100644 --- a/skimage/feature/setup.py +++ b/skimage/feature/setup.py @@ -12,10 +12,10 @@ def configuration(parent_package='', top_path=None): config = Configuration('feature', parent_package, top_path) config.add_data_dir('tests') - cython(['_greycomatrix.pyx'], working_path=base_path) + cython(['_greycomatrix_cy.pyx'], working_path=base_path) cython(['_template.pyx'], working_path=base_path) - config.add_extension('_greycomatrix', sources=['_greycomatrix.c'], + config.add_extension('_greycomatrix_cy', sources=['_greycomatrix_cy.c'], include_dirs=[get_numpy_include_dirs()]) config.add_extension('_template', sources=['_template.c'], include_dirs=[get_numpy_include_dirs()]) diff --git a/skimage/morphology/__init__.py b/skimage/morphology/__init__.py index d639be1c..abc9986f 100644 --- a/skimage/morphology/__init__.py +++ b/skimage/morphology/__init__.py @@ -2,5 +2,5 @@ from .grey import * from .selem import * from .ccomp import label from .watershed import watershed, is_local_maximum -from .skeletonize import skeletonize, medial_axis +from ._skeletonize import skeletonize, medial_axis from .convex_hull import convex_hull_image diff --git a/skimage/morphology/skeletonize.py b/skimage/morphology/_skeletonize.py similarity index 99% rename from skimage/morphology/skeletonize.py rename to skimage/morphology/_skeletonize.py index a8d31bdd..58842c6d 100644 --- a/skimage/morphology/skeletonize.py +++ b/skimage/morphology/_skeletonize.py @@ -5,7 +5,7 @@ Algorithms for computing the skeleton of a binary image import numpy as np from scipy import ndimage -from ._skeletonize import _skeletonize_loop, _table_lookup_index +from ._skeletonize_cy import _skeletonize_loop, _table_lookup_index # --------- Skeletonization by morphological thinning --------- diff --git a/skimage/morphology/_skeletonize.pyx b/skimage/morphology/_skeletonize_cy.pyx similarity index 100% rename from skimage/morphology/_skeletonize.pyx rename to skimage/morphology/_skeletonize_cy.pyx diff --git a/skimage/morphology/setup.py b/skimage/morphology/setup.py index fcf33f7f..2dd4a378 100644 --- a/skimage/morphology/setup.py +++ b/skimage/morphology/setup.py @@ -15,7 +15,7 @@ def configuration(parent_package='', top_path=None): cython(['ccomp.pyx'], working_path=base_path) cython(['cmorph.pyx'], working_path=base_path) cython(['_watershed.pyx'], working_path=base_path) - cython(['_skeletonize.pyx'], working_path=base_path) + cython(['_skeletonize_cy.pyx'], working_path=base_path) cython(['_pnpoly.pyx'], working_path=base_path) cython(['_convex_hull.pyx'], working_path=base_path) @@ -25,7 +25,7 @@ def configuration(parent_package='', top_path=None): include_dirs=[get_numpy_include_dirs()]) config.add_extension('_watershed', sources=['_watershed.c'], include_dirs=[get_numpy_include_dirs()]) - config.add_extension('_skeletonize', sources=['_skeletonize.c'], + config.add_extension('_skeletonize_cy', sources=['_skeletonize_cy.c'], include_dirs=[get_numpy_include_dirs()]) config.add_extension('_pnpoly', sources=['_pnpoly.c'], include_dirs=[get_numpy_include_dirs()])