Skip to content

Commit

Permalink
Merge pull request #101 from DanRyanIrish/ndcube_base_noplot
Browse files Browse the repository at this point in the history
Separate plotting from NDCube base class
  • Loading branch information
DanRyanIrish authored Mar 28, 2018
2 parents 29fd70e + 297d342 commit 495711e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

New Features
------------
- Added installation instructions to docs. [#77]
- Created a new `~ndcube.NDCubeBase` which has all the functionality
of `~ncube.NDCube` except the plotting. The old ``NDCubeBase``
which outlined the ``NDCube`` API was renamed ``NDCubeABC``.
`~ndcube.NDCube` has all the same functionality as before except is
now simply inherits from `~ndcube.NDCubeBase` and
`~ndcube.mixins.plotting.NDCubePlotMixin`.

API Changes
-----------
Expand All @@ -18,9 +23,13 @@ Bug Fixes
---------


1.0.1 (Unreleased)
1.0.1
==================

New Features
------------
- Added installation instructions to docs. [#77]

Bug Fixes
---------
- Fixed bugs in ``NDCubeSequence`` slicing and
Expand Down
10 changes: 7 additions & 3 deletions ndcube/ndcube.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ndcube.mixins import NDCubeSlicingMixin, NDCubePlotMixin


__all__ = ['NDCubeBase', 'NDCube', 'NDCubeOrdered']
__all__ = ['NDCubeABC', 'NDCubeBase', 'NDCube', 'NDCubeOrdered']


class NDCubeMetaClass(abc.ABCMeta, InheritDocstrings):
Expand All @@ -21,7 +21,7 @@ class NDCubeMetaClass(abc.ABCMeta, InheritDocstrings):
"""


class NDCubeBase(astropy.nddata.NDData, metaclass=NDCubeMetaClass):
class NDCubeABC(astropy.nddata.NDData, metaclass=NDCubeMetaClass):

@abc.abstractmethod
def pixel_to_world(self, *quantity_axis_list):
Expand Down Expand Up @@ -109,7 +109,7 @@ def crop_by_coords(self, min_coord_values, interval_widths):
"""


class NDCube(NDCubeSlicingMixin, NDCubePlotMixin, astropy.nddata.NDArithmeticMixin, NDCubeBase):
class NDCubeBase(NDCubeSlicingMixin, NDCubeABC):
"""
Class representing N dimensional cubes.
Extra arguments are passed on to `~astropy.nddata.NDData`.
Expand Down Expand Up @@ -472,6 +472,10 @@ def __repr__(self):
axis_type=self.world_axis_physical_types))


class NDCube(NDCubeBase, NDCubePlotMixin, astropy.nddata.NDArithmeticMixin):
pass


class NDCubeOrdered(NDCube):
"""
Class representing N dimensional cubes with oriented WCS.
Expand Down

0 comments on commit 495711e

Please sign in to comment.