Skip to content

Commit

Permalink
removed Phase __getitem__
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakaplan committed Aug 18, 2022
1 parent cc01768 commit 8a3eb2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pint/phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Phase(namedtuple("Phase", "int frac")):
>>> p = Phase(np.arange(10),np.random.random(10))
>>> print(p.int)
>>> print(p.frac[:5])
>>> print(p[::2])
>>> i,f = p
>>> q = p.quantity
Expand Down Expand Up @@ -107,9 +106,10 @@ def __mul__(self, num):
def __rmul__(self, num):
return self.__mul__(num)

def __getitem__(self, key):
return Phase(self.int[key], self.frac[key])

@property
def quantity(self):
return self.int + self.frac

@property
def value(self):
return self.quantity.value

0 comments on commit 8a3eb2d

Please sign in to comment.