adonmo / meos

Mobility Engine, Open Source
https://adonmo.github.io/meos/
MIT License
21 stars 3 forks source link

Numpy-like dtype inference #6

Open chaitan94 opened 4 years ago

chaitan94 commented 4 years ago

This is just a thought as of now, because I am not exactly sure how this can be done and whether it will add any unnecessary complications elsewhere, say while implementing various type of functions.

Basically idea is simple: instead of having multiple classes defined, one for each type like for example TSequenceFloat and TSequenceGeom, can we have a single TSequence class, and infer the type based on the values provided? This could be similar to how numpy does through its dtype logic. One major advantage with this approach could be that we might be much more in line with many tools like numpy, pandas and friends.