-
Notifications
You must be signed in to change notification settings - Fork 598
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
[FEATURE-REQUEST] Create OHLC from tick data #1378
Comments
Hi, This is a very reasonable request - we are looking into how to do this nicely, so it is definetely in the pipeline. I will look in more detail how the pandas API works, i've not used that method before. Thanks - let's keep this open for any updates / suggestions. |
I think the trick I used is to cast the datetime to an int64, then back again. We should support this out of the box I think. Or provide a vaex.agg.last() aggregator to do this for you, like Jovan suggests. |
Hi, yeah a last aggregator would do great here. import vaex
import numpy as np
def make_df():
dates = pd.date_range("01-01-2019", "14-04-2019", freq="60s")
num = len(dates)
return vaex.from_arrays(ts=pd.to_datetime(dates), x=np.random.randint(1, 1000, num))
vdf = make_df()
print(vdf)
print(vdf.dtypes)
vdf['ts'] = vdf.ts.astype('int64')
print(vdf.dtypes)
vdf3 = vdf.groupby(by=vaex.BinnerTime(vdf.ts, resolution='m', every=15), agg={'C': vaex.agg.first('x', '-ts')})
print(vdf3) and got: # ts x
0 2019-01-01 00:00:00.000000000 578
1 2019-01-01 00:01:00.000000000 965
2 2019-01-01 00:02:00.000000000 74
3 2019-01-01 00:03:00.000000000 153
4 2019-01-01 00:04:00.000000000 29
... ... ...
148,316 2019-04-13 23:56:00.000000000 186
148,317 2019-04-13 23:57:00.000000000 556
148,318 2019-04-13 23:58:00.000000000 518
148,319 2019-04-13 23:59:00.000000000 231
148,320 2019-04-14 00:00:00.000000000 808
ts datetime64[ns]
x int32
dtype: object
ts int64
x int32
dtype: object
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-19-b07465a99cbc> in <module>
10 vdf['ts'] = vdf.ts.astype('int64')
11 print(vdf.dtypes)
---> 12 vdf3 = vdf.groupby(by=vaex.BinnerTime(vdf.ts, resolution='m', every=15), agg={'C': vaex.agg.first('x', '-ts')})
13 print(vdf3)
~\.venv\lib\site-packages\vaex\groupby.py in __init__(self, expression, resolution, df, every)
60 # divide by every, and round up
61 self.N = (self.N + every - 1) // every
---> 62 self.bin_values = np.arange(self.tmin.astype(self.resolution_type), self.tmax.astype(self.resolution_type)+1, every)
63 # TODO: we modify the dataframe in place, this is not nice
64 self.begin_name = self.df.add_variable('t_begin', self.tmin.astype(self.resolution_type), unique=True)
MemoryError: Unable to allocate 4.22 PiB for an array with shape (593280000000001,) and data type datetime64[m] I also tried in the agg expression like: vdf3 = vdf.groupby(by=vaex.BinnerTime(vdf.ts, resolution='m', every=15),
agg={'C': vaex.agg.first('x', 'ts.astype("int64")')}) But got a long trace of failed exception handling along the lines of : KeyError: 'Unknown variables or column: \'ts.astype("int64")\''
AttributeError: 'NumpyDispatch' object has no attribute 'astype' Let me know if you want the full trace and thanks for the help |
The BinnerTime should get a datetime argument, sth like this:
|
Ah thanks for that, able to create matching OHLC now with a slight modification to the BinnerTime. (Replaced the vaex/packages/vaex-core/vaex/groupby.py Line 48 in 2158975
min() and max() ) (cos of #1386). And much faster than pandas 😃
|
Hi there, |
Hi, 1/ 2/
(also, the docstring talks about 'max', which is wrong) 3/ In other words, does the groupby need the data to be sorted? I will check on my own naturally, but if you see any advice to have a proper/more robust/faster code, I am looking forward it. :) (like to sort 1st the merged DataFrame before grouping) Thanks for any help, |
indeed.
Conceptually we take all rows in a group, order by 'order_expression', but evaluate the '-ts_int'. Which makes sense for OHLC right? You order by date, but want the prices associated with that.
Yeah, do you want to fix that? Groupby doesn't need sorted data, so what you describe should work 👍 |
Thanks for the quick answer @maartenbreddels
Yes and no :) This can be 'common' (at least in the data I intend to manage), and independant of the timestamp resolution (s or ms or us or ns) because when you manage tick data, a taker order that is too big for a single maker order will be divided in as many maker orders as needed, possibly with different prices. In this case, the last transaction of the group is really the last row. => Ideally, instead of '-ts_int', it would be better if we could sort inversely by row index, somehow '-index'. <=
Yes, I will see to that this evening if I can do that directly from github.
This is just great, thanks! |
I see, yeah, I think a nice addition would be to have the order_expression by default be the last row index.
We could make it faster of course, by not having this row index, but I'd say that would require some funding, since that would take a bit of time to develop (c++ parts). |
I am not sure if I understand correctly.
Maarten, reading the begining of the ticket, my understanding is that
Alas, I have been working on this topic in my spare time only (for some years now), and make no money out of it yet. |
Yes, I just tried to call with vaex 4.5.1, |
Ok, so if my understanding is correct, the workaround would be:
So, 2 changes
I also removed the leading and trailing Thanks a lot for your help @maartenbreddels! This is perfect! |
Indeed, we don't have last yet :) |
@maartenbreddels |
Hi there, import vaex as vx
import pandas as pd
vdf = vx.from_pandas(pd.DataFrame({'a':[10,10,20], 'b':[21,11,12]}))
vdf["row_index"] = vx.vrange(0, len(vdf))
vdf
Out[3]:
# a b row_index
0 10 21 0
1 10 11 1
2 20 12 2
# Setup 'agg_last', data is ordered according row index.
agg_last = {col: vx.agg.first(col, "-row_index") for col in vdf.get_column_names()}
# Drop duplicates based on 'a', keeping last.
vdf.groupby('a', agg=agg_last)
Out[4]:
# a b row_index
0 20 12 2
1 10 21 1 I would like the result be ideally:
i.e. # a b row_index
1 10 11 1
0 20 12 2 What is quite weird is that row index value is correct: Please, could you correct me? |
I think you have found a bug, this works:
The issue is that first assumes that both arguments are of the same type, which is not true, and we don't check that. So we have to
Would you like to take a look at 1, and see if you can open a PR for that? I think this is all in agg.py |
A PR would be a pleasure, but I am just unable to install vaex. This is the 2nd time I tried (I tried back when I did a PR only for modifying a docstring - as it was only a docstring, it was not a great deal to push the PR nonetheless, even if I could not run the tests cases) I am following the installation notes, and running Meanwhile, you can see the code I was about to test in this commit (probably not working because I don't know if you can use directly Thanks for your support @maartenbreddels . This is much appreciated! Running setup.py develop for vaex-meta
ERROR: Command errored out with exit status 1:
command: /home/yoh/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/yoh/Documents/code/vaex/setup.py'"'"'; __file__='"'"'/home/yoh/Documents/code/vaex/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
cwd: /home/yoh/Documents/code/vaex/
Complete output (404 lines):
running develop
Obtaining file:///home/yoh/Documents/code/vaex/packages/vaex-core
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Requirement already satisfied: pydantic>=1.8.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (1.8.2)
Requirement already satisfied: future>=0.15.2 in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (0.18.2)
Requirement already satisfied: pyarrow>=3.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (3.0.0)
Requirement already satisfied: frozendict in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (2.0.3)
Requirement already satisfied: tabulate>=0.8.3 in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (0.8.9)
Requirement already satisfied: nest-asyncio>=1.3.3 in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (1.5.1)
Requirement already satisfied: cloudpickle in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (2.0.0)
Requirement already satisfied: blake3 in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (0.2.1)
Requirement already satisfied: six in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (1.16.0)
Requirement already satisfied: dask in /home/yoh/Documents/code/dask (from vaex-core==4.7.0.post1) (2021.12.0+20.ge4799c04)
Requirement already satisfied: filelock in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (3.4.0)
Requirement already satisfied: pyyaml in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (6.0)
Requirement already satisfied: numpy>=1.16 in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (1.20.3)
Requirement already satisfied: progressbar2 in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (3.37.1)
Requirement already satisfied: requests in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (2.26.0)
Collecting rich
Using cached rich-11.0.0-py3-none-any.whl (215 kB)
Requirement already satisfied: aplus in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (0.11.0)
Requirement already satisfied: pandas in /home/yoh/anaconda3/lib/python3.9/site-packages (from vaex-core==4.7.0.post1) (1.3.5)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /home/yoh/anaconda3/lib/python3.9/site-packages (from pydantic>=1.8.0->vaex-core==4.7.0.post1) (3.10.0.2)
Requirement already satisfied: fsspec>=0.6.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from dask->vaex-core==4.7.0.post1) (2022.1.0)
Requirement already satisfied: packaging>=20.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from dask->vaex-core==4.7.0.post1) (21.3)
Requirement already satisfied: partd>=0.3.10 in /home/yoh/anaconda3/lib/python3.9/site-packages (from dask->vaex-core==4.7.0.post1) (1.2.0)
Requirement already satisfied: toolz>=0.8.2 in /home/yoh/anaconda3/lib/python3.9/site-packages (from dask->vaex-core==4.7.0.post1) (0.11.2)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/yoh/anaconda3/lib/python3.9/site-packages (from packaging>=20.0->dask->vaex-core==4.7.0.post1) (3.0.4)
Requirement already satisfied: locket in /home/yoh/anaconda3/lib/python3.9/site-packages/locket-0.2.1-py3.9.egg (from partd>=0.3.10->dask->vaex-core==4.7.0.post1) (0.2.1)
Requirement already satisfied: python-dateutil>=2.7.3 in /home/yoh/anaconda3/lib/python3.9/site-packages (from pandas->vaex-core==4.7.0.post1) (2.8.2)
Requirement already satisfied: pytz>=2017.3 in /home/yoh/anaconda3/lib/python3.9/site-packages (from pandas->vaex-core==4.7.0.post1) (2021.3)
Requirement already satisfied: python-utils>=2.3.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from progressbar2->vaex-core==4.7.0.post1) (2.5.6)
Requirement already satisfied: certifi>=2017.4.17 in /home/yoh/anaconda3/lib/python3.9/site-packages (from requests->vaex-core==4.7.0.post1) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in /home/yoh/anaconda3/lib/python3.9/site-packages (from requests->vaex-core==4.7.0.post1) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/yoh/anaconda3/lib/python3.9/site-packages (from requests->vaex-core==4.7.0.post1) (1.26.7)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from requests->vaex-core==4.7.0.post1) (2.0.4)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from rich->vaex-core==4.7.0.post1) (2.10.0)
Requirement already satisfied: colorama<0.5.0,>=0.4.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from rich->vaex-core==4.7.0.post1) (0.4.4)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in /home/yoh/anaconda3/lib/python3.9/site-packages (from rich->vaex-core==4.7.0.post1) (0.9.1)
Installing collected packages: rich, vaex-core
Attempting uninstall: vaex-core
Found existing installation: vaex-core 4.6.0
Uninstalling vaex-core-4.6.0:
Successfully uninstalled vaex-core-4.6.0
Running setup.py develop for vaex-core
ERROR: Command errored out with exit status 1:
command: /home/yoh/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/yoh/Documents/code/vaex/packages/vaex-core/setup.py'"'"'; __file__='"'"'/home/yoh/Documents/code/vaex/packages/vaex-core/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
cwd: /home/yoh/Documents/code/vaex/packages/vaex-core/
Complete output (178 lines):
/home/yoh/Documents/code/vaex/packages/vaex-core/setup.py:4: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
/tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/setuptools/dist.py:493: UserWarning: Normalizing '4.7.0-post.1' to '4.7.0.post1'
warnings.warn(tmpl.format(**locals()))
running develop
/tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
package init file 'vaex/arrow/__init__.py' not found (or not a regular file)
warning: no files found matching '*.c' under directory 'vendor'
warning: no files found matching '*.h' under directory 'src'
warning: no files found matching '*.c' under directory 'src'
writing manifest file 'vaex_core.egg-info/SOURCES.txt'
running build_ext
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/src
gcc -pthread -B /home/yoh/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/yoh/anaconda3/include -I/home/yoh/anaconda3/include -fPIC -O2 -isystem /home/yoh/anaconda3/include -fPIC -I/tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/numpy/core/include -I/home/yoh/anaconda3/include/python3.9 -c src/vaexfast.cpp -o build/temp.linux-x86_64-3.9/src/vaexfast.o -std=c++11 -O3 -funroll-loops -Werror=return-type -Wno-unused-parameter -g
In file included from /tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
from /tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from src/vaexfast.cpp:31:
/tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
17 | #warning "Using deprecated NumPy API, disable it with " \
| ^~~~~~~
src/vaexfast.cpp:743:2: warning: "/*" within comment [-Wcomment]
743 | /**/
|
src/vaexfast.cpp: In function ‘PyObject* range_check_(PyObject*, PyObject*)’:
src/vaexfast.cpp:205:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
205 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* find_nan_min_max_(PyObject*, PyObject*)’:
src/vaexfast.cpp:285:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
285 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* nansum_(PyObject*, PyObject*)’:
src/vaexfast.cpp:325:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
325 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* sum_(PyObject*, PyObject*)’:
src/vaexfast.cpp:397:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
397 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* histogram1d_(PyObject*, PyObject*)’:
src/vaexfast.cpp:536:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
536 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* histogram2d_(PyObject*, PyObject*)’:
src/vaexfast.cpp:655:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
655 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* histogram2d_f4_(PyObject*, PyObject*)’:
src/vaexfast.cpp:779:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
779 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* histogram3d_(PyObject*, PyObject*)’:
src/vaexfast.cpp:896:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
896 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* histogramNd_(PyObject*, PyObject*)’:
src/vaexfast.cpp:995:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
995 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* grid_interpolate_(PyObject*, PyObject*)’:
src/vaexfast.cpp:1566:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
1566 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* grid_find_edges_(PyObject*, PyObject*)’:
src/vaexfast.cpp:1685:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
1685 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* project_(PyObject*, PyObject*)’:
src/vaexfast.cpp:1749:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
1749 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* pnpoly_(PyObject*, PyObject*)’:
src/vaexfast.cpp:1802:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
1802 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* soneira_peebles_(PyObject*, PyObject*)’:
src/vaexfast.cpp:1861:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
1861 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* shuffled_sequence_(PyObject*, PyObject*)’:
src/vaexfast.cpp:1930:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
1930 | } catch(Error e) {
| ^
src/vaexfast.cpp: In function ‘PyObject* resize_(PyObject*, PyObject*)’:
src/vaexfast.cpp:2052:17: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
2052 | } catch(Error e) {
| ^
src/vaexfast.cpp: In instantiation of ‘void histogram2d_f4(const float*, const float*, const float*, long long int, bool, bool, bool, Tout*, int, int, double, double, double, double, long long int, long long int) [with Tout = long long int]’:
src/vaexfast.cpp:775:219: required from here
src/vaexfast.cpp:665:12: warning: unused variable ‘i_x’ [-Wunused-variable]
665 | long long i_x = offset_x;
| ^~~
src/vaexfast.cpp:666:12: warning: unused variable ‘i_y’ [-Wunused-variable]
666 | long long i_y = offset_y;
| ^~~
src/vaexfast.cpp: In instantiation of ‘PyObject* statisticNd_(PyObject*, PyObject*) [with T = double; int NP_TYPE = 12; PyObject = _object]’:
src/vaexfast.cpp:2072:41: required from here
src/vaexfast.cpp:1406:5: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
1406 | } catch(Error e) {
| ^~~~~
src/vaexfast.cpp: In instantiation of ‘PyObject* statisticNd_(PyObject*, PyObject*) [with T = float; int NP_TYPE = 11; PyObject = _object]’:
src/vaexfast.cpp:2073:41: required from here
src/vaexfast.cpp:1406:5: warning: catching polymorphic type ‘struct Error’ by value [-Wcatch-value=]
src/vaexfast.cpp: In function ‘double double_to_native(double)’:
src/vaexfast.cpp:233:9: warning: ‘result_value’ is used uninitialized in this function [-Wuninitialized]
233 | return result_value;
| ^~~~~~~~~~~~
src/vaexfast.cpp: In function ‘PyObject* statisticNd_(PyObject*, PyObject*) [with T = double; int NP_TYPE = 12]’:
src/vaexfast.cpp:1364:10: warning: ‘native’ may be used uninitialized in this function [-Wmaybe-uninitialized]
1364 | else if(native != native_current) {
| ^~
src/vaexfast.cpp: In function ‘PyObject* statisticNd_(PyObject*, PyObject*) [with T = float; int NP_TYPE = 11]’:
src/vaexfast.cpp:1364:10: warning: ‘native’ may be used uninitialized in this function [-Wmaybe-uninitialized]
1364 | else if(native != native_current) {
| ^~
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/vaex
g++ -pthread -B /home/yoh/anaconda3/compiler_compat -shared -Wl,-rpath,/home/yoh/anaconda3/lib -Wl,-rpath-link,/home/yoh/anaconda3/lib -L/home/yoh/anaconda3/lib -L/home/yoh/anaconda3/lib -Wl,-rpath,/home/yoh/anaconda3/lib -Wl,-rpath-link,/home/yoh/anaconda3/lib -L/home/yoh/anaconda3/lib build/temp.linux-x86_64-3.9/src/vaexfast.o -o build/lib.linux-x86_64-3.9/vaex/vaexfast.cpython-39-x86_64-linux-gnu.so
gcc -pthread -B /home/yoh/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/yoh/anaconda3/include -I/home/yoh/anaconda3/include -fPIC -O2 -isystem /home/yoh/anaconda3/include -fPIC -I/tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/numpy/core/include -Ivendor/pybind11/include -Ivendor/pybind11/include -Ivendor/string-view-lite/include -Ivendor/boost -I/home/yoh/anaconda3/include -I/home/yoh/anaconda3/Library/include -I/home/yoh/Documents/code/vaex/packages/vaex-core/vendor/pcre/Library/include -I/home/yoh/anaconda3/include/python3.9 -c src/string_utils.cpp -o build/temp.linux-x86_64-3.9/src/string_utils.o -std=c++11 -O3 -funroll-loops -Werror=return-type -Wno-unused-parameter -g
gcc -pthread -B /home/yoh/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/yoh/anaconda3/include -I/home/yoh/anaconda3/include -fPIC -O2 -isystem /home/yoh/anaconda3/include -fPIC -I/tmp/pip-build-env-__x99t1_/overlay/lib/python3.9/site-packages/numpy/core/include -Ivendor/pybind11/include -Ivendor/pybind11/include -Ivendor/string-view-lite/include -Ivendor/boost -I/home/yoh/anaconda3/include -I/home/yoh/anaconda3/Library/include -I/home/yoh/Documents/code/vaex/packages/vaex-core/vendor/pcre/Library/include -I/home/yoh/anaconda3/include/python3.9 -c src/strings.cpp -o build/temp.linux-x86_64-3.9/src/strings.o -std=c++11 -O3 -funroll-loops -Werror=return-type -Wno-unused-parameter -g
In file included from vendor/pybind11/include/pybind11/cast.h:16,
from vendor/pybind11/include/pybind11/attr.h:13,
from vendor/pybind11/include/pybind11/pybind11.h:44,
from vendor/pybind11/include/pybind11/numpy.h:12,
from src/superstring.hpp:8,
from src/strings.cpp:1:
vendor/pybind11/include/pybind11/detail/internals.h: In function ‘pybind11::detail::internals& pybind11::detail::get_internals()’:
vendor/pybind11/include/pybind11/detail/internals.h:200:28: warning: ‘void PyEval_InitThreads()’ is deprecated [-Wdeprecated-declarations]
200 | PyEval_InitThreads();
| ^
In file included from /home/yoh/anaconda3/include/python3.9/Python.h:154,
from vendor/pybind11/include/pybind11/detail/common.h:112,
from vendor/pybind11/include/pybind11/pytypes.h:12,
from vendor/pybind11/include/pybind11/cast.h:13,
from vendor/pybind11/include/pybind11/attr.h:13,
from vendor/pybind11/include/pybind11/pybind11.h:44,
from vendor/pybind11/include/pybind11/numpy.h:12,
from src/superstring.hpp:8,
from src/strings.cpp:1:
/home/yoh/anaconda3/include/python3.9/ceval.h:130:37: note: declared here
130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
| ^~~~~~~~~~~~~~~~~~
In file included from vendor/pybind11/include/pybind11/cast.h:16,
from vendor/pybind11/include/pybind11/attr.h:13,
from vendor/pybind11/include/pybind11/pybind11.h:44,
from vendor/pybind11/include/pybind11/numpy.h:12,
from src/superstring.hpp:8,
from src/strings.cpp:1:
vendor/pybind11/include/pybind11/detail/internals.h:200:28: warning: ‘void PyEval_InitThreads()’ is deprecated [-Wdeprecated-declarations]
200 | PyEval_InitThreads();
| ^
In file included from /home/yoh/anaconda3/include/python3.9/Python.h:154,
from vendor/pybind11/include/pybind11/detail/common.h:112,
from vendor/pybind11/include/pybind11/pytypes.h:12,
from vendor/pybind11/include/pybind11/cast.h:13,
from vendor/pybind11/include/pybind11/attr.h:13,
from vendor/pybind11/include/pybind11/pybind11.h:44,
from vendor/pybind11/include/pybind11/numpy.h:12,
from src/superstring.hpp:8,
from src/strings.cpp:1:
/home/yoh/anaconda3/include/python3.9/ceval.h:130:37: note: declared here
130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
| ^~~~~~~~~~~~~~~~~~
In file included from src/strings.cpp:1:
src/superstring.hpp: At global scope:
src/superstring.hpp:647:5: internal compiler error: Segmentation fault
647 | };
| ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
Rolling back uninstall of vaex-core
Moving to /home/yoh/anaconda3/bin/vaex
from /tmp/pip-uninstall-2vhfq5wv/vaex
Moving to /home/yoh/anaconda3/bin/vaexgui
from /tmp/pip-uninstall-2vhfq5wv/vaexgui
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/__init__.py
from /tmp/pip-uninstall-lh3l9ocf/__init__.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/__main__.py
from /tmp/pip-uninstall-lh3l9ocf/__main__.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/__pycache__/
from /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/~_pycache__
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/_version.py
from /tmp/pip-uninstall-lh3l9ocf/_version.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/agg.py
from /tmp/pip-uninstall-lh3l9ocf/agg.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/array_types.py
from /tmp/pip-uninstall-lh3l9ocf/array_types.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/arrow/
from /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/~rrow
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/asyncio.py
from /tmp/pip-uninstall-lh3l9ocf/asyncio.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/benchmark.py
from /tmp/pip-uninstall-lh3l9ocf/benchmark.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/cache.py
from /tmp/pip-uninstall-lh3l9ocf/cache.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/column.py
from /tmp/pip-uninstall-lh3l9ocf/column.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/convert.py
from /tmp/pip-uninstall-lh3l9ocf/convert.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/core/
from /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/~ore
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/cpu.py
from /tmp/pip-uninstall-lh3l9ocf/cpu.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/dataframe.py
from /tmp/pip-uninstall-lh3l9ocf/dataframe.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/dataframe_protocol.py
from /tmp/pip-uninstall-lh3l9ocf/dataframe_protocol.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/dataset.py
from /tmp/pip-uninstall-lh3l9ocf/dataset.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/dataset_misc.py
from /tmp/pip-uninstall-lh3l9ocf/dataset_misc.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/dataset_mmap.py
from /tmp/pip-uninstall-lh3l9ocf/dataset_mmap.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/dataset_utils.py
from /tmp/pip-uninstall-lh3l9ocf/dataset_utils.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/datasets.py
from /tmp/pip-uninstall-lh3l9ocf/datasets.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/datatype.py
from /tmp/pip-uninstall-lh3l9ocf/datatype.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/datatype_test.py
from /tmp/pip-uninstall-lh3l9ocf/datatype_test.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/delayed.py
from /tmp/pip-uninstall-lh3l9ocf/delayed.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/docstrings.py
from /tmp/pip-uninstall-lh3l9ocf/docstrings.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/encoding.py
from /tmp/pip-uninstall-lh3l9ocf/encoding.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/events.py
from /tmp/pip-uninstall-lh3l9ocf/events.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/execution.py
from /tmp/pip-uninstall-lh3l9ocf/execution.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/export.py
from /tmp/pip-uninstall-lh3l9ocf/export.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/expression.py
from /tmp/pip-uninstall-lh3l9ocf/expression.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/expresso.py
from /tmp/pip-uninstall-lh3l9ocf/expresso.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/ext/
from /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/~xt
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/file/
from /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/~ile
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/formatting.py
from /tmp/pip-uninstall-lh3l9ocf/formatting.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/functions.py
from /tmp/pip-uninstall-lh3l9ocf/functions.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/geo.py
from /tmp/pip-uninstall-lh3l9ocf/geo.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/grids.py
from /tmp/pip-uninstall-lh3l9ocf/grids.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/groupby.py
from /tmp/pip-uninstall-lh3l9ocf/groupby.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/hash.py
from /tmp/pip-uninstall-lh3l9ocf/hash.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/image.py
from /tmp/pip-uninstall-lh3l9ocf/image.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/itertools.py
from /tmp/pip-uninstall-lh3l9ocf/itertools.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/join.py
from /tmp/pip-uninstall-lh3l9ocf/join.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/json.py
from /tmp/pip-uninstall-lh3l9ocf/json.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/kld.py
from /tmp/pip-uninstall-lh3l9ocf/kld.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/legacy.py
from /tmp/pip-uninstall-lh3l9ocf/legacy.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/memory.py
from /tmp/pip-uninstall-lh3l9ocf/memory.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/meta.py
from /tmp/pip-uninstall-lh3l9ocf/meta.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/metal.py
from /tmp/pip-uninstall-lh3l9ocf/metal.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/misc/
from /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/~isc
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/misc_cmdline.py
from /tmp/pip-uninstall-lh3l9ocf/misc_cmdline.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/multiprocessing.py
from /tmp/pip-uninstall-lh3l9ocf/multiprocessing.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/multithreading.py
from /tmp/pip-uninstall-lh3l9ocf/multithreading.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/parallelize.py
from /tmp/pip-uninstall-lh3l9ocf/parallelize.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/promise.py
from /tmp/pip-uninstall-lh3l9ocf/promise.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/registry.py
from /tmp/pip-uninstall-lh3l9ocf/registry.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/rolling.py
from /tmp/pip-uninstall-lh3l9ocf/rolling.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/samp.py
from /tmp/pip-uninstall-lh3l9ocf/samp.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/schema.py
from /tmp/pip-uninstall-lh3l9ocf/schema.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/scopes.py
from /tmp/pip-uninstall-lh3l9ocf/scopes.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/selections.py
from /tmp/pip-uninstall-lh3l9ocf/selections.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/serialize.py
from /tmp/pip-uninstall-lh3l9ocf/serialize.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/settings.py
from /tmp/pip-uninstall-lh3l9ocf/settings.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/shift.py
from /tmp/pip-uninstall-lh3l9ocf/shift.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/stat.py
from /tmp/pip-uninstall-lh3l9ocf/stat.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/strings.py
from /tmp/pip-uninstall-lh3l9ocf/strings.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/struct.py
from /tmp/pip-uninstall-lh3l9ocf/struct.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/superagg.cpython-39-x86_64-linux-gnu.so
from /tmp/pip-uninstall-lh3l9ocf/superagg.cpython-39-x86_64-linux-gnu.so
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/superstrings.cpython-39-x86_64-linux-gnu.so
from /tmp/pip-uninstall-lh3l9ocf/superstrings.cpython-39-x86_64-linux-gnu.so
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/superutils.cpython-39-x86_64-linux-gnu.so
from /tmp/pip-uninstall-lh3l9ocf/superutils.cpython-39-x86_64-linux-gnu.so
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/tasks.py
from /tmp/pip-uninstall-lh3l9ocf/tasks.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/test/
from /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/~est
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/utils.py
from /tmp/pip-uninstall-lh3l9ocf/utils.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/vaexfast.cpython-39-x86_64-linux-gnu.so
from /tmp/pip-uninstall-lh3l9ocf/vaexfast.cpython-39-x86_64-linux-gnu.so
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex/version.py
from /tmp/pip-uninstall-lh3l9ocf/version.py
Moving to /home/yoh/anaconda3/lib/python3.9/site-packages/vaex_core-4.6.0.dist-info/
from /home/yoh/anaconda3/lib/python3.9/site-packages/~aex_core-4.6.0.dist-info
ERROR: Command errored out with exit status 1: /home/yoh/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/yoh/Documents/code/vaex/packages/vaex-core/setup.py'"'"'; __file__='"'"'/home/yoh/Documents/code/vaex/packages/vaex-core/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/yoh/Documents/code/vaex/setup.py", line 63, in <module>
setup(
File "/home/yoh/anaconda3/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/yoh/anaconda3/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/yoh/anaconda3/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/yoh/anaconda3/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/yoh/Documents/code/vaex/setup.py", line 33, in run
raise RuntimeError(f'Oops, failed to install {package}')
RuntimeError: Oops, failed to install vaex-core
----------------------------------------
ERROR: Command errored out with exit status 1: /home/yoh/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/yoh/Documents/code/vaex/setup.py'"'"'; __file__='"'"'/home/yoh/Documents/code/vaex/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output. |
It seems the compiler segfaults, did you try installing the 'compilers' package from conda forge? You can check the scripts in the ci directory how we create an environment in ci, maybe that helps |
Description
Trying to create OHLC (Open High Low Close) data from price tick data. Can sort of create Open, High, Low, but Open is wrong and times have some offset. Not sure about close.
Output:
Additional Context
Trying to emulate Pandas OHLC
The text was updated successfully, but these errors were encountered: