Skip to content

Commit

Permalink
Add newt easter egg (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksunden authored and untzag committed Sep 20, 2018
1 parent 575959d commit 5829bf4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions WrightTools/data/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,7 @@ def transform(self, *axes, verbose=True):
# TODO: ensure that transform does not break data
# create
new = []
newt = "newt" in self.axis_expressions
current = {a.expression: a for a in self._axes}
for expression in axes:
axis = current.get(expression, Axis(self, expression))
Expand All @@ -1493,6 +1494,11 @@ def transform(self, *axes, verbose=True):
# finish
self.flush()
self._on_axes_updated()
nownewt = "newt" in self.axis_expressions
if verbose and nownewt and not newt:
print("Look she turned me into a newt")
elif verbose and newt and not nownewt:
print("I got better")

def zoom(self, factor, order=1, verbose=True):
"""Zoom the data array using spline interpolation of the requested order.
Expand Down

0 comments on commit 5829bf4

Please sign in to comment.