From 6a6e22e008cb73ca9b058b7683c31f0f8136a96e Mon Sep 17 00:00:00 2001 From: Cyrille Rossant Date: Wed, 23 Nov 2016 13:03:52 +0100 Subject: [PATCH] WIP: move cluster.manual to cluster --- MANIFEST.in | 2 +- README.md | 2 +- docs/{cluster-manual.md => clustering.md} | 4 ++-- mkdocs.yml | 2 +- phy/cluster/__init__.py | 7 +++++-- phy/cluster/{manual => }/_history.py | 0 phy/cluster/{manual => }/_utils.py | 0 phy/cluster/{manual => }/clustering.py | 0 phy/cluster/{manual => }/controller.py | 16 ++++++++-------- phy/cluster/{manual => }/gui_component.py | 0 phy/cluster/manual/__init__.py | 9 --------- phy/cluster/manual/tests/__init__.py | 0 phy/cluster/{manual => }/tests/conftest.py | 2 +- .../{manual => }/tests/test_clustering.py | 0 .../{manual => }/tests/test_controller.py | 0 .../{manual => }/tests/test_gui_component.py | 0 phy/cluster/{manual => }/tests/test_history.py | 0 phy/cluster/{manual => }/tests/test_utils.py | 0 phy/cluster/{manual => }/tests/test_views.py | 0 phy/cluster/{manual => }/views.py | 0 tools/api.py | 1 - 21 files changed, 19 insertions(+), 26 deletions(-) rename docs/{cluster-manual.md => clustering.md} (97%) rename phy/cluster/{manual => }/_history.py (100%) rename phy/cluster/{manual => }/_utils.py (100%) rename phy/cluster/{manual => }/clustering.py (100%) rename phy/cluster/{manual => }/controller.py (97%) rename phy/cluster/{manual => }/gui_component.py (100%) delete mode 100644 phy/cluster/manual/__init__.py delete mode 100644 phy/cluster/manual/tests/__init__.py rename phy/cluster/{manual => }/tests/conftest.py (98%) rename phy/cluster/{manual => }/tests/test_clustering.py (100%) rename phy/cluster/{manual => }/tests/test_controller.py (100%) rename phy/cluster/{manual => }/tests/test_gui_component.py (100%) rename phy/cluster/{manual => }/tests/test_history.py (100%) rename phy/cluster/{manual => }/tests/test_utils.py (100%) rename phy/cluster/{manual => }/tests/test_views.py (100%) rename phy/cluster/{manual => }/views.py (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 35bff6167..459611960 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,7 @@ recursive-include tests * recursive-include phy/electrode/probes *.prb recursive-include phy/plot/glsl *.vert *.frag *.glsl recursive-include phy/plot/static *.npy *.gz *.txt -recursive-include phy/cluster/manual/static *.html *.css +recursive-include phy/cluster/static *.html *.css recursive-include phy/gui/static *.html *.css *.js recursive-exclude * __pycache__ recursive-exclude * *.py[co] diff --git a/README.md b/README.md index ca9a633cb..aa60df3b6 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ **phy** contains the following subpackages: -* **phy.cluster.manual**: an API for manual sorting, used to create graphical interfaces for neurophysiological data +* **phy.cluster**: an API for manual sorting, used to create graphical interfaces for neurophysiological data * **phy.gui**: a generic API for creating desktop applications with PyQt. * **phy.plot**: a generic API for creating high-performance plots with VisPy (using the graphics processor via OpenGL) diff --git a/docs/cluster-manual.md b/docs/clustering.md similarity index 97% rename from docs/cluster-manual.md rename to docs/clustering.md index d272bf26f..0f646634a 100644 --- a/docs/cluster-manual.md +++ b/docs/clustering.md @@ -1,6 +1,6 @@ # Manual clustering -The `phy.cluster.manual` package provides manual clustering routines. The components can be used independently in a modular way. +The `phy.cluster` package provides manual clustering routines. The components can be used independently in a modular way. ## Clustering @@ -84,7 +84,7 @@ The `ClusterMeta` class implement the logic of assigning metadata to every clust Here is an example. ```python ->>> from phy.cluster.manual import ClusterMeta +>>> from phy.cluster import ClusterMeta >>> cm = ClusterMeta() ``` diff --git a/mkdocs.yml b/mkdocs.yml index a666d57e0..42e1d2d78 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,7 +3,7 @@ pages: - Home: 'index.md' - GUI: 'gui.md' - Plotting: 'plot.md' -- Manual clustering: 'cluster-manual.md' +- Manual clustering: 'clustering.md' - Configuration and plugin system: 'config.md' - Command-line interface: 'cli.md' theme: readthedocs diff --git a/phy/cluster/__init__.py b/phy/cluster/__init__.py index 2df738347..d6b871021 100644 --- a/phy/cluster/__init__.py +++ b/phy/cluster/__init__.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- # flake8: noqa -"""Automatic and manual clustering facilities.""" +"""Manual clustering facilities.""" -from . import manual +from ._utils import ClusterMeta +from .clustering import Clustering +from .gui_component import ManualClustering +from .views import WaveformView, TraceView, FeatureView, CorrelogramView diff --git a/phy/cluster/manual/_history.py b/phy/cluster/_history.py similarity index 100% rename from phy/cluster/manual/_history.py rename to phy/cluster/_history.py diff --git a/phy/cluster/manual/_utils.py b/phy/cluster/_utils.py similarity index 100% rename from phy/cluster/manual/_utils.py rename to phy/cluster/_utils.py diff --git a/phy/cluster/manual/clustering.py b/phy/cluster/clustering.py similarity index 100% rename from phy/cluster/manual/clustering.py rename to phy/cluster/clustering.py diff --git a/phy/cluster/manual/controller.py b/phy/cluster/controller.py similarity index 97% rename from phy/cluster/manual/controller.py rename to phy/cluster/controller.py index 376b573c1..637a0a15e 100644 --- a/phy/cluster/manual/controller.py +++ b/phy/cluster/controller.py @@ -11,14 +11,14 @@ import numpy as np -from phy.cluster.manual.gui_component import ManualClustering -from phy.cluster.manual.views import (WaveformView, - TraceView, - FeatureView, - CorrelogramView, - select_traces, - extract_spikes, - ) +from phy.cluster.gui_component import ManualClustering +from phy.cluster.views import (WaveformView, + TraceView, + FeatureView, + CorrelogramView, + select_traces, + extract_spikes, + ) from phy.gui import GUI from phy.io.array import _get_data_lim, concat_per_cluster, get_excerpts from phy.io import Context, Selector diff --git a/phy/cluster/manual/gui_component.py b/phy/cluster/gui_component.py similarity index 100% rename from phy/cluster/manual/gui_component.py rename to phy/cluster/gui_component.py diff --git a/phy/cluster/manual/__init__.py b/phy/cluster/manual/__init__.py deleted file mode 100644 index d6b871021..000000000 --- a/phy/cluster/manual/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# flake8: noqa - -"""Manual clustering facilities.""" - -from ._utils import ClusterMeta -from .clustering import Clustering -from .gui_component import ManualClustering -from .views import WaveformView, TraceView, FeatureView, CorrelogramView diff --git a/phy/cluster/manual/tests/__init__.py b/phy/cluster/manual/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/phy/cluster/manual/tests/conftest.py b/phy/cluster/tests/conftest.py similarity index 98% rename from phy/cluster/manual/tests/conftest.py rename to phy/cluster/tests/conftest.py index fec5e3922..822426619 100644 --- a/phy/cluster/manual/tests/conftest.py +++ b/phy/cluster/tests/conftest.py @@ -10,7 +10,7 @@ import numpy as np -from phy.cluster.manual.controller import Controller +from phy.cluster.controller import Controller from phy.electrode.mea import staggered_positions from phy.io.array import (get_closest_clusters, _spikes_in_clusters, diff --git a/phy/cluster/manual/tests/test_clustering.py b/phy/cluster/tests/test_clustering.py similarity index 100% rename from phy/cluster/manual/tests/test_clustering.py rename to phy/cluster/tests/test_clustering.py diff --git a/phy/cluster/manual/tests/test_controller.py b/phy/cluster/tests/test_controller.py similarity index 100% rename from phy/cluster/manual/tests/test_controller.py rename to phy/cluster/tests/test_controller.py diff --git a/phy/cluster/manual/tests/test_gui_component.py b/phy/cluster/tests/test_gui_component.py similarity index 100% rename from phy/cluster/manual/tests/test_gui_component.py rename to phy/cluster/tests/test_gui_component.py diff --git a/phy/cluster/manual/tests/test_history.py b/phy/cluster/tests/test_history.py similarity index 100% rename from phy/cluster/manual/tests/test_history.py rename to phy/cluster/tests/test_history.py diff --git a/phy/cluster/manual/tests/test_utils.py b/phy/cluster/tests/test_utils.py similarity index 100% rename from phy/cluster/manual/tests/test_utils.py rename to phy/cluster/tests/test_utils.py diff --git a/phy/cluster/manual/tests/test_views.py b/phy/cluster/tests/test_views.py similarity index 100% rename from phy/cluster/manual/tests/test_views.py rename to phy/cluster/tests/test_views.py diff --git a/phy/cluster/manual/views.py b/phy/cluster/views.py similarity index 100% rename from phy/cluster/manual/views.py rename to phy/cluster/views.py diff --git a/tools/api.py b/tools/api.py index 9da1d9057..b4e340eb0 100644 --- a/tools/api.py +++ b/tools/api.py @@ -315,7 +315,6 @@ def generate_api_doc(package, subpackages, path=None): package = 'phy' subpackages = [ 'cluster', - 'cluster.manual', 'electrode', 'gui', 'io',