Skip to content

Commit

Permalink
Merge pull request #1 from dysplaced/master
Browse files Browse the repository at this point in the history
Tickets #58, #59
  • Loading branch information
apdavison committed Jun 15, 2012
2 parents e08ee50 + 8577b48 commit 9bd849d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions neo/core/analogsignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ def rescale(self, units):
to_u = self.units
signal = np.array(self)
else:
to_u = Quantity(1.0, to_dims)
from_u = Quantity(1.0, self.dimensionality)
to_u = pq.Quantity(1.0, to_dims)
from_u = pq.Quantity(1.0, self.dimensionality)
try:
cf = get_conversion_factor(from_u, to_u)
cf = pq.quantity.get_conversion_factor(from_u, to_u)
except AssertionError:
raise ValueError(
'Unable to convert between units of "%s" and "%s"'
Expand Down
9 changes: 4 additions & 5 deletions neo/core/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ def list_units(self):
"""
units = [ ]
for rcg in self.recordingchannelgroups:
for rc in rcg.recordingchannel:
for unit in rc.units:
if unit not in units:
units.append(unit)
for unit in rcg.units:
if unit not in units:
units.append(unit)
return units

@property
Expand All @@ -72,7 +71,7 @@ def list_recordingchannels(self):
"""
all_rc = [ ]
for rcg in self.recordingchannelgroups:
for rc in rcg.recordingchannel:
for rc in rcg.recordingchannels:
if rc not in all_rc:
all_rc.append(rc)
return all_rc
Expand Down
6 changes: 3 additions & 3 deletions neo/core/spiketrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ def rescale(self, units):
to_u = self.units
spikes = numpy.array(self)
else:
to_u = Quantity(1.0, to_dims)
from_u = Quantity(1.0, self.dimensionality)
to_u = pq.Quantity(1.0, to_dims)
from_u = pq.Quantity(1.0, self.dimensionality)
try:
cf = get_conversion_factor(from_u, to_u)
cf = pq.quantity.get_conversion_factor(from_u, to_u)
except AssertionError:
raise ValueError(
'Unable to convert between units of "%s" and "%s"'
Expand Down

0 comments on commit 9bd849d

Please sign in to comment.