Skip to content

Commit

Permalink
minor: dtype as string (towards #21)
Browse files Browse the repository at this point in the history
  • Loading branch information
anwarnunez committed May 9, 2020
1 parent 7e254d9 commit 07c0a11
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions moten/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
def raw_project_stimulus(stimulus,
filters,
vhsize=(),
dtype=np.float32):
dtype='float32'):
'''Obtain responses to the stimuli from all filter quadrature-pairs.
Parameters
Expand Down Expand Up @@ -80,7 +80,7 @@ def project_stimulus(stimulus,
quadrature_combination=sqrt_sum_squares,
output_nonlinearity=log_compress,
vhsize=(),
dtype=np.float32):
dtype='float32'):
'''Compute the motion-energy filter responses to the stimuli.
Parameters
Expand Down Expand Up @@ -134,7 +134,7 @@ def __init__(self,
nimages=np.inf,
batch_size=100,
output_nonlinearity=pointwise_square,
dtype=np.float32):
dtype='float32'):
'''
'''
self.size = size
Expand Down
2 changes: 1 addition & 1 deletion moten/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def generate_frames_from_greyvideo(video_file, size=None, nimages=np.inf):
def generate_frame_difference_from_greyvideo(video_file,
size=None,
nimages=np.inf,
dtype=np.float32):
dtype='float32'):
vbuffer = video_buffer(video_file, nimages=nimages)
previous_frame = 0
for frame_index, image_rgb in enumerate(vbuffer):
Expand Down
10 changes: 5 additions & 5 deletions moten/tests/test_spatiotemporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ def test_oldapi():

# inferred aspect ratio
moten_features_defaults = moten.core.compute_filter_responses(luminance_images, 24,
dtype=np.float32)
dtype='float32')

# wrong aspect ratio
moten_features_wrong = moten.core.compute_filter_responses(luminance_images, 24,
aspect_ratio=1.0,
dtype=np.float32)
dtype='float32')

# exact aspect ratio
moten_features_exact = moten.core.compute_filter_responses(luminance_images, 24,
aspect_ratio=aspect_ratio,
dtype=np.float32)
dtype='float32')


# custom pyramid
Expand All @@ -43,11 +43,11 @@ def test_oldapi():

moten_features_custom = moten.core.compute_filter_responses(luminance_images, 24,
aspect_ratio=aspect_ratio,
dtype=np.float32,
dtype='float32',
pyramid_parameters=pyramid_parameters)


# spatial only
##############################
gabor_features_custom = moten.core.compute_spatial_gabor_responses(luminance_images,
dtype=np.float32)
dtype='float32')
2 changes: 1 addition & 1 deletion moten/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def iterator_func(*args, **kwargs):
def pixbypix_covariance_from_frames_generator(data_generator,
batch_size=1000,
output_nonlinearity=pointwise_square,
dtype=np.float32):
dtype='float32'):
'''
Parameters
----------
Expand Down

0 comments on commit 07c0a11

Please sign in to comment.