Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create large multidimensional array in BLZ #2

Open
FrancescAlted opened this issue Jan 7, 2014 · 1 comment
Open

Can't create large multidimensional array in BLZ #2

FrancescAlted opened this issue Jan 7, 2014 · 1 comment

Comments

@FrancescAlted
Copy link
Contributor

[Adapted from https://github.com/Blosc/bcolz/issues/25]

With Numpy I can do something like this:

foo = np.zeros([ 2 ] * 20)

And get an ndarray with the corresponding shape. I can then:

ac = blz.barray(foo)

To get a barray object. Great. But I'm playing around with blaze.blz because I want to use array sizes that are larger than could otherwise fit in memory, and [2] * 20 is an easy shape for Numpy to handle, so for me it's a baseline of sorts.

Looking to explore the capabilities of blze.blz, I try to create the object directly, without the intermediate Numpy step:

ac = blz.zeros([2] * 20)

But I get an error:

In [11]: blz.zeros([2]*20)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-11-32ca191bdff9> in <module>()
----> 1 blz.zeros([2]*20)

/home/faltet/software/blz/blz/bfuncs.pyc in zeros(shape, dtype, **kwargs)
    239     """
    240     dtype = np.dtype(dtype)
--> 241     return fill(shape=shape, dflt=np.zeros((), dtype), dtype=dtype, **kwargs)
    242 
    243 

/home/faltet/software/blz/blz/bfuncs.pyc in fill(shape, dflt, dtype, **kwargs)
    203     # Then fill it
    204     # We need an array for the defaults so as to keep the atom info
--> 205     dflt = np.array(obj.dflt, dtype=dtype)
    206     # Making strides=(0,) below is a trick to create the array fast and
    207     # without memory consumption

ValueError: number of dimensions must be within [0, 32]

Which leads me to wonder: is something like this possible using blz?

@FrancescAlted
Copy link
Contributor Author

Yes, this is a problem with the size of the defaults that are too large for the multidimensional case. This should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant