Skip to content

Commit

Permalink
Rename _Ordering to _Orderable
Browse files Browse the repository at this point in the history
  • Loading branch information
rlmv committed Jan 26, 2016
1 parent 1c98f02 commit 3faa138
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions pyphi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def wrapper(self, other):
return wrapper


class _Ordering:
class _Orderable:
"""Base mixin for implementing rich object comparisons on phi-objects.
Both ``__eq__`` and `_order_by`` need to be implemented on the subclass.
Expand Down Expand Up @@ -273,7 +273,7 @@ def _general_eq(a, b, attributes):
'unpartitioned_repertoire', 'partitioned_repertoire']


class Mip(_Ordering, namedtuple('Mip', _mip_attributes)):
class Mip(_Orderable, namedtuple('Mip', _mip_attributes)):
"""A minimum information partition for |small_phi| calculation.
MIPs may be compared with the built-in Python comparison operators (``<``,
Expand Down Expand Up @@ -373,7 +373,7 @@ def _null_mip(direction, mechanism, purview):

# =============================================================================

class Mice(_Ordering):
class Mice(_Orderable):
"""A maximally irreducible cause or effect (i.e., “core cause” or “core
effect”).
Expand Down Expand Up @@ -508,7 +508,7 @@ def damaged_by_cut(self, subsystem):

# TODO: make mechanism a property
# TODO: make phi a property
class Concept(_Ordering):
class Concept(_Orderable):
"""A star in concept-space.
The ``phi`` attribute is the |small_phi_max| value. ``cause`` and
Expand Down Expand Up @@ -692,7 +692,7 @@ def to_json(self):
'cut_subsystem']


class BigMip(_Ordering):
class BigMip(_Orderable):
"""A minimum information partition for |big_phi| calculation.
BigMips may be compared with the built-in Python comparison operators
Expand Down
4 changes: 2 additions & 2 deletions test/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

def test_phi_mechanism_ordering():

class PhiThing(models._Ordering):
class PhiThing(models._Orderable):
def __init__(self, phi, mechanism):
self.phi = phi
self.mechanism = mechanism

def _order_by(self):
return [self.phi, self.mechanism]

def __eq__(self, other):
return self.phi == other.phi and self.mechanism == other.mechanism

Expand Down

0 comments on commit 3faa138

Please sign in to comment.