Compare commits

..

13 Commits

Author SHA1 Message Date
8ca6ee3ddc github actions: fix Upload binary wheels PyPI 2025-02-03 20:56:17 +01:00
379feaa85a github actions: fix Upload binary wheels PyPI 2025-02-02 00:53:16 +01:00
cff2e913fc github actions: fix Upload binary wheels PyPI 2025-02-02 00:47:13 +01:00
75d70a9521 * github actions: fix Unable to download artifact(s): Artifact not found for name: binary-wheels
* README.md: structure and sort references
* bump v2.1.8
2025-02-02 00:30:56 +01:00
mario-fink
36cf0c9c18 Merge pull request #32 from jgoedeke/master
Bugfix trigger-time with XY Datasets
2025-01-25 01:15:19 +01:00
jgoedeke
2326725756 bugfix: set xprec to 9 for XY datasets 2025-01-23 15:07:12 +00:00
jgoedeke
59de48424e Fix absolute_trigger_time for XY datasets and remove addtime from output
Add-time is already implicitly provided by the difference between `trigger-time-nt` and `trigger-time` for normal datasets. For XY datasets the `addtime` parameter is not applicable.
2025-01-23 14:18:08 +00:00
jgoedeke
a44461cba6 Fix wrong keys in runtime errors 2025-01-23 14:15:52 +00:00
cee146593b github actions: fix Unable to download artifact(s): Artifact not found for name: binary-wheels 2025-01-22 19:58:58 +01:00
223f25b6e0 github actions: fix Failed to CreateArtifact: Received non-retryable error: Failed request: (409) 2025-01-22 00:40:24 +01:00
8ec02d21c5 github actions: fix Failed to CreateArtifact: Received non-retryable error: Failed request: (409) 2025-01-22 00:20:57 +01:00
df445bfd7f github actions: update runner-images 2025-01-22 00:04:49 +01:00
af6622492a deprecated version of actions/upload-artifact, upgrade to v4 2025-01-21 00:40:05 +01:00
5 changed files with 42 additions and 22 deletions

View File

@@ -10,16 +10,18 @@ jobs:
build_setup: build_setup:
name: Prepare environment for wheel builds name: Prepare environment for wheel builds
runs-on: ubuntu-20.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Prepare wheel build - name: Prepare wheel build
run: make -C python/ setup run: make -C python/ setup
- name: Store wheel configuration files - name: Store wheel configuration files
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4.6.0
with: with:
name: wheel-config name: wheel-config
path: python/ path: python/
- name: Display files
run: ls -lR
build_wheels: build_wheels:
name: Build binary wheels on ${{ matrix.os }} name: Build binary wheels on ${{ matrix.os }}
@@ -27,7 +29,7 @@ jobs:
needs: [build_setup] needs: [build_setup]
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, windows-2019] os: [ubuntu-24.04, windows-2022]
arch: [auto32, auto64, aarch64] arch: [auto32, auto64, aarch64]
steps: steps:
@@ -46,14 +48,14 @@ jobs:
# env: # env:
# CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* # CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-*
- name: Store binary wheels - name: Store binary wheels
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4.6.0
with: with:
name: binary-wheels name: binary-wheels-${{matrix.os}}-${{matrix.arch}}
path: python/wheelhouse/*.whl path: python/wheelhouse/*.whl
build_sdist: build_sdist:
name: Build source distribution name: Build source distribution
runs-on: ubuntu-latest runs-on: ubuntu-24.04
needs: [build_setup] needs: [build_setup]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -68,15 +70,17 @@ jobs:
run: python setup.py sdist run: python setup.py sdist
working-directory: python/ working-directory: python/
- name: Store source wheels - name: Store source wheels
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4.6.0
with: with:
name: source-wheels name: source-wheels
path: python/dist/*.tar.gz path: python/dist/*.tar.gz
- name: Display files
run: ls -lR
upload_pypi: upload_pypi:
name: Upload binary wheels to PyPI name: Upload binary wheels to PyPI
runs-on: ubuntu-20.04 runs-on: ubuntu-24.04
needs: [build_wheels, build_sdist] needs: [build_wheels, build_sdist]
steps: steps:
@@ -84,12 +88,15 @@ jobs:
uses: actions/download-artifact@v4.1.7 uses: actions/download-artifact@v4.1.7
with: with:
name: source-wheels name: source-wheels
path: dist/ path: sdist/
- name: Get binary wheels - name: Get binary wheels
uses: actions/download-artifact@v4.1.7 uses: actions/download-artifact@v4.1.7
with: with:
name: binary-wheels path: bdist/
path: dist/ pattern: binary-wheels-*
merge-multiple: true
- name: Display files
run: ls -lR
- uses: pypa/gh-action-pypi-publish@release/v1 - uses: pypa/gh-action-pypi-publish@release/v1
with: with:

View File

@@ -222,18 +222,31 @@ can be found in the `python/examples` folder.
## References ## References
### IMC
- https://www.imc-tm.de/produkte/messtechnik-software/imc-famos/funktionen/im-und-export/ - https://www.imc-tm.de/produkte/messtechnik-software/imc-famos/funktionen/im-und-export/
- https://www.imc-tm.de/produkte/messtechnik-hardware/imc-cronosflex/ueberblick/ - https://www.imc-tm.de/produkte/messtechnik-hardware/imc-cronosflex/ueberblick/
- https://www.imc-tm.de/download-center/produkt-downloads/imc-famos/handbuecher - https://www.imc-tm.de/download-center/produkt-downloads/imc-famos/handbuecher
- https://www.imc-tm.de/fileadmin/Public/Downloads/Manuals/imc_FAMOS/imcGemeinsameKomponenten.pdf - https://www.imc-tm.de/fileadmin/Public/Downloads/Manuals/imc_FAMOS/imcGemeinsameKomponenten.pdf
- https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html
- https://github.com/Apollo3zehn/ImcFamosFile - https://github.com/Apollo3zehn/ImcFamosFile
- https://apollo3zehn.github.io/ImcFamosFile/api/ImcFamosFile.FamosFileKeyType.html - https://apollo3zehn.github.io/ImcFamosFile/api/ImcFamosFile.FamosFileKeyType.html
### Cython
- https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html
### PyPI
- https://pypi.org/help/#apitoken - https://pypi.org/help/#apitoken
- https://sgoel.dev/posts/uploading-binary-wheels-to-pypi-from-github-actions/ - https://sgoel.dev/posts/uploading-binary-wheels-to-pypi-from-github-actions/
- https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun - https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml - https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
- https://cibuildwheel.readthedocs.io/en/stable/deliver-to-pypi/ - https://cibuildwheel.readthedocs.io/en/stable/deliver-to-pypi/
- https://github.com/actions/download-artifact#download-all-artifacts
- https://github.com/actions/download-artifact?tab=readme-ov-file#download-multiple-filtered-artifacts-to-the-same-directory
### iconv
- https://www.gnu.org/software/libiconv/ - https://www.gnu.org/software/libiconv/
- https://vcpkg.io/en/packages.html - https://vcpkg.io/en/packages.html
- https://vcpkg.io/en/getting-started - https://vcpkg.io/en/getting-started

View File

@@ -393,7 +393,6 @@ namespace imc
ybuffer_offset_ = comp_group1.Cb_.offset_buffer_; ybuffer_offset_ = comp_group1.Cb_.offset_buffer_;
ybuffer_size_ = comp_group1.Cb_.number_bytes_; ybuffer_size_ = comp_group1.Cb_.number_bytes_;
xstart_ = comp_group1.Cb_.x0_; xstart_ = comp_group1.Cb_.x0_;
addtime_ = static_cast<long int>(comp_group1.Cb_.add_time_);
yfactor_ = comp_group1.CR_.factor_; yfactor_ = comp_group1.CR_.factor_;
yoffset_ = comp_group1.CR_.offset_; yoffset_ = comp_group1.CR_.offset_;
yunit_ = comp_group1.CR_.unit_; yunit_ = comp_group1.CR_.unit_;
@@ -407,6 +406,10 @@ namespace imc
std::time_t ts = timegm(&comp_group1.NT_.tms_); // std::mktime(&tms); std::time_t ts = timegm(&comp_group1.NT_.tms_); // std::mktime(&tms);
trigger_time_ = std::chrono::system_clock::from_time_t(ts); trigger_time_ = std::chrono::system_clock::from_time_t(ts);
trigger_time_frac_secs_ = comp_group1.NT_.trigger_time_frac_secs_; trigger_time_frac_secs_ = comp_group1.NT_.trigger_time_frac_secs_;
// calculate absolute trigger-time
addtime_ = static_cast<long int>(comp_group1.Cb_.add_time_);
absolute_trigger_time_ = trigger_time_ + std::chrono::seconds(addtime_);
// + std::chrono::nanoseconds((long int)(trigger_time_frac_secs_*1.e9));
} }
else if ( !chnenv_.compenv1_.uuid_.empty() && !chnenv_.compenv2_.uuid_.empty() ) else if ( !chnenv_.compenv1_.uuid_.empty() && !chnenv_.compenv2_.uuid_.empty() )
{ {
@@ -438,6 +441,7 @@ namespace imc
std::time_t ts = timegm(&comp_group2.NT_.tms_); // std::mktime(&tms); std::time_t ts = timegm(&comp_group2.NT_.tms_); // std::mktime(&tms);
trigger_time_ = std::chrono::system_clock::from_time_t(ts); trigger_time_ = std::chrono::system_clock::from_time_t(ts);
trigger_time_frac_secs_ = comp_group2.NT_.trigger_time_frac_secs_; trigger_time_frac_secs_ = comp_group2.NT_.trigger_time_frac_secs_;
absolute_trigger_time_ = trigger_time_;
} }
else else
{ {
@@ -447,10 +451,6 @@ namespace imc
// start converting binary buffer to imc::datatype // start converting binary buffer to imc::datatype
if ( !chnenv_.CSuuid_.empty() ) convert_buffer(); if ( !chnenv_.CSuuid_.empty() ) convert_buffer();
// calculate absolute trigger-time
absolute_trigger_time_ = trigger_time_ + std::chrono::seconds(addtime_);
// + std::chrono::nanoseconds((long int)(trigger_time_frac_secs_*1.e9));
// convert any non-UTF-8 codepage to UTF-8 // convert any non-UTF-8 codepage to UTF-8
convert_encoding(); convert_encoding();
} }
@@ -508,6 +508,8 @@ namespace imc
throw std::runtime_error("x and y data have different number of values"); throw std::runtime_error("x and y data have different number of values");
} }
xprec_ = 9;
process_data(xdata_, xnum_values, xdatatp_, xCSbuffer); process_data(xdata_, xnum_values, xdatatp_, xCSbuffer);
process_data(ydata_, ynum_values, ydatatp_, yCSbuffer); process_data(ydata_, ynum_values, ydatatp_, yCSbuffer);
} }
@@ -624,7 +626,6 @@ namespace imc
<<std::setw(width)<<std::left<<"significant bits:"<<ysignbits_<<"\n" <<std::setw(width)<<std::left<<"significant bits:"<<ysignbits_<<"\n"
<<std::setw(width)<<std::left<<"buffer-offset:"<<ybuffer_offset_<<"\n" <<std::setw(width)<<std::left<<"buffer-offset:"<<ybuffer_offset_<<"\n"
<<std::setw(width)<<std::left<<"buffer-size:"<<ybuffer_size_<<"\n" <<std::setw(width)<<std::left<<"buffer-size:"<<ybuffer_size_<<"\n"
<<std::setw(width)<<std::left<<"add-time:"<<addtime_<<"\n"
<<std::setw(width)<<std::left<<"xname:"<<xname_<<"\n" <<std::setw(width)<<std::left<<"xname:"<<xname_<<"\n"
<<std::setw(width)<<std::left<<"xunit:"<<xunit_<<"\n" <<std::setw(width)<<std::left<<"xunit:"<<xunit_<<"\n"
<<std::setw(width)<<std::left<<"xstepwidth:"<<xstepwidth_<<"\n" <<std::setw(width)<<std::left<<"xstepwidth:"<<xstepwidth_<<"\n"
@@ -660,7 +661,6 @@ namespace imc
<<"\",\"yname\":\""<<prepjsonstr(yname_) <<"\",\"yname\":\""<<prepjsonstr(yname_)
<<"\",\"yunit\":\""<<prepjsonstr(yunit_) <<"\",\"yunit\":\""<<prepjsonstr(yunit_)
<<"\",\"significantbits\":\""<<ysignbits_ <<"\",\"significantbits\":\""<<ysignbits_
<<"\",\"addtime\":\""<<addtime_
<<"\",\"buffer-size\":\""<<ybuffer_size_ <<"\",\"buffer-size\":\""<<ybuffer_size_
<<"\",\"xname\":\""<<prepjsonstr(xname_) <<"\",\"xname\":\""<<prepjsonstr(xname_)
<<"\",\"xunit\":\""<<prepjsonstr(xunit_) <<"\",\"xunit\":\""<<prepjsonstr(xunit_)

View File

@@ -482,7 +482,7 @@ namespace imc
// construct members by parsing particular parameters from buffer // construct members by parsing particular parameters from buffer
void parse(const std::vector<unsigned char>* buffer, const std::vector<parameter>& parameters) void parse(const std::vector<unsigned char>* buffer, const std::vector<parameter>& parameters)
{ {
if ( parameters.size() < 7 ) throw std::runtime_error("invalid number of parameters in CD2"); if ( parameters.size() < 7 ) throw std::runtime_error("invalid number of parameters in NO");
origin_ = ( get_parameter(buffer,&parameters[2]) == std::string("1") ); origin_ = ( get_parameter(buffer,&parameters[2]) == std::string("1") );
generator_ = get_parameter(buffer,&parameters[4]); generator_ = get_parameter(buffer,&parameters[4]);
comment_ = get_parameter(buffer,&parameters[6]); comment_ = get_parameter(buffer,&parameters[6]);
@@ -508,7 +508,7 @@ namespace imc
// construct members by parsing particular parameters from buffer // construct members by parsing particular parameters from buffer
void parse(const std::vector<unsigned char>* buffer, const std::vector<parameter>& parameters) void parse(const std::vector<unsigned char>* buffer, const std::vector<parameter>& parameters)
{ {
if ( parameters.size() < 8 ) throw std::runtime_error("invalid number of parameters in CD2"); if ( parameters.size() < 8 ) throw std::runtime_error("invalid number of parameters in NT1");
tms_ = std::tm(); tms_ = std::tm();
tms_.tm_mday = std::stoi( get_parameter(buffer,&parameters[2]) ); tms_.tm_mday = std::stoi( get_parameter(buffer,&parameters[2]) );
tms_.tm_mon = std::stoi( get_parameter(buffer,&parameters[3]) ) - 1; tms_.tm_mon = std::stoi( get_parameter(buffer,&parameters[3]) ) - 1;

View File

@@ -1 +1 @@
2.1.0 2.1.11