From b1a9776943293d1f835a7eef4ad73e13633f2ca3 Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Thu, 21 Dec 2017 13:04:01 +0000
Subject: [PATCH] Cleaned up top-level namespace
---
holoviews/__init__.py | 10 ++++------
holoviews/core/element.py | 6 ++++++
holoviews/core/ndmapping.py | 2 +-
holoviews/element/__init__.py | 2 +-
tests/core/testoptions.py | 6 ++++--
5 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/holoviews/__init__.py b/holoviews/__init__.py
index 55da68cf2d..3ab691950d 100644
--- a/holoviews/__init__.py
+++ b/holoviews/__init__.py
@@ -17,13 +17,11 @@
from .core import archive, config # noqa (API import)
from .core.dimension import OrderedDict, Dimension # noqa (API import)
-from .core.boundingregion import BoundingBox # noqa (API import)
from .core.options import (Options, Store, Cycle, # noqa (API import)
- Palette, StoreOptions)
-from .core.layout import * # noqa (API import)
-from .core.element import * # noqa (API import)
-from .core.overlay import * # noqa (API import)
-from .core.tree import * # noqa (API import)
+ Palette)
+from .core.layout import Layout, NdLayout, AdjointLayout # noqa (API import)
+from .core.element import Collator # noqa (API import)
+from .core.overlay import Overlay, NdOverlay # noqa (API import)
from .core.spaces import (HoloMap, Callable, DynamicMap, # noqa (API import)
GridSpace, GridMatrix)
diff --git a/holoviews/core/element.py b/holoviews/core/element.py
index ee6a68376f..7c702d1da5 100644
--- a/holoviews/core/element.py
+++ b/holoviews/core/element.py
@@ -22,6 +22,8 @@ class Element(ViewableElement, Composable, Overlayable):
group = param.String(default='Element', constant=True)
+ __abstract = True
+
def hist(self, dimension=None, num_bins=20, bin_range=None,
adjoin=True, individually=True, **kwargs):
"""
@@ -262,6 +264,8 @@ class Element2D(Element):
of the Element in 2D space defined as four-tuple
defining the (left, bottom, right and top) edges.""")
+ __abstract = True
+
class Element3D(Element2D):
@@ -271,6 +275,8 @@ class Element3D(Element2D):
in 3D space defined as (xmin, ymin, zmin,
xmax, ymax, zmax).""")
+ __abstract = True
+
class Collator(NdMapping):
"""
diff --git a/holoviews/core/ndmapping.py b/holoviews/core/ndmapping.py
index fa59fb2fed..4b5236714c 100644
--- a/holoviews/core/ndmapping.py
+++ b/holoviews/core/ndmapping.py
@@ -719,7 +719,7 @@ class UniformNdMapping(NdMapping):
data_type = (ViewableElement, NdMapping)
- _abstract = True
+ __abstract = True
_deep_indexable = True
_auxiliary_component = False
diff --git a/holoviews/element/__init__.py b/holoviews/element/__init__.py
index 27fb2783eb..d1772b7515 100644
--- a/holoviews/element/__init__.py
+++ b/holoviews/element/__init__.py
@@ -91,7 +91,7 @@ def vectorfield(self, kdims=None, vdims=None, groupby=None, **kwargs):
def public(obj):
- if not isinstance(obj, type) or getattr(obj, 'abstract', False):
+ if not isinstance(obj, type) or getattr(obj, 'abstract', False) and not obj is Element:
return False
return issubclass(obj, Element)
diff --git a/tests/core/testoptions.py b/tests/core/testoptions.py
index 71e1908d33..9b5a90c01c 100644
--- a/tests/core/testoptions.py
+++ b/tests/core/testoptions.py
@@ -1,8 +1,10 @@
import os
import pickle
import numpy as np
-from holoviews import Store, StoreOptions, Histogram, Image
-from holoviews.core.options import OptionError, Cycle, Options, OptionTree, options_policy
+from holoviews import Store, Histogram, Image
+from holoviews.core.options import (
+ OptionError, Cycle, Options, OptionTree, StoreOptions, options_policy
+)
from holoviews.element.comparison import ComparisonTestCase
from holoviews import plotting # noqa Register backends
from unittest import SkipTest