Compare commits

...

6 Commits

Author SHA1 Message Date
Mario Fink
aa020eee0c * add pip/build to gitignore
* makefile for pip: extract proper section of README.md
* bump version 1.2.11
2021-09-02 11:56:06 +02:00
Mario Fink
b110886935 add *.pyd to gitignore, imc_channel.hpp: fix int size_t conversions 2021-09-02 11:22:37 +02:00
Mario Fink
6bc6880d47 fix/disable type conversion warnings 2021-09-02 11:16:01 +02:00
Mario Fink
b51b63dedc enable proper git tag sorting in cython/setup.py for versioning 2021-09-02 11:01:12 +02:00
Mario Fink
601613b6c4 consider platform dependency for building cython extension locally 2021-09-02 10:57:21 +02:00
5e93ed0706 * version 1.2.10
* makefile: versioning and tags: properly deal with multiple digits version tags
* setup.py: support both sdist and bdist pip wheels
2021-09-01 10:58:42 +02:00
6 changed files with 52 additions and 19 deletions

2
.gitignore vendored
View File

@@ -15,6 +15,7 @@ cython/*.cpp
*.log
*.so
*.pyd
*.o
*.csv
*.parquet
@@ -29,3 +30,4 @@ pip/README.md
pip/LICENSE
pip/*egg-info
pip/dist/
pip/build/

View File

@@ -1,6 +1,28 @@
from distutils.core import setup
from distutils.extension import Extension
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(
name="imc_termite",
@@ -9,13 +31,13 @@ extensions = Extension(
# library_dirs=["lib"],
include_dirs=["lib"],
language='c++',
extra_compile_args=['-std=c++17','-Wno-unused-variable'],
extra_link_args=['-std=c++17'],
extra_compile_args=cmpargs,
extra_link_args=lnkargs,
)
setup(
name="imc_termite",
version='1.2.9',
name='imc_termite',
version='1.2.11',
description='IMCtermite cython extension',
author='Record Evolution GmbH',
author_email='mario.fink@record-evolution.de',

View File

@@ -108,7 +108,8 @@ namespace imc
std::string joinvec(std::vector<dt> myvec, unsigned long int limit = 10, int prec = 10, bool fixed = true)
{
// 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;
ss<<"[";
@@ -122,14 +123,14 @@ namespace imc
}
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++ )
{
customize_stream(ss,prec,fixed);
ss<<myvec[i]<<",";
}
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);
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_hour = std::stoi(blocks_->at(chnenv_.NTuuid_).get_parameter(prms[5]));
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;
trigger_time_frac_secs_ = modf(secs,&secs_int);
trigger_time_frac_secs_ = modf((double)secs,&secs_int);
tms.tm_sec = (int)secs_int;
// generate std::chrono::system_clock::time_point type
@@ -384,7 +385,7 @@ namespace imc
// fill xdata_
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

View File

@@ -17,13 +17,13 @@ HPP = $(wildcard $(LIB)/*.hpp)
# choose compiler and its options
CC = g++ -std=c++17
#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
GTAG := $(shell git tag | tail -n1)
GTAG := $(shell git tag -l --sort=version:refname | tail -n1)
GHSH := $(shell git rev-parse HEAD | head -c8)
RTAG := v$(shell cat pip/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]")
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]{1,2}")
# define install location
INST := /usr/local/bin
@@ -99,7 +99,7 @@ cython-clean :
# pip
pip-release: check-vtag $(RTAG) cython-build
cd ./pip/ && make publish
cd ./pip/ && make publish-source
#-----------------------------------------------------------------------------#
# clean

View File

@@ -2,15 +2,23 @@
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 $(shell ls ../lib/imc_*.hpp) ./
tail -n 212 ../README.md > ./README.md
cat ../README.md | grep '^# IMCtermite' -A 50000 > ./README.md
cp -v ../LICENSE ./
sdist: prepdist
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:
# - username: __token__
# - password: <token value including pypi-prefix>

View File

@@ -18,7 +18,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setup(
name="IMCtermite",
version="1.2.9",
version="1.2.11",
author="Record Evolution GmbH",
author_email="mario.fink@record-evolution.de",
maintainer="Record Evolution GmbH",