pax_global_header 0000666 0000000 0000000 00000000064 15026333004 0014506 g ustar 00root root 0000000 0000000 52 comment=94fe0e4d21a856d31feb799df43380810cb1e775
asammdf-8.5.1/ 0000775 0000000 0000000 00000000000 15026333004 0013131 5 ustar 00root root 0000000 0000000 asammdf-8.5.1/.github/ 0000775 0000000 0000000 00000000000 15026333004 0014471 5 ustar 00root root 0000000 0000000 asammdf-8.5.1/.github/FUNDING.yml 0000664 0000000 0000000 00000001266 15026333004 0016313 0 ustar 00root root 0000000 0000000 # These are supported funding model platforms
github: danielhrisca # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: danielhrisca
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
asammdf-8.5.1/.github/workflows/ 0000775 0000000 0000000 00000000000 15026333004 0016526 5 ustar 00root root 0000000 0000000 asammdf-8.5.1/.github/workflows/build.yml 0000664 0000000 0000000 00000002614 15026333004 0020353 0 ustar 00root root 0000000 0000000 name: pyinstaller_build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install linux libraries
shell: bash
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' }}
run: |
sudo apt update
sudo apt install libegl1 libopengl0 libevent-2.1-7 libopus0 libminizip1 libpulse0 \
libxcb-icccm4 libxcb-image0 libxcb-cursor0 libxcb-keysyms1 libxcb-xkb1 libxcb-shape0 \
libxkbcommon-x11-0 libxcb-render-util0
- name: Install Python packages
run: |
pip install tox
- name: Build the executable
run: |
tox -e pyinstaller -- --distpath dist/${{ matrix.os }} --noconfirm --clean
# see: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
- name: Archive dist artifacts
uses: actions/upload-artifact@v4
with:
name: pyinstaller-${{ matrix.os }}
path: dist/${{ matrix.os }}/**
if-no-files-found: error
asammdf-8.5.1/.github/workflows/main.yml 0000664 0000000 0000000 00000005265 15026333004 0020205 0 ustar 00root root 0000000 0000000 name: tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-22.04, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
shell: bash
run: |
pip install tox tox-gh-actions
if [ "$RUNNER_OS" = "Linux" ]; then
sudo apt update
sudo apt-get install libegl1 libopengl0
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get install libxcb-xinerama0
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install xorg
sudo apt-get install -y xvfb
fi
- name: Start Xvfb
if: matrix.os == 'ubuntu-22.04'
run: |
Xvfb :0 -screen 0 1024x768x24 > /dev/null 2>&1 &
export DISPLAY=:0
touch ~/.Xauthority
Xvfb :0 -screen 0 1024x768x24 > /dev/null 2>&1 &
export DISPLAY=:0
# see: https://github.com/ymyzk/tox-gh-actions
- name: Run tests
run: tox
- uses: actions/upload-artifact@v4
if: failure() && matrix.os == 'windows-latest' # 'ubuntu-22.04' or 'windows-latest'
with:
path: "**/screenshots/**"
name: ${{ matrix.python-version }}
- name: Stop Xvfb
if: matrix.os == 'ubuntu-22.04'
run: killall Xvfb
- name: Publish Style Summary
if: ${{ failure() || success() }}
run: |
python -c "from ci import report_style; report_style()"
- name: Publish Tests Summary
if: ${{ failure() || success() }}
run: |
pip install junitparser
python -c "from ci import report_tests; report_tests(header='## Unit-tests Report:')"
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: Unittests-${{ matrix.os }}-${{ matrix.python-version }}
parallel: true
format: lcov
coveralls:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
asammdf-8.5.1/.github/workflows/wheels.yml 0000664 0000000 0000000 00000003130 15026333004 0020535 0 ustar 00root root 0000000 0000000 name: wheels
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
shell: bash
env:
CIBW_TEST_COMMAND: "pytest {project}/test --ignore={project}/test/asammdf/gui"
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
sudo apt update
sudo apt-get install libegl1 libopengl0 libxml2 libxml2-dev libxslt1-dev libxslt1.1
fi
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install deps
run: python -m pip install build
- name: Build sdist
run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
asammdf-8.5.1/.gitignore 0000664 0000000 0000000 00000010250 15026333004 0015117 0 ustar 00root root 0000000 0000000 # File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
# Created by https://www.toptal.com/developers/gitignore/api/python,macos
# Edit at https://www.toptal.com/developers/gitignore?templates=python,macos
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### macOS Patch ###
# iCloud generated files
*.icloud
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml
# ruff
.ruff_cache/
# LSP config files
pyrightconfig.json
# End of https://www.toptal.com/developers/gitignore/api/python,macos
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
!lib/
/lib/
coverage.lcov
doc/_build/
screenshots/**
test-reports/**
asammdf-8.5.1/.gitmodules 0000664 0000000 0000000 00000000142 15026333004 0015303 0 ustar 00root root 0000000 0000000 [submodule "ext/libdeflate"]
path = ext/libdeflate
url = https://github.com/ebiggers/libdeflate
asammdf-8.5.1/.pre-commit-config.yaml 0000664 0000000 0000000 00000000240 15026333004 0017406 0 ustar 00root root 0000000 0000000 repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.11
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
asammdf-8.5.1/.readthedocs.yml 0000664 0000000 0000000 00000001401 15026333004 0016213 0 ustar 00root root 0000000 0000000 # .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.12"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF
formats:
- pdf
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- method: pip
path: .
- requirements: doc/requirements.txt
# VCS submodules configuration
submodules:
include: all
recursive: true asammdf-8.5.1/.vscode/ 0000775 0000000 0000000 00000000000 15026333004 0014472 5 ustar 00root root 0000000 0000000 asammdf-8.5.1/.vscode/extensions.json 0000664 0000000 0000000 00000001106 15026333004 0017562 0 ustar 00root root 0000000 0000000 {
"recommendations": [
"benspaulding.python-manifest-template",
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"fill-labs.dependi",
"github.vscode-github-actions",
"lextudio.restructuredtext",
"ms-python.debugpy",
"ms-python.mypy-type-checker",
"ms-python.python",
"ms-python.vscode-pylance",
"njpwerner.autodocstring",
"redhat.vscode-yaml",
"swyddfa.esbonio",
"tamasfe.even-better-toml",
"trond-snekvik.simple-rst",
"twixes.pypi-assistant"
]
}
asammdf-8.5.1/CMakeLists.txt 0000664 0000000 0000000 00000001653 15026333004 0015676 0 ustar 00root root 0000000 0000000 cmake_minimum_required(VERSION 3.26...3.29)
project(${SKBUILD_PROJECT_NAME} LANGUAGES C VERSION ${SKBUILD_PROJECT_VERSION})
option(WITH_SYSTEM_DEFLATE "Use system provided deflate library" OFF)
find_package(
Python
REQUIRED
COMPONENTS
Interpreter
Development.Module
${SKBUILD_SABI_COMPONENT}
NumPy
)
python_add_library(cutils MODULE WITH_SOABI USE_SABI 3.10 src/asammdf/blocks/cutils.c)
if (WITH_SYSTEM_DEFLATE)
find_package(libdeflate REQUIRED)
target_link_libraries(cutils PRIVATE Python::NumPy libdeflate::libdeflate_shared)
else()
# Add submodule libdeflate
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(LIBDEFLATE_COMPRESSION_SUPPORT OFF)
set(LIBDEFLATE_GZIP_SUPPORT OFF)
set(LIBDEFLATE_BUILD_GZIP OFF)
add_subdirectory(ext/libdeflate EXCLUDE_FROM_ALL)
target_link_libraries(cutils PRIVATE Python::NumPy libdeflate::libdeflate_static)
endif()
install(TARGETS cutils DESTINATION "asammdf/blocks")
asammdf-8.5.1/CONTRIBUTING.md 0000664 0000000 0000000 00000003377 15026333004 0015374 0 ustar 00root root 0000000 0000000 # Contributing
## The basics
Your help is appreciated and welcome!
The _master_ branch is meant to hold the release code. At any time this should be
identical to the code available on PyPI.
PRs will be pushed on the _development_ branch if the actual package code is changed. When the time comes this branch
will be merged to the _master_ branch and a new release will be issued.
PRs that deal with documentation, and other adjacent files (README for example) can be pushed to the _master_ branch.
When submitting PRs please take into account:
- the project's goals
- PEP8 and the style guide below
## Developer instructions
Clone the repository with submodules, make sure you have a C compiler installed, then install the development dependencies (we recommend using a virtual environment):
```bash
python -m venv .venv # create virtual environment in .venv
source .venv/bin/activate # activate virtual environment (POSIX)
.venv\Scripts\activate.bat # activate virtual environment (Windows)
pip install --requirement requirements.txt # install development dependencies (includes asammdf in editable mode)
```
Now you can start developing. If you are using VSCode, the virtual environment should be detected automatically. If not, open the command panel `Ctrl + Shift + P` and search for `Python: Select Interpreter`.
## Testing
You can use tox to run tests locally. Example for the unit tests with Python version 3.10:
```console
tox -e py310
```
Otherwise, you can just push and the tests will be run by GitHub Actions.
## Style guide
Just run [`ruff format`](https://docs.astral.sh/ruff/formatter/) on modified files before sending the PR. There is no need to reinvent the wheel here!
**Tip**: install Git hooks using pre-commit `pre-commit install --install-hooks`
asammdf-8.5.1/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000001562 15026333004 0015642 0 ustar 00root root 0000000 0000000 # Python version
_Please run the following snippet and write the output here_
```python
import platform
from pprint import pprint
import sys
pprint("python=" + sys.version)
pprint("os=" + platform.platform())
try:
import numpy
pprint("numpy=" + numpy.__version__)
except ImportError:
pass
try:
import asammdf
pprint("asammdf=" + asammdf.__version__)
except ImportError:
pass
```
# Code
## MDF version
_please write here the file version (you can run `print(MDF(file).version)`)_
## Code snippet
_please write here the code snippet that triggers the error_
## Traceback
_please write here the error traceback_
# Description
The fastest way to debug is to have the original file. For data protection you can use the static
method _scramble_ to scramble all text blocks, and send the scrambled file by e-mail.
_Please describe the issue here._
asammdf-8.5.1/LICENSE 0000664 0000000 0000000 00000021372 15026333004 0014143 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright 2017–2023 Daniel Hrisca
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
--------------------------------------------------------------------------------
3rdparty dependency libdeflate is statically linked.
libdeflate has the following license:
Copyright 2016 Eric Biggers
Copyright 2024 Google LLC
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-------------------------------------------------------------------------------- asammdf-8.5.1/MANIFEST.in 0000664 0000000 0000000 00000000175 15026333004 0014672 0 ustar 00root root 0000000 0000000 include LICENSE
recursive-include src/asammdf *.ui
recursive-include src/asammdf *.c
recursive-include src/asammdf *.qrc
asammdf-8.5.1/README.md 0000664 0000000 0000000 00000025115 15026333004 0014414 0 ustar 00root root 0000000 0000000 #
_asammdf_ is a fast parser and editor for ASAM (Association for Standardization of Automation and Measuring Systems) MDF (Measurement Data Format) files.
_asammdf_ supports MDF versions 2 (.dat), 3 (.mdf) and 4 (.mf4).
_asammdf_ works on Python >= 3.10




[](https://mypy-lang.org/)
[](https://github.com/pre-commit/pre-commit)
[](https://github.com/astral-sh/ruff)
---

## Status
| Continuous Integration | Coveralls | Codacy | ReadTheDocs |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [](https://github.com/danielhrisca/asammdf/actions/workflows/main.yml) | [](https://coveralls.io/github/danielhrisca/asammdf?branch=master) | [](https://www.codacy.com/app/danielhrisca/asammdf?utm_source=github.com&utm_medium=referral&utm_content=danielhrisca/asammdf&utm_campaign=badger) | [](http://asammdf.readthedocs.io/en/master/?badge=stable) |
| PyPI | conda-forge |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [](https://badge.fury.io/py/asammdf) | [](https://anaconda.org/conda-forge/asammdf) |
## Project goals
The main goals for this library are:
- to be faster than the other Python-based mdf libraries
- to have clean and easy-to-understand code base
- to have minimal 3rd party dependencies
## Features
- create new mdf files from scratch
- append new channels
- read unsorted MDF v3 and v4 files
- read CAN and LIN bus logging files
- extract CAN and LIN signals from anonymous bus logging measurements
- filter a subset of channels from original mdf file
- cut measurement to specified time interval
- convert to different mdf version
- export to pandas, HDF5, Matlab (v7.3), CSV and parquet
- merge multiple files sharing the same internal structure
- read and save mdf version 4.10 files containing zipped data blocks
- space optimizations for saved files (no duplicated blocks)
- split large data blocks (configurable size) for mdf version 4
- full support (read, append, save) for the following map types (multidimensional array channels):
- mdf version 3 channels with CDBLOCK
- mdf version 4 structure channel composition
- mdf version 4 channel arrays with CNTemplate storage and one of the array types:
- 0 - array
- 1 - scaling axis
- 2 - look-up
- add and extract attachments for mdf version 4
- handle large files (for example merging two files, each with 14000 channels and 5GB size, on a RaspberryPi)
- extract channel data, master channel and extra channel information as _Signal_ objects for unified operations with v3 and v4 files
- time domain operation using the _Signal_ class
- pandas DataFrames are good if all the channels have the same time base
- a measurement will usually have channels from different sources at different rates
- the _Signal_ class facilitates operations with such channels
- graphical interface to visualize channels and perform operations with the files
## Major features not implemented (yet)
- for version 3
- functionality related to sample reduction block: the sample reduction blocks are simply ignored
- for version 4
- experimental support for MDF v4.20 column oriented storage
- functionality related to sample reduction block: the sample reduction blocks are simply ignored
- handling of channel hierarchy: channel hierarchy is ignored
- full handling of bus logging measurements: currently only CAN and LIN bus logging are implemented with the
ability to _get_ signals defined in the attached CAN/LIN database (.arxml or .dbc). Signals can also
be extracted from an anonymous bus logging measurement by providing a CAN or LIN database (.dbc or .arxml)
- handling of unfinished measurements (mdf 4): finalization is attempted when the file is loaded, however
not all the finalization steps are supported
- full support for remaining mdf 4 channel arrays types
- xml schema for MDBLOCK: most metadata stored in the comment blocks will not be available
- full handling of event blocks: events are transferred to the new files (in case of calling methods
that return new _MDF_ objects) but no new events can be created
- channels with default X axis: the default X axis is ignored and the channel group's master channel
is used
- attachment encryption/decryption using user provided encryption/decryption functions; this is not
part of the MDF v4 spec and is only supported by this library
## Usage
```python
from asammdf import MDF
mdf = MDF('sample.mdf')
speed = mdf.get('WheelSpeed')
speed.plot()
important_signals = ['WheelSpeed', 'VehicleSpeed', 'VehicleAcceleration']
# get short measurement with a subset of channels from 10s to 12s
short = mdf.filter(important_signals).cut(start=10, stop=12)
# convert to version 4.10 and save to disk
short.convert('4.10').save('important signals.mf4')
# plot some channels from a huge file
efficient = MDF('huge.mf4')
for signal in efficient.select(['Sensor1', 'Voltage3']):
signal.plot()
```
Check the _examples_ folder for extended usage demo, or the documentation
## Documentation
And a nicely written tutorial on the [CSS Electronics site](https://canlogger.csselectronics.com/canedge-getting-started/ce3/log-file-tools/asammdf-gui/).
## Contributing & Support
Please have a look at the [contributing guidelines](CONTRIBUTING.md).
If you enjoy this library please consider making a donation to the
[numpy project](https://numfocus.org/donate-to-numpy) or to [danielhrisca using liberapay](https://liberapay.com/danielhrisca/donate).
[](https://liberapay.com/danielhrisca/donate)
### Contributors
Thanks to all who contributed with commits to _asammdf_:
[](https://github.com/danielhrisca/asammdf/graphs/contributors)
## Installation
_asammdf_ is available on
- GitHub:
- PyPI:
- conda-forge:
```shell
pip install asammdf
# for the GUI
pip install asammdf[gui]
# or for anaconda
conda install -c conda-forge asammdf
```
In case a wheel is not present for your OS/Python versions and you
lack the proper compiler setup to compile the C-extension code, then
you can simply copy-paste the package code to your site-packages. In this
way the Python fallback code will be used instead of the compiled C-extension code.
## Dependencies
asammdf uses the following libraries
- numpy : the heart that makes all tick
- numexpr : for algebraic and rational channel conversions
- wheel : for installation in virtual environments
- pandas : for DataFrame export
- canmatrix : to handle CAN/LIN bus logging measurements
- natsort
- lxml : for canmatrix arxml support
- lz4 : to speed up the disk IO performance
- python-dateutil : measurement start time handling
Optional dependencies needed for exports
- h5py : for HDF5 export
- hdf5storage : for Matlab v7.3 .mat export
- pyarrow : for parquet export
- scipy: for Matlab v4 and v5 .mat export
Other optional dependencies
- PySide6 : for GUI tool
- pyqtgraph : for GUI tool and Signal plotting
- matplotlib : as fallback for Signal plotting
- faust-cchardet : to detect non-standard Unicode encodings
- chardet : to detect non-standard Unicode encodings
- pyqtlet2 : for the GPS window
- isal : for faster zlib compression/decompression
- fsspec : access files stored in the cloud
## Benchmarks
asammdf-8.5.1/asammdf.ico 0000664 0000000 0000000 00000036006 15026333004 0015242 0 ustar 00root root 0000000 0000000 ; PNG
IHDR >a ;IDATxieUsΝߔ/T5ےGvx]`SE-MESi
,bZ@Pflْ,YeJIMw