Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up top-level namespace #2224

Merged
merged 2 commits into from
Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions holoviews/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
reponame="holoviews"))

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.dimension import OrderedDict, Dimension # noqa (API import)
from .core.element import Element, Collator # noqa (API import)
from .core.layout import (Layout, NdLayout, Empty, # noqa (API import)
AdjointLayout)
from .core.ndmapping import NdMapping # 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)
from .core.overlay import Overlay, NdOverlay # noqa (API import)
from .core.spaces import (HoloMap, Callable, DynamicMap, # noqa (API import)
GridSpace, GridMatrix)

Expand Down Expand Up @@ -82,3 +83,7 @@ def help(obj, visualization=True, ansi=True, backend=None,
print((msg if visualization is False else '') + info)
else:
pydoc.help(obj)


del (absolute_import, code, f, filename, np, os, print_function, pydoc,
rcfile, warnings)
6 changes: 6 additions & 0 deletions holoviews/core/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, **kwargs):
"""
Expand Down Expand Up @@ -261,13 +263,17 @@ class Element2D(Element):
Allows overriding the extents of the Element in 2D space defined
as four-tuple defining the (left, bottom, right and top) edges.""")

__abstract = True


class Element3D(Element2D):

extents = param.Tuple(default=(None, None, None, None, None, None), doc="""
Allows overriding the extents of the Element in 3D space
defined as (xmin, ymin, zmin, xmax, ymax, zmax).""")

__abstract = True


class Collator(NdMapping):
"""
Expand Down
2 changes: 1 addition & 1 deletion holoviews/core/ndmapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ class UniformNdMapping(NdMapping):

data_type = (ViewableElement, NdMapping)

_abstract = True
__abstract = True
_deep_indexable = True
_auxiliary_component = False

Expand Down
2 changes: 1 addition & 1 deletion holoviews/element/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def table(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)

Expand Down
6 changes: 4 additions & 2 deletions holoviews/tests/core/testoptions.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down