Comments (6)
+1 to your first option. I'm inclined to exclude "float" and "float_" from the datashape grammar and from the blaze namespace. People coming from the C/C++ world will likely expect it to be 32-bit, and people coming from Python will likely expect it to match Python's float, 64-bit.
One idea would be to construct dshape("float64") when people say dshape(float), and dshape('float32") when people say dshape(np.float_), to match the sizes of the input type. This raises the question of whether blaze should allow numpy or python types where it is expecting a measure dshape object?
from blaze.
I just checked the documentation of Blaze, and it says that "float" should be "float64" (so, the second option). But I'm also +1 for the first option and forcing people to be explicit about it.
Also, I don't think there is a difference between Python float and np.float_. On my system:
>>> print np.float_
<type 'numpy.float64'>
from blaze.
It is a bit confusing in numpy, all of the following lead to float64:
In [2]: np.float_
Out[2]: numpy.float64
In [3]: np.double
Out[3]: numpy.float64
In [4]: np.float
Out[4]: float
from blaze.
In my opinion, in blaze types without an explicit bit width should only exist as aliases to ones with explicit bit width. Otherwise it has implications when persistence is taken into account. In fact, float is not that bad, as it maps always in the same bit width. But 'int' is a different issue.
By alias I mean something that gets accepted as input but translated to a real dtype.
IMO: this does not make sense in current blaze:
In [10]: blz.dshape('float')
Out[10]: dshape("float")
In [11]: blz.dshape('float32')
Out[11]: dshape("float32")
In [12]: blz.dshape('float64')
Out[12]: dshape("float64")
In [13]: blz.dshape('float') == blz.dshape('float32')
Out[13]: False
In [14]: blz.dshape('float') == blz.dshape('float64')
Out[14]: False
It should either:
In [10]: blz.dshape('float')
Out[10]: dshape("float32")
or
In [10]: blz.dshape('float')
Out[10]: dshape("float64")
Same with 'int':
In [15]: blz.dshape('int')
Out[15]: dshape("int")
In [16]: blz.dshape('int32')
Out[16]: dshape("int32")
In [17]: blz.dshape('int64')
Out[17]: dshape("int64")
In [18]: blz.dshape('int') == blz.dshape('int32')
Out[18]: False
In [19]: blz.dshape('int') == blz.dshape('int64')
Out[19]: False
Either that or drop the unsized ones, as commented.
from blaze.
In my opinion, in blaze types without an explicit bit width should only exist as aliases to ones with explicit bit width.
This was the original model, i.e. int
was aliased to int32
. This changed at some point for reasons I don't recall. The current model is that these are all distinct unit types with meaning unto themselves, which I think doesn't reflect the semantics that any of us want:
int_ = CType('int')
long_ = CType('long')
bool_ = CType('bool')
float_ = CType('float')
double = CType('double')
short = CType('short')
char = CType('char')
Coming from a C/LLVM perspective I'm for the notion that int
should be an alias for int32
irregardless of platform integer. The same for the floating point aliases:
half 16-bit floating point value
float 32-bit floating point value
double 64-bit floating point value
from blaze.
This appears to be resolved.
from blaze.
Related Issues (20)
- Are there any solutions for a Blaze ecosystem like hadoop? HOT 1
- networkx 2.0 api changes HOT 2
- Transitioning the Blaze project HOT 11
- Separate backends from core HOT 1
- `by` ignores the join condition
- dshape does not stick in bz.Data(...) HOT 13
- Blaze to RESTful endpoint
- (sqlite3.OperationalError) no such function: greatest HOT 1
- ValueError: numpy.ufunc has the wrong size, try recompiling. Expected 192, got 216
- removing redundancy
- Filtering with `by` ignores the group by condition HOT 1
- Dependency on pandas tslib HOT 1
- Fix simple typo: absense -> absence
- Unable to install pyhive from Anaconda Prompt HOT 1
- Importing ABC from collections was removed in Python 3.9
- Deprecation warning due to invalid escape sequences in Python 3.8
- BUG:TypeError: Cannot interpret 'CategoricalDtype(categories=['no', 'yes'], ordered=False)' as a data type
- Data analytics
- Is Blaze dead ?
- Blaze version issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blaze.