dynamicsandneuralsystems / catch22 Goto Github PK
View Code? Open in Web Editor NEWcatch22: CAnonical Time-series CHaracteristics
Home Page: https://time-series-features.gitbook.io/catch22
License: GNU General Public License v3.0
catch22: CAnonical Time-series CHaracteristics
Home Page: https://time-series-features.gitbook.io/catch22
License: GNU General Public License v3.0
fedora/pass300/20220906/catch22.spec.out:IN_AutoMutualInfoStats.c:44:19: warning: suggest parentheses around comp
arison in operand of '&' [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:PD_PeriodicityWang.c:66:20: warning: suggest parentheses around comparis
on in operand of '&' [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:PD_PeriodicityWang.c:72:25: warning: suggest parentheses around comparis
on in operand of '&' [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:SB_BinaryStats.c:40:20: warning: suggest parentheses around comparison i
n operand of '|' [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:SB_BinaryStats.c:78:20: warning: suggest parentheses around comparison i
n operand of '|' [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:SP_Summaries.c:86:13: warning: suggest parentheses around comparison in
operand of '&' [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:splinefit.c:606:14: warning: suggest parentheses around comparison in op
erand of '&' [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:../C/IN_AutoMutualInfoStats.c:44:19: warning: suggest parentheses around
comparison in operand of ‘&’ [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:../C/PD_PeriodicityWang.c:66:20: warning: suggest parentheses around com
parison in operand of ‘&’ [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:../C/PD_PeriodicityWang.c:72:25: warning: suggest parentheses around com
parison in operand of ‘&’ [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:../C/SB_BinaryStats.c:40:20: warning: suggest parentheses around compari
son in operand of ‘|’ [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:../C/SB_BinaryStats.c:78:20: warning: suggest parentheses around compari
son in operand of ‘|’ [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:../C/SP_Summaries.c:86:13: warning: suggest parentheses around compariso
n in operand of ‘&’ [-Wparentheses]
fedora/pass300/20220906/catch22.spec.out:../C/splinefit.c:606:14: warning: suggest parentheses around comparison
in operand of ‘&’ [-Wparentheses]
I checked the first two, presumably the rest are the same.
OS: Ubuntu 18.04
Python version: 3.6.3
Catch22 version: 0.0.1
Issue description:
I generate dataframe with small amount of data in columns (1,2,3,4 elements, etc.). I try to use catch22_all method in a case when amount of data is equal to 2 and I have dead kernel as output.
Code example:
groups = df.groupby(["column_id"]).groups
for id_group, idx in groups.items():
group_data = df.loc[idx].drop(["column_id"], axis=1)
# Dead kernel when group_data.shape[0] == 2
buf = pd.DataFrame([f for f in group_data.apply(catch22.catch22_all)])
I am interested in understanding whether there exists a minimum length requirement or a lower bound for the length of a time series.
or else the compilation will fail in Linux.
setup_P3.py :
the c++ extension module
extension_mod = Extension("catch22_C",
sources=["catch22_wrap_P3.c"] + sourceFileList,
include_dirs=[sourceDir],
extra_compile_args = ['-std=c99']
)
Python:
active environment : base
active env location : /opt/anaconda
shell level : 1
user config file : /root/.condarc
populated config files : /root/.condarc
conda version : 4.9.2
conda-build version : 3.17.8
python version : 3.7.3.final.0
virtual packages : __glibc=2.27=0
__unix=0=0
__archspec=1=x86_64
gcc
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
When running pip install catch22
, the C compilation seems to complain. I tried it with python 3.7-3.9.
C/CO_AutoCorr.c:531:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int j = 0; j < numBins; j++){
^
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/cxx579/anaconda3/envs/test_env/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l6lnk30h/catch22_0230d4e651e84fa1a6f4489c53513e34/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l6lnk30h/catch22_0230d4e651e84fa1a6f4489c53513e34/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'"'"'))' install --record /tmp/pip-record-g8rdn06o/install-record.txt --single-version-externally-managed --compile --install-headers /home/cxx579/anaconda3/envs/test_env/include/python3.9/catch22 Check the logs for full command output.
I am not an expert in C and how it tights up with the Python wrapper but it might. have to do with this? Any ideas how to fix this. Thx :D
This issue can be fixed by
export CFLAGS="-std=c99"
However, it might be good to change the for loop instantiation that is more compatible by declaring the the iteration variable outside the loop like:
int i;
for (i=0;i<10;i++) { ..
Hi,
Any chance to make catch22
available on conda-forge
?
Whenever I use python 2 or 3, and whenever I use mingw32 or msvc....
Could you please help ?
Hello!
We package and maintain catch22 for Fedora Linux. Now that pycatch22 has been split into its own repo and bundles the C sources, we were wondering if:
The advantage of this is that we won't need to bundle catch22 in pycatch22, and that catch22 is provided as a library for people using C to use.
@musicinmybrain has created a pull request that generates the shared library (by adding a Makefile and so on) here. The main question here, as you'll see from that pull request, is whether you (upstream) intend to provide it as a C library, and if you do, would you be committing to ABI/shared object versioning etc. to notify users of changes and so on?
Link to the libtool documentation on versioning: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning
Been trying to install the R wrapper without much success (though more success than I've had with the Python and Matlab wrappers!). I noticed a few issues with the documentation along the way, and have noted them here along with the error I get:
The install docs refer to./C_functions
, but this directory appears to be./C
in current builds.
I think the .c and .h files are supposed to be moved to ./wrap_R/catch22/src
, rather than ./wrap_R/src
(which is specified in the install instructions, but does not actually exist unless I manually create it).
Running R CMD INSTALL catch22_x.y.tar.gz
only “works” in the latter case, and then only if R CMD build catch22
was run after the .c and .h files are copied to ./wrap_R/catch22/src
. Attempting to build with these files in ./wrap_R/src
causes the following error:
catch22_wrap.cpp:5:25: fatal error: CO_AutoCorr.h: No such file or directory
The docs should clarify that users should replace catch22_x.y.tar.gz
with the tar file generated by the previous step. The name of this fill will depend on their version of catch22.
Fixing the error related to the location of the C files got me as far as the following error. Any advice would be appreciated:
(r-environment) # dlurie@nx2 in ~/Software/catch22/wrap_R [17:55:06]
$ R CMD INSTALL catch22_0.1.tar.gz
* installing to library \u2018/home/despoB/dlurie/anaconda3/envs/r-environment/lib/R/library\u2019
* installing *source* package \u2018catch22\u2019 ...
** libs
gcc -std=gnu99 -I/home/despoB/dlurie/anaconda3/envs/r-environment/lib/R/include -DNDEBUG -I../inst/include -I"/home/despoB/dlurie/anaconda3/envs/r-environment/lib/R/library/Rcpp/include" -I/home/despoB/dlurie/anaconda3/envs/r-environment/include -fpic -I/home/despoB/dlurie/anaconda3/envs/r-environment/include -c CO_AutoCorr.c -o CO_AutoCorr.o
In file included from CO_AutoCorr.c:8:0:
CO_AutoCorr.c: In function \u2018CO_AutoCorr\u2019:
fft.h:16:43: error: \u2018_Imaginary_I\u2019 undeclared (first use in this function)
#define CMPLX(x, y) ((cplx)((double)(x) + _Imaginary_I * (double)(y)))
^
CO_AutoCorr.c:63:16: note: in expansion of macro \u2018CMPLX\u2019
F[i] = CMPLX(y[i] - m, 0.0);
^
fft.h:16:43: note: each undeclared identifier is reported only once for each function it appears in
#define CMPLX(x, y) ((cplx)((double)(x) + _Imaginary_I * (double)(y)))
^
CO_AutoCorr.c:63:16: note: in expansion of macro \u2018CMPLX\u2019
F[i] = CMPLX(y[i] - m, 0.0);
^
CO_AutoCorr.c: In function \u2018co_autocorrs\u2019:
fft.h:16:43: error: \u2018_Imaginary_I\u2019 undeclared (first use in this function)
#define CMPLX(x, y) ((cplx)((double)(x) + _Imaginary_I * (double)(y)))
^
CO_AutoCorr.c:97:16: note: in expansion of macro \u2018CMPLX\u2019
F[i] = CMPLX(y[i] - m, 0.0);
^
make: *** [CO_AutoCorr.o] Error 1
ERROR: compilation failed for package \u2018catch22\u2019
* removing \u2018/home/despoB/dlurie/anaconda3/envs/r-environment/lib/R/library/catch22\u2019
Hi,
I have problem to install your package from R...following errors occurred:
Any idea?
Thx
Using the new method of linearly interpolating to estimate the 1/e crossing, CO_f1ecac
gives an output that is 1
greater than expected.
Compare the hctsa matlab output for test.txt
:
>> a = CO_FirstCrossing((x), [], 1/exp(1))
a =
struct with fields:
firstCrossing: 33
pointOfCrossing: 32.5026
To the catch22 output:
33.50260547693646, CO_f1ecac, 0.186000
Edit CO_f1ecac()
in CO_AutoCorr.c
to return i + dx - 1
, or index by i
and i+1
(rather than i-1
and i
).
I am using Sagemaker notebook and failed to install catch22 package.
Tried to add 'extra_compile_args = ['-std=c99']' before running 'pip install catch22'. Getting the following error:
C/SC_FluctAnal.c:12:5: note: use option -std=c99 or -std=gnu99 to compile your code
Ideally, the version should be updated or can be made deprecated. But should not be removed from the repository(PyPi). Can you please upload them back with some new versions tags ?
I tried pip install catch22
and got a long error log. These are the last few lines:
C/SP_Summaries.c:161:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < nWelch; i ++){
^
C/SP_Summaries.c:173:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i=0; i<nWelch/5; i++){
^
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/username/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kiwf2hln/catch22/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kiwf2hln/catch22/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jtj01ddj/install-record.txt --single-version-externally-managed --compile --install-headers /home/username/anaconda3/include/python3.7m/catch22 Check the logs for full command output.
System: Anaconda3, CentOS 7
Any ideas?
Windows 10 64 python 3.6 and when I want to setup this library I get:
python setup_P3.py build
"error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.22.27905\bin\HostX86\x64\cl.exe' failed with exit status 2"
Hello,
Thanks for the great package! We're working on including it in NeuroFedora now.
Is there any chance you could test the package with GNU Octave to support it? Octave is a Free/Open source Matlab compatible tool, so that will make catch22 even more accessible/Open.
In the meantime, we'll support all the non Matlab bits in NeuroFedora. Thanks again.
In release 0.4.0, the Python package instead has version 0.3.1.
Line 17 in 2e1a271
catch22/wrap_Python/setup_P3.py
Line 17 in 2e1a271
I've been getting segmentation faults whenever I try to run the python version. For smaller data sets it works fine. Here I'm using a data set of size 100x10000. As soon as I go to 200x10000 it gets hung up. The iteration that it breaks on changes from attempt to attempt. Sometimes it breaks on iteration 150. Sometimes on 174. Seems like a memory problem?
Get a segmentation fault when running catch22.catch22_all
on short lists/numpy.arrays.
Returns a dictionary of features (perhaps with a lot of NaN-types due to the short timeseries)
>>> import catch22
>>> catch22.catch22_all([1,2])
Segmentation fault
Can check that this doesn't happen with longer arrays like so:
import catch22
timeseries = list(range(10))
while timeseries:
print(len(timeseries))
catch22.catch22_all(timeseries)
timeseries = timeseries[:-1]
Is it possible to calculate features in a rolling window? In pandas rolling().apply() it is too slow.
The files in MATLAB/
generally have license and copyright statements with “(at your option) any later version” language, so I’m confident they are intended to be, in SPDX terms, GPL-3.0-or-later
.
However, the other files in the repository lack comment headers with license and copyright statements, and there doesn’t appear to be any overall license and copyright statement for the repository. The trove classifier for the Python bindings is License :: OSI Approved :: GNU General Public License v3 (GPLv3)
, which is ambiguous.
Could you please clarify which files are GPL-3.0-or-later
and which, if any, are GPL-3.0-only
?
Testing has revealed differences in catch22 results across platforms/compilers (mac/windows/linux)/(Clang/gcc)
There is a difficulty in compiling using python3. E.g., python3 setup.py build
gives the following:
running build
running build_ext
building 'catch22_C' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.7
creating build/C
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include -arch x86_64 -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include -arch x86_64 -I../C/ -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include/python3.7m -c catch22_wrap.c -o build/temp.macosx-10.7-x86_64-3.7/catch22_wrap.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include -arch x86_64 -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include -arch x86_64 -I../C/ -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include/python3.7m -c ../C/MD_hrv.c -o build/temp.macosx-10.7-x86_64-3.7/../C/MD_hrv.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include -arch x86_64 -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include -arch x86_64 -I../C/ -I/Users/alex/miniconda3/envs/pipe-516-ram-mating-behaviour/include/python3.7m -c ../C/SP_Summaries.c -o build/temp.macosx-10.7-x86_64-3.7/../C/SP_Summaries.o
In file included from ../C/CO_AutoCorr.h:9:0,
from ../C/SP_Summaries.c:9:
../C/SP_Summaries.c: In function 'welch':
../C/fft.h:16:43: error: '_Imaginary_I' undeclared (first use in this function)
#define CMPLX(x, y) ((cplx)((double)(x) + _Imaginary_I * (double)(y)))
^
../C/SP_Summaries.c:43:20: note: in expansion of macro 'CMPLX'
F[i] = CMPLX(xw[i] - m, 0.0);
^~~~~
../C/fft.h:16:43: note: each undeclared identifier is reported only once for each function it appears in
#define CMPLX(x, y) ((cplx)((double)(x) + _Imaginary_I * (double)(y)))
^
../C/SP_Summaries.c:43:20: note: in expansion of macro 'CMPLX'
F[i] = CMPLX(xw[i] - m, 0.0);
^~~~~
../C/SP_Summaries.c:71:13: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
if(i>0 & i < Nout-1){
~^~
error: command 'gcc' failed with exit status 1
Can fix? Or just limit to python2?
Referring to this code snippet in CO_AutoCorr.c
#define tau 2
#define numBins 5
double CO_HistogramAMI_even_2_5(const double y[], const int size)
Why tau is 2 and numBins is 5? Shouldn't it be vice-versa according to the implementation of hctsa feature
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.