Skip to content

Commit 9f79bd5

Browse files
committed
Merge branch 'rel1.3'
2 parents 81091f3 + 368f856 commit 9f79bd5

28 files changed

+224
-24
lines changed

Diff for: .travis.yml

+41-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
stage: standalone
12
language: c
23
os:
34
- linux
@@ -21,13 +22,11 @@ script:
2122
fi
2223
- make p.so
2324
- cp [ml]64/p.so q/$QLIBDIR;
24-
- echo "Preparing version $TRAVIS_BRANCH-$TRAVIS_COMMIT"
2525
- tar czf embedPy_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.tgz p.q p.k test.q tests [ml]64/p.so LICENSE README.md
26-
- echo "Packaged as embedPy_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.zip"
2726
- if [[ "x$QLIC_KC" != "x" ]]; then
2827
echo -n $QLIC_KC |base64 --decode > q/kc.lic;
2928
pip3 -q install -r tests/requirements.txt;
30-
q test.q -q;
29+
q test.q -s 4 -q;
3130
else
3231
echo No kdb+, no tests;
3332
fi
@@ -43,7 +42,9 @@ deploy:
4342
tags: true
4443
jobs:
4544
include:
46-
- stage: docker
45+
- stage: deploy_target
46+
env:
47+
- TARGET=docker
4748
sudo: required
4849
services:
4950
- docker
@@ -56,9 +57,45 @@ jobs:
5657
script:
5758
- echo $DOCKER_PASSWORD|docker login --username $DOCKER_USERNAME --password-stdin && docker push kxsys/embedpy:latest && docker push kxsys/embedpy:$TRAVIS_BRANCH
5859
skip_cleanup: true
60+
on:
61+
tags: true
62+
condition: $TRAVIS_BRANCH =~ ^[0-9]+\. && $TRAVIS_REPOSLUG = KxSystems/embedPy
63+
- &conda_build
64+
stage: deploy_target
65+
env:
66+
- TARGET=conda
67+
os:
68+
- linux
69+
before_install: skip
70+
install:
71+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
72+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
73+
else
74+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
75+
fi
76+
- bash miniconda.sh -b -p $HOME/miniconda
77+
- export PATH="$HOME/miniconda/bin:$PATH"
78+
- hash -r
79+
- conda config --set always_yes yes --set changeps1 no
80+
- conda install -q "conda-build<3.12"
81+
script:
82+
- if [ $TRAVIS_OS_NAME = linux ]; then QLIBDIR=l64; elif [ $TRAVIS_OS_NAME = osx ]; then QLIBDIR=m64; fi; export QLIBDIR
83+
- if [[ "x$QLIC_KC" != "x" ]]; then mkdir -p q; echo -n $QLIC_KC |base64 --decode > q/kc.lic; export QLIC=$(pwd)/q; fi
84+
- export EMBEDPY_VERSION=$TRAVIS_BRANCH
85+
- conda build conda-recipe --output -c kx > packagenames.txt
86+
- conda build -c kx conda-recipe --no-long-test-prefix
87+
deploy:
88+
provider: script
89+
script:
90+
- build/anaconda_upload.sh
91+
skip_cleanup: true
5992
on:
6093
tags: true
6194
condition: $TRAVIS_BRANCH =~ ^[0-9]+\.
95+
- <<: *conda_build
96+
os:
97+
- osx
98+
6299
notifications:
63100
slack:
64101
secure: "MR5icOywJJSFy7gnxeNXACN2nKiHniVgX1myiF+H9U4wsW6+2BHzPMcmy3FIUjL3Tb+PcAfq7+8RHerAx/XEB7nsVJsu9TyCjYWgaqx5Z9WNIDcjQh4wnFurhlzqrwF4gjelY+wxdffpsKUVaP+fermWbqHvv1aPPk4l3xEonXZ5J5uNkPTPufILzpx2cTxWg08o6PhvgjTrombs+9rGxahU8cfUSwTVuPCcPtOy70kcaowFfrU2kWzQk88NM5d/TVZdkOmGhLqVWSvRgaLXFkGYwRWatT7divlXX2evYwdYib++RUUhxDGZwJjdFCbGDNjrMyBbJOrCkndxLSATd6gN76dWuWsVV49K4YB0Mw5uFJFt6J0TnbkJC5Zsl9i6vik7m3anuIPOeAI54/wtlCvMeIpt2eQCPMy7xXu2hXNUR4ofM4yaVjKz69b5JIZ1o3vBxPQxAqIYggqPsTaLJM4vLpZlncnViBkfO/La5V9sJNQy3IyLSlEKry3giYfo8wbHT3PLn1xG7HW2DJ7hRn19yzTkCCNfaSzvq8YlSQvjNlPCO566ykYYG6SzG/NnbDqJAqydhpFuNC7ZB5dPuAOoDANCGs4gtfYKia+ZVxKYn25Y52vdi34L5TO83BUrsQWgytb0J6a4jDe3PWLVFSP7XLiy4h8Tyv76+Hm4lHk="

Diff for: appveyor.yml

+4-12
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,15 @@ platform: x64
88
build_script:
99
- cmd: >-
1010
11-
curl -fsSL -o k.h https://github.com/KxSystems/kdb/raw/master/c/c/k.h
11+
call build\build.bat
1212
13-
curl -fsSL -o q.lib https://github.com/KxSystems/kdb/raw/master/w64/q.lib
14-
15-
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
16-
17-
mkdir w64
18-
19-
cl /LD /DKXVER=3 /Fep.dll /O2 py.c q.lib
20-
21-
move p.dll w64
2213
after_build:
2314
- cmd: >-
2415
25-
if "%APPVEYOR_REPO_TAG%"=="true" ( 7z a embedPy_windows-%APPVEYOR_REPO_TAG_NAME%.zip p.q p.k test.q tests w64/p.dll LICENSE README.md && appveyor PushArtifact embedPy_windows-%APPVEYOR_REPO_TAG_NAME%.zip )
16+
call build\package.bat
17+
18+
call build\anaconda_upload.bat
2619
27-
if "%APPVEYOR_REPO_TAG%"=="false" ( 7z a embedPy_windows-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_BUILD_VERSION%.zip p.q p.k test.q tests w64/p.dll LICENSE README.md && appveyor PushArtifact embedPy_windows-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_BUILD_VERSION%.zip )
2820
deploy:
2921
release: $(appveyor_repo_tag_name)
3022
provider: GitHub

Diff for: build/anaconda_upload.bat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if "%APPVEYOR_REPO_TAG%"=="true" (
2+
for /F "tokens=*" %%P in (packagenames.txt) do anaconda -t %CONDATOKEN% upload -l dev %%P || goto :error
3+
)
4+
:error
5+
exit /b %errorLevel%

Diff for: build/anaconda_upload.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
conda install -q -y anaconda-client
3+
for pack in $(cat packagenames.txt)
4+
do
5+
anaconda -t $CONDATOKEN upload -l dev $pack
6+
done
7+

Diff for: build/build.bat

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:: Standalone build
2+
curl -fsSL -o k.h https://github.com/KxSystems/kdb/raw/master/c/c/k.h || goto :error
3+
curl -fsSL -o q.lib https://github.com/KxSystems/kdb/raw/master/w64/q.lib || goto :error
4+
::keep original PATH, PATH may get too long otherwise
5+
set OP=%PATH%
6+
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
7+
mkdir w64
8+
cl /LD /DKXVER=3 /Fep.dll /O2 py.c q.lib || goto :error
9+
move p.dll w64
10+
set PATH=%OP%
11+
12+
:: Conda build
13+
set PATH=C:\Miniconda3-x64;C:\Miniconda3-x64\Scripts;%PATH%
14+
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
15+
:: install conda build requirements (use version < 3.12 to avoid warning about verify in output file)
16+
conda install -y "conda-build<3.12" || goto :error
17+
conda install -y anaconda-client || goto :error
18+
:: set up kdb+ if available
19+
if defined QLIC_KC ( echo|set /P=%QLIC_KC% > kc.lic.enc & certutil -decode kc.lic.enc kc.lic & set QLIC=%CD%)
20+
if "%APPVEYOR_REPO_TAG%"=="true" ( set EMBEDPY_VERSION=%APPVEYOR_REPO_TAG_NAME% )
21+
conda build --output conda-recipe > packagenames.txt || goto :error
22+
conda build -c kx conda-recipe || goto :error
23+
set PATH=%OP%;C:\Miniconda3-x64;C:\Miniconda3-x64\Scripts
24+
exit /b 0
25+
26+
:error
27+
exit /b %errorLevel%

Diff for: build/package.bat

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set ZIPNAME=
2+
if "%APPVEYOR_REPO_TAG%"=="true" (
3+
set ZIPNAME=embedPy_windows-%APPVEYOR_REPO_TAG_NAME%.zip
4+
) else (
5+
set ZIPNAME=embedPy_windows-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_BUILD_VERSION%.zip
6+
)
7+
7z a %ZIPNAME% p.q p.k test.q tests w64/p.dll LICENSE README.md || goto :error
8+
appveyor PushArtifact %ZIPNAME% || goto :error
9+
exit /b 0
10+
:error
11+
exit /b %errorLevel%

Diff for: conda-recipe/bld.bat

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
set QHOME=%PREFIX%\q
2+
mkdir %QHOME%
3+
move p.q %QHOME% || goto :error
4+
move p.k %QHOME% || goto :error
5+
6+
set QBIN=%QHOME%\w64
7+
mkdir QBIN
8+
cl /LD /DKXVER=3 /Fep.dll /O2 py.c q.lib || goto :error
9+
move p.dll %QBIN% || goto :error
10+
exit 0
11+
:error
12+
exit %errorlevel%
13+

Diff for: conda-recipe/build.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
export QHOME=$PREFIX/q
3+
if [ $(uname) == Linux ];
4+
then
5+
QLIBDIR=l64
6+
else
7+
QLIBDIR=m64
8+
fi
9+
make p.so
10+
mkdir -p $QHOME
11+
mkdir -p $QHOME/$QLIBDIR
12+
mv p.q p.k $QHOME
13+
mv $QLIBDIR/p.so $QHOME/$QLIBDIR

Diff for: conda-recipe/conda_build_config.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python:
2+
- 3.5
3+
- 3.6
4+
- 3.7

Diff for: conda-recipe/meta.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package:
2+
name: embedpy
3+
version: {{ environ.get('EMBEDPY_VERSION', 'noversion') }}
4+
5+
source:
6+
path: ..
7+
8+
build:
9+
detect_binary_files_with_prefix: False
10+
script_env:
11+
QLIC
12+
13+
requirements:
14+
build:
15+
- m2w64-make [win]
16+
- {{ compiler('c') }}
17+
host:
18+
- python
19+
- kdb
20+
run:
21+
- python
22+
- kdb
23+
test:
24+
source_files:
25+
- test.q
26+
- tests/
27+
- conda-recipe/prep_requirements.q
28+
29+
about:
30+
home: https://github.com/KxSystems/embedPy
31+
summary: allows the kdb+ interpreter to manipulate Python objects

Diff for: conda-recipe/prep_requirements.q

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/ exclude packages from tests/requirements.txt based on python major minor version
2+
\l p.q
3+
pexclude:select py37:enlist"tensorflow*" from (0#`)!()
4+
pver:`$"py",raze string .p.import[`sys;`:version_info][;`]each`:major`:minor
5+
`:tests/requirements_filtered.txt 0:u where not any(u:read0`:tests/requirements.txt)like/:pexclude pver
6+
\\

Diff for: conda-recipe/run_test.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
if not defined QLIC (
2+
goto :nokdb
3+
)
4+
call q conda-recipe/prep_requirements.q -q
5+
conda install -y -q --file tests\requirements_filtered.txt
6+
call q test.q -s 4 -q || goto :error
7+
exit /b 0
8+
9+
:error
10+
exit /b %errorLevel%
11+
12+
:nokdb
13+
echo no kdb
14+
exit /b 0

Diff for: conda-recipe/run_test.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
if [ -e ${QLIC}/kc.lic ]
3+
then
4+
q conda-recipe/prep_requirements.q -q
5+
conda install -y -q --file tests/requirements_filtered.txt
6+
q test.q -s 4 -q;
7+
else
8+
echo No kdb+, no tests;
9+
fi

Diff for: makefile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LDFLAGS=-bundle -undefined dynamic_lookup
77
QLIBDIR=m64
88
endif
99
p.so: $(QLIBDIR)/p.so
10+
cp $(QLIBDIR)/p.so .
1011
$(QLIBDIR)/p.so: py.c py.h k.h
1112
mkdir -p $(QLIBDIR)
1213
$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@

Diff for: p.q

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
\d .p
22
if[not .P.loaded:-1h=type@[`.p@;`numpy;`];
33
sc:{"'",x,"'.join([__import__('sysconfig').get_config_var(v)for v in",ssr[.j.j y;"\"";"'"],"])"};pr:{"print(",x,");"};
4-
c:"-c \"",pr[$[.z.o like"w*";sc["/python";`BINDIR`VERSION],"+'.dll'";sc["/";`LIBDIR`INSTSONAME]]],pr[$[.z.o like"m*";sc["/";`PYTHONFRAMEWORKPREFIX`INSTSONAME];.z.o like"l*";sc["/";`LIBPL`LDLIBRARY];"''"]],pr["__import__('sys').prefix"],"\"2>",$[.z.o like"w*";"nul";"/dev/null"];
4+
c:"-c \"",pr[$[.z.o like"w*";sc["/python";`BINDIR`VERSION],"+'.dll'";sc["/";`LIBDIR`INSTSONAME]]],pr[$[.z.o like"m*";sc["/";`PYTHONFRAMEWORKPREFIX`INSTSONAME];.z.o like"l*";sc["/";`LIBPL`LDLIBRARY];"''"]],pr["__import__('sys').prefix"],"\"2>",$[.z.o like"w*";"nul <nul";"/dev/null"];
55
`L`M`H set'@[system"python3 ",;c;{system"python ",c}];if[count M;if[k~key k:`$":",M;L::M]];
66
.p:(`:./p 2:(`init;2))[L;H]]
77
loaded:.P.loaded

Diff for: py.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ Z K3(call){P a,k,p;I g;P(!pq(x)||!pq(z)&&z->t!=XD,ktrr())g=g1();a=pq(y)?p1(pg(y)
4545
Z K1(setconv){P(xt<100||xt>111,ktrr())r0(cf);cf=r1(x);R 0;}Z K1(getconv){R r1(cf);}Z K1(isp){R kb(pq(x));}
4646

4747
ZV*t;EXP K2(init){ZI i=0;I f,g;S l,h;K n,v;P a,b;P(i,0)l=zs(x),h=zs(y);f=pyl(l);free(l);P(!f,krr("libpython"))
48-
Py_SetPythonHome(Py_DecodeLocale(h,0));free(h);Py_InitializeEx(0);if(PyEval_ThreadsInitialized())t0(PyGILState_GetThisThreadState());PyEval_InitThreads();
48+
Py_SetPythonHome(Py_DecodeLocale(h,0));free(h);P(pyi(),krr("pyinit"));if(PyEval_ThreadsInitialized()&&!PyGILState_Check())t0(PyGILState_GetThisThreadState());PyEval_InitThreads();
4949
M=PyModule_GetDict(PyImport_AddModule("__main__"));cf=k(0,"::",0);n=ktn(KS,0);v=ktn(0,0);
5050
if(a=PyImport_ImportModule("numpy.core.multiarray")){N=PyCapsule_GetPointer(b=PyObject_GetAttrString(a,"_ARRAY_API"),0);if(!N||!pyn(N))N=0;p0(b);p0(a);}PyErr_Clear();
5151
#define F(f,i) js(&n,ss(#f));jk(&v,dl(f,i));
5252
F(eval,1)F(e,1)F(py2q,1)F(q2py,1)F(get,1)F(set,2)F(import,1)F(getattr,2)F(call,3)F(isp,1)F(setconv,1)F(getconv,1)js(&n,ss("numpy"));jk(&v,kb(!!N));
5353
t=t1();i=1;R xD(n,v);}
54+
// a kludge for python modules which try to resolve main e.g. scipy.optimize
55+
int main(){}

Diff for: py.h

+13
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ typedef struct _p _p,*P;struct _p{L r;P t;L n;union{P*p;P v[1];};};typedef struc
3232
X(P,PyErr_SetString,(P,S))\
3333
X(I,PyGILState_Ensure,())\
3434
X(V,PyGILState_Release,(I))\
35+
X(I,PyGILState_Check,())\
3536
X(V,PyEval_InitThreads,())\
3637
X(I,PyEval_ThreadsInitialized,())\
3738
X(V*,PyGILState_GetThisThreadState,())\
@@ -115,3 +116,15 @@ ZI pyn(V**v){
115116
#define X(r,n,a,i) U(n=(T##n(*)a)v[i])
116117
NF
117118
R 1;}
119+
ZI pyi(){
120+
#if _WIN32
121+
I ifd,nfd;HANDLE h;
122+
P(INVALID_HANDLE_VALUE==(h=CreateFile("nul",GENERIC_READ,0,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL)),-1);P(-1==(nfd=_open_osfhandle((intptr_t)h,0)),(CloseHandle(h),-1));
123+
P(-1==(ifd=dup(fileno(stdin))),(_close(nfd),-1));P(-1==dup2(nfd,fileno(stdin)),(_close(nfd),_close(ifd),-1));
124+
Py_InitializeEx(0);
125+
dup2(ifd,fileno(stdin));_close(nfd);_close(ifd);
126+
#else
127+
Py_InitializeEx(0);
128+
#endif
129+
R 0;
130+
}

Diff for: test.q

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
\l p.q
22
\d .t
3-
n:ne:nf:0
3+
n:ne:nf:ns:0
44
pt:{-2 $[first[x]~`..err;err;fail][x;y]}
55
i:{` sv" ",/:` vs x}
6-
ge:{v:.Q.trp[x;y;{(`..err;x,"\n",.Q.sbt 1#y)}];n+:1;if[not(1b~v)|(::)~v;pt[v](y;file)]}
6+
ge:{if[not P;n+:1;ns+:1;:(::)];v:.Q.trp[x;y;{(`..err;x,"\n",.Q.sbt 1#y)}];n+:1;if[not(1b~v)|(::)~v;pt[v](y;file)]}
7+
P:1;N:0;MM:0#`
8+
requiremod:{if[0~first u:@[.p.import;x;{(0;x)}];P::0;-2"WARN: can't import: ",string[x],", remainder of ",file," skipped, error was:\n\n\t",u[1],"\n";MM,:x]}
79
e:ge value;.p.e:ge .p.e
810
err:{ne+:1;"ERROR:\n test:\n",i[y 0]," message:\n",i[x 1]," file:\n",i y 1}
911
fail:{nf+:1;"FAIL:\n test:\n",i[y 0]," result:\n",i[.Q.s x]," file:\n",i y 1}
10-
{file::x;system"l ",x}each $[count .z.x;.z.x;"tests/",/:string u@:where(u:til`:tests)like"*.t"];
11-
tn:{`$(0-x=1)_"tests"}
12-
if[ne+nf;-2" "sv string(`failed;nf;tn nf;`errored;ne;tn ne;n;`total;tn n);exit 1]
12+
{N+:1;P::1;file::x;system"l ",x}each $[count .z.x;.z.x;"tests/",/:string u@:where(u:til`:tests)like"*.t"];
13+
msg:{", "sv{":"sv string(x;y)}'[key x;value x]}`failed`errored`skipped`total!nf,ne,ns,n;
14+
if[(ne+nf);-2 msg;exit 1]
15+
if[ns;-2"These modules required for tests couldn't be imported:\n\t",("\n\t"sv string distinct MM),"\n\ntry running\n\tpip install -r tests/requirements.txt\n\nor with conda\n\tconda install --file tests/requirements.txt\n";-2 msg];
1316
\\

Diff for: tests/basic.t

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
x:(0;1h;"str";`sym)
55
r:(0;1; "str";"sym")
66
r~.p.eval["lambda x:x";<]x
7+
.t.requiremod`numpy
78
p)import numpy as np
89
p)a=np.arange(6,dtype=np.int64).reshape(2,3)
910
(2 3#til 6)~.p.py2q .p.pyget`a

Diff for: tests/bs4.t

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.t.requiremod`bs4
12
bs:.p.import[`bs4]`:BeautifulSoup
23
bsobj:bs[.Q.hg`:http://code.kx.com/q/ref/adverbs/;"html.parser"]
34
m_find_all:bsobj[`:find_all;*]

Diff for: tests/curvefit.t

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
.t.requiremod`scipy.optimize
12
cf:.p.import[`scipy.optimize;`:curve_fit;<]
23
(enlist 2f;enlist enlist 3.4660897158452992e-32)~cf[{x xexp y};0 1 2 3 4;0 1 4 9 16f;1f]

Diff for: tests/fortran.t

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.t.requiremod`numpy
12
p)import numpy as np
23
p)a=np.arange(6).reshape(2,3)
34
p)b=np.asfortranarray(a)

Diff for: tests/matplotlib.t

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/ https://github.com/JuliaPy/PyPlot.jl/issues/278
22
if[count r:@[read0;`$.p.import[`sys;`:exec_prefix;`],"/qt.conf";""];.p.import[`os;`:putenv;`QT_PLUGIN_PATH;(trim(1+r?"=")_ r:first r where r like"Prefix*"),"/plugins"]]
3+
requiremod`matplotlib
34
p)import matplotlib as mpl
45
p)mpl.use('Agg')
6+
requiremod`matplotlib.pyplot
57
p)import matplotlib.pyplot as plt
68
.p.set[`x]x:til[50]%50
79
.p.set[`y]sin[4*x*4*atan 1]*exp -5*x

Diff for: tests/memory.t

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
R:@[{.p.e x;1b};"import resource";0b]
1+
.t.requiremod`resource
2+
R:@[{.p.import x;1b};`resource;0b]
3+
if[R;.p.e"import resource"];
24
pmem:{$[.z.o~`m64;0;$[R;.p.qeval"resource.getrusage(resource.RUSAGE_SELF).ru_maxrss";0]]}
35
a:til 100;
46
.p.set[`bbb]a;

Diff for: tests/pandas.t

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
requiremod`pandas
12
tab2df:{
23
r:.p.import[`pandas;`:DataFrame.from_dict;flip 0!x][@;cols x];
34
$[count k:keys x;r[`:set_index]k;r]}

Diff for: tests/syntax.t

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Numpy
22

3+
.t.requiremod`numpy
34
np:.p.import`numpy
45
t:"f"$til@
56

Diff for: tests/tensorflow.t

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.t.requiremod`tensorflow
12
/ tensorflow tests
23
setenv[`TF_CPP_MIN_LOG_LEVEL]1#"2"
34
p)import tensorflow as tf

Diff for: tests/time.t

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
T:10#t:.z.p;f:.p.py2q .p.q2py@
2+
.t.requiremod`numpy
23
("j"$x)~f x:"p"$t
34
("j"$x)~f x:"m"$t
45
("j"$x)~f x:"d"$t

0 commit comments

Comments
 (0)