Compare commits
7 Commits
1345f6e4c9
...
v1.2.12
Author | SHA1 | Date | |
---|---|---|---|
617ed541e3 | |||
![]() |
aa020eee0c | ||
![]() |
b110886935 | ||
![]() |
6bc6880d47 | ||
![]() |
b51b63dedc | ||
![]() |
601613b6c4 | ||
5e93ed0706 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -15,6 +15,7 @@ cython/*.cpp
|
|||||||
|
|
||||||
*.log
|
*.log
|
||||||
*.so
|
*.so
|
||||||
|
*.pyd
|
||||||
*.o
|
*.o
|
||||||
*.csv
|
*.csv
|
||||||
*.parquet
|
*.parquet
|
||||||
@@ -29,3 +30,4 @@ pip/README.md
|
|||||||
pip/LICENSE
|
pip/LICENSE
|
||||||
pip/*egg-info
|
pip/*egg-info
|
||||||
pip/dist/
|
pip/dist/
|
||||||
|
pip/build/
|
||||||
|
@@ -1,6 +1,28 @@
|
|||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
print("building on platform: "+sys.platform)
|
||||||
|
os.system("git tag -l --sort=version:refname > gittags.log")
|
||||||
|
with open ("gittags.log","r") as gt:
|
||||||
|
taglst = gt.readlines()
|
||||||
|
os.remove("gittags.log")
|
||||||
|
if len(taglst) > 0 :
|
||||||
|
version = taglst[-1].replace('\n','').replace('v','')
|
||||||
|
else:
|
||||||
|
version = 'unkown'
|
||||||
|
print("building version: "+version)
|
||||||
|
|
||||||
|
if sys.platform == "linux" or sys.platform == "darwin" :
|
||||||
|
cmpargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
lnkargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
elif sys.platform == "win32" :
|
||||||
|
cmpargs = ['/EHsc','/std:c++17']
|
||||||
|
lnkargs = []
|
||||||
|
else :
|
||||||
|
raise RuntimeError("unknown platform")
|
||||||
|
|
||||||
extensions = Extension(
|
extensions = Extension(
|
||||||
name="imc_termite",
|
name="imc_termite",
|
||||||
@@ -9,13 +31,13 @@ extensions = Extension(
|
|||||||
# library_dirs=["lib"],
|
# library_dirs=["lib"],
|
||||||
include_dirs=["lib"],
|
include_dirs=["lib"],
|
||||||
language='c++',
|
language='c++',
|
||||||
extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
extra_compile_args=cmpargs,
|
||||||
extra_link_args=['-std=c++17'],
|
extra_link_args=lnkargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="imc_termite",
|
name='imc_termite',
|
||||||
version='1.2.9',
|
version='1.2.11',
|
||||||
description='IMCtermite cython extension',
|
description='IMCtermite cython extension',
|
||||||
author='Record Evolution GmbH',
|
author='Record Evolution GmbH',
|
||||||
author_email='mario.fink@record-evolution.de',
|
author_email='mario.fink@record-evolution.de',
|
||||||
|
@@ -108,7 +108,8 @@ namespace imc
|
|||||||
std::string joinvec(std::vector<dt> myvec, unsigned long int limit = 10, int prec = 10, bool fixed = true)
|
std::string joinvec(std::vector<dt> myvec, unsigned long int limit = 10, int prec = 10, bool fixed = true)
|
||||||
{
|
{
|
||||||
// include entire list for limit = 0
|
// include entire list for limit = 0
|
||||||
limit = (limit == 0) ? myvec.size() : limit;
|
unsigned long int myvecsize = (unsigned long int)myvec.size();
|
||||||
|
limit = (limit == 0) ? myvecsize : limit;
|
||||||
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss<<"[";
|
ss<<"[";
|
||||||
@@ -122,14 +123,14 @@ namespace imc
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned long int heals = (unsigned long int)(limit/2.);
|
unsigned long int heals = limit/2;
|
||||||
for ( unsigned long int i = 0; i < heals; i++ )
|
for ( unsigned long int i = 0; i < heals; i++ )
|
||||||
{
|
{
|
||||||
customize_stream(ss,prec,fixed);
|
customize_stream(ss,prec,fixed);
|
||||||
ss<<myvec[i]<<",";
|
ss<<myvec[i]<<",";
|
||||||
}
|
}
|
||||||
ss<<"...";
|
ss<<"...";
|
||||||
for ( unsigned long int i = myvec.size()-heals; i < myvec.size(); i++ )
|
for ( unsigned long int i = myvecsize-heals; i < myvecsize; i++ )
|
||||||
{
|
{
|
||||||
customize_stream(ss,prec,fixed);
|
customize_stream(ss,prec,fixed);
|
||||||
ss<<myvec[i]<<",";
|
ss<<myvec[i]<<",";
|
||||||
@@ -296,9 +297,9 @@ namespace imc
|
|||||||
tms.tm_year = std::stoi(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[4])) - 1900;
|
tms.tm_year = std::stoi(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[4])) - 1900;
|
||||||
tms.tm_hour = std::stoi(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[5]));
|
tms.tm_hour = std::stoi(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[5]));
|
||||||
tms.tm_min = std::stoi(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[6]));
|
tms.tm_min = std::stoi(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[6]));
|
||||||
double secs = std::stold(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[7]));
|
long double secs = std::stold(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[7]));
|
||||||
double secs_int;
|
double secs_int;
|
||||||
trigger_time_frac_secs_ = modf(secs,&secs_int);
|
trigger_time_frac_secs_ = modf((double)secs,&secs_int);
|
||||||
tms.tm_sec = (int)secs_int;
|
tms.tm_sec = (int)secs_int;
|
||||||
|
|
||||||
// generate std::chrono::system_clock::time_point type
|
// generate std::chrono::system_clock::time_point type
|
||||||
@@ -384,7 +385,7 @@ namespace imc
|
|||||||
// fill xdata_
|
// fill xdata_
|
||||||
for ( unsigned long int i = 0; i < num_values; i++ )
|
for ( unsigned long int i = 0; i < num_values; i++ )
|
||||||
{
|
{
|
||||||
xdata_.push_back(xoffset_+i*xstepwidth_);
|
xdata_.push_back(xoffset_+(double)i*xstepwidth_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// employ data transformation
|
// employ data transformation
|
||||||
@@ -392,8 +393,9 @@ namespace imc
|
|||||||
{
|
{
|
||||||
for ( imc::datatype& el: ydata_ )
|
for ( imc::datatype& el: ydata_ )
|
||||||
{
|
{
|
||||||
// std::cout<<"value:"<<el.as_double()<<"\n";
|
//std::cout<<"value:"<<el.as_double()<<"\n";
|
||||||
el = imc::datatype(el.as_double()*factor_ + offset_);
|
double fact = ( factor_ == 0.0 ) ? 1.0 : factor_;
|
||||||
|
el = imc::datatype(el.as_double()*fact + offset_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
makefile
10
makefile
@@ -17,13 +17,13 @@ HPP = $(wildcard $(LIB)/*.hpp)
|
|||||||
# choose compiler and its options
|
# choose compiler and its options
|
||||||
CC = g++ -std=c++17
|
CC = g++ -std=c++17
|
||||||
#OPT = -O3 -Wall -mavx -mno-tbm -mf16c -mno-f16c
|
#OPT = -O3 -Wall -mavx -mno-tbm -mf16c -mno-f16c
|
||||||
OPT = -O3 -Wall -Werror -Wunused-variable -Wsign-compare
|
OPT = -O3 -Wall -Wconversion -Wpedantic -Werror -Wunused-variable -Wsign-compare
|
||||||
|
|
||||||
# determine git version/commit and release tag
|
# determine git version/commit and release tag
|
||||||
GTAG := $(shell git tag | tail -n1)
|
GTAG := $(shell git tag -l --sort=version:refname | tail -n1)
|
||||||
GHSH := $(shell git rev-parse HEAD | head -c8)
|
GHSH := $(shell git rev-parse HEAD | head -c8)
|
||||||
RTAG := v$(shell cat pip/setup.py | grep version | grep -oP "([0-9]\.){2}[0-9]")
|
RTAG := v$(shell cat pip/setup.py | grep version | grep -oP "([0-9]\.){2}[0-9]{1,2}")
|
||||||
CTAG := v$(shell cat cython/setup.py | grep version | grep -oP "([0-9]\.){2}[0-9]")
|
CTAG := v$(shell cat cython/setup.py | grep version | grep -oP "([0-9]\.){2}[0-9]{1,2}")
|
||||||
|
|
||||||
# define install location
|
# define install location
|
||||||
INST := /usr/local/bin
|
INST := /usr/local/bin
|
||||||
@@ -99,7 +99,7 @@ cython-clean :
|
|||||||
# pip
|
# pip
|
||||||
|
|
||||||
pip-release: check-vtag $(RTAG) cython-build
|
pip-release: check-vtag $(RTAG) cython-build
|
||||||
cd ./pip/ && make publish
|
cd ./pip/ && make publish-source
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------#
|
#-----------------------------------------------------------------------------#
|
||||||
# clean
|
# clean
|
||||||
|
14
pip/makefile
14
pip/makefile
@@ -2,15 +2,23 @@
|
|||||||
|
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
|
|
||||||
publish: sdist upload
|
publish-source: sdist upload
|
||||||
|
publish-binary: bdist upload
|
||||||
|
|
||||||
sdist: ../cython/py_imc_termite.pyx ../cython/imc_termite.pxd ../cython/py_imc_termite.cpp
|
prepdist: ../cython/py_imc_termite.pyx ../cython/imc_termite.pxd ../cython/py_imc_termite.cpp
|
||||||
cp -v $? ./
|
cp -v $? ./
|
||||||
cp -v $(shell ls ../lib/imc_*.hpp) ./
|
cp -v $(shell ls ../lib/imc_*.hpp) ./
|
||||||
tail -n 212 ../README.md > ./README.md
|
cat ../README.md | grep '^# IMCtermite' -A 50000 > ./README.md
|
||||||
cp -v ../LICENSE ./
|
cp -v ../LICENSE ./
|
||||||
|
|
||||||
|
sdist: prepdist
|
||||||
python3 setup.py sdist
|
python3 setup.py sdist
|
||||||
|
|
||||||
|
# TODO use manylinux wheel to avoid ERROR "unsupported platform tag 'linux_x86_64'"
|
||||||
|
# see: - https://github.com/pypa/manylinux
|
||||||
|
bdist: prepdist
|
||||||
|
python3 setup.py bdist_wheel
|
||||||
|
|
||||||
# authentication:
|
# authentication:
|
||||||
# - username: __token__
|
# - username: __token__
|
||||||
# - password: <token value including pypi-prefix>
|
# - password: <token value including pypi-prefix>
|
||||||
|
@@ -18,7 +18,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="IMCtermite",
|
name="IMCtermite",
|
||||||
version="1.2.9",
|
version="1.2.11",
|
||||||
author="Record Evolution GmbH",
|
author="Record Evolution GmbH",
|
||||||
author_email="mario.fink@record-evolution.de",
|
author_email="mario.fink@record-evolution.de",
|
||||||
maintainer="Record Evolution GmbH",
|
maintainer="Record Evolution GmbH",
|
||||||
|
Reference in New Issue
Block a user