asam-ods-exd-api-mdf4 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- asam_ods_exd_api_mdf4-1.2.1/LICENSE +21 -0
- asam_ods_exd_api_mdf4-1.2.1/PKG-INFO +160 -0
- asam_ods_exd_api_mdf4-1.2.1/README.md +135 -0
- asam_ods_exd_api_mdf4-1.2.1/asam_ods_exd_api_mdf4.egg-info/PKG-INFO +160 -0
- asam_ods_exd_api_mdf4-1.2.1/asam_ods_exd_api_mdf4.egg-info/SOURCES.txt +17 -0
- asam_ods_exd_api_mdf4-1.2.1/asam_ods_exd_api_mdf4.egg-info/dependency_links.txt +1 -0
- asam_ods_exd_api_mdf4-1.2.1/asam_ods_exd_api_mdf4.egg-info/entry_points.txt +2 -0
- asam_ods_exd_api_mdf4-1.2.1/asam_ods_exd_api_mdf4.egg-info/requires.txt +2 -0
- asam_ods_exd_api_mdf4-1.2.1/asam_ods_exd_api_mdf4.egg-info/top_level.txt +1 -0
- asam_ods_exd_api_mdf4-1.2.1/external_data_file.py +318 -0
- asam_ods_exd_api_mdf4-1.2.1/pyproject.toml +74 -0
- asam_ods_exd_api_mdf4-1.2.1/setup.cfg +4 -0
- asam_ods_exd_api_mdf4-1.2.1/tests/test_asammdf_reader.py +20 -0
- asam_ods_exd_api_mdf4-1.2.1/tests/test_docker_integration.py +114 -0
- asam_ods_exd_api_mdf4-1.2.1/tests/test_example_files.py +139 -0
- asam_ods_exd_api_mdf4-1.2.1/tests/test_exd_api.py +72 -0
- asam_ods_exd_api_mdf4-1.2.1/tests/test_exd_api_datatypes.py +317 -0
- asam_ods_exd_api_mdf4-1.2.1/tests/test_external_data_reader.py +227 -0
- asam_ods_exd_api_mdf4-1.2.1/tests/test_roundtrip.py +639 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Andreas K
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: asam-ods-exd-api-mdf4
|
|
3
|
+
Version: 1.2.1
|
|
4
|
+
Summary: ASAM ODS EXD API implementation to read external data from MDF4 files.
|
|
5
|
+
Author: peak-solution
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/peak-solution/asam_ods_exd_api_mdf4
|
|
8
|
+
Project-URL: Repository, https://github.com/peak-solution/asam_ods_exd_api_mdf4
|
|
9
|
+
Project-URL: Issues, https://github.com/peak-solution/asam_ods_exd_api_mdf4/issues
|
|
10
|
+
Keywords: ASAM,ODS,EXD-API,MDF4,measurement data
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.14
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: asammdf<9.0.0,>=8.8.20
|
|
23
|
+
Requires-Dist: ods-exd-api-box<2.0.0,>=1.5.0
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# ASAM ODS EXD-API MDF4 plugin
|
|
27
|
+
|
|
28
|
+
[](https://github.com/peak-solution/asam_ods_exd_api_mdf4/actions/workflows/docker-build.yml)
|
|
29
|
+
[](https://pypi.org/project/asam-ods-exd-api-mdf4/)
|
|
30
|
+
[](https://pypi.org/project/asam-ods-exd-api-mdf4/)
|
|
31
|
+
[](https://opensource.org/licenses/MIT)
|
|
32
|
+
|
|
33
|
+
This repository contains a [ASAM ODS EXD-API](https://www.asam.net/standards/detail/ods/) plugin that uses [asammdf](https://pypi.org/project/asammdf/) to read the [ASAM MDF4](https://www.asam.net/standards/detail/mdf/wiki/) files.
|
|
34
|
+
|
|
35
|
+
It is built on the [ods-exd-api-box](https://pypi.org/project/ods-exd-api-box/) helper library which provides the gRPC server infrastructure and proto stubs.
|
|
36
|
+
|
|
37
|
+
## Content
|
|
38
|
+
|
|
39
|
+
### Implementation
|
|
40
|
+
* [external_data_file.py](external_data_file.py)<br>
|
|
41
|
+
Implements the `ExdFileInterface` from `ods-exd-api-box` to access MDF4 files using [asammdf](https://pypi.org/project/asammdf/).
|
|
42
|
+
Also contains the entry point to run the gRPC service.
|
|
43
|
+
|
|
44
|
+
### Tests
|
|
45
|
+
* [test_exd_api.py](tests/test_exd_api.py)<br>
|
|
46
|
+
Some basic tests on example files in `data` folder.
|
|
47
|
+
* [example_access_exd_api_mdf4.ipynb](example_access_exd_api_mdf4.ipynb)<br>
|
|
48
|
+
jupyter notebook the shows communication done by ASAM ODS server or Importer using the EXD-API plugin.
|
|
49
|
+
|
|
50
|
+
## Development
|
|
51
|
+
|
|
52
|
+
### Setup
|
|
53
|
+
|
|
54
|
+
Install [uv](https://docs.astral.sh/uv/) and then install the project with dev dependencies:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
uv sync --group dev
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Run Tests
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
uv run python -m unittest discover tests
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Run Plugin Locally
|
|
67
|
+
|
|
68
|
+
Use an explicit IPv4 bind address on Windows to avoid IPv6 bind issues:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv run asam-ods-exd-api-mdf4 --bind-address 127.0.0.1 --port 50051
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Stop the server with `Ctrl+C`. A non-zero exit code after interruption is expected.
|
|
75
|
+
|
|
76
|
+
### Run Plugin With uvx
|
|
77
|
+
|
|
78
|
+
Run the latest published package without installing it into the current project environment:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
uvx asam-ods-exd-api-mdf4 --bind-address 127.0.0.1 --port 50051
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Code Quality
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
uv sync --group dev # 1. Install all dependencies
|
|
88
|
+
uv run ruff format . # 2. Format code
|
|
89
|
+
uv run ruff check --fix . # 3. Fix lint violations
|
|
90
|
+
uv run mypy external_data_file.py # 4. Type check
|
|
91
|
+
uv run python -m unittest discover tests # 5. Run tests
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Docker
|
|
95
|
+
|
|
96
|
+
### Docker Image Details
|
|
97
|
+
|
|
98
|
+
The Docker image for this project is available at:
|
|
99
|
+
|
|
100
|
+
`ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest`
|
|
101
|
+
|
|
102
|
+
This image is automatically built and pushed via a GitHub Actions workflow. To pull and run the image:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
docker pull ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest
|
|
106
|
+
docker run -v /path/to/local/data:/data -p 50051:50051 ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Using the Docker Container
|
|
110
|
+
|
|
111
|
+
To build the Docker image locally:
|
|
112
|
+
```
|
|
113
|
+
docker build -t asam-ods-exd-api-mdf4 .
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
To start the Docker container:
|
|
117
|
+
```
|
|
118
|
+
docker run -v /path/to/local/data:/data -p 50051:50051 asam-ods-exd-api-mdf4
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
have a look at [start options](https://totonga.github.io/ods-exd-api-box/server-options.html) to
|
|
122
|
+
figure out how to customize the behavior of the EXD-API plugin.
|
|
123
|
+
|
|
124
|
+
## Architecture and Usage in ODS Server
|
|
125
|
+
|
|
126
|
+
```mermaid
|
|
127
|
+
sequenceDiagram
|
|
128
|
+
|
|
129
|
+
actor CLIENT as Client
|
|
130
|
+
participant PDTT as 🛠️Importer
|
|
131
|
+
participant PODS as 🗃️ASAM ODS server
|
|
132
|
+
participant PLUGIN as 📊EXD-API plugin
|
|
133
|
+
participant FILE as 🗂️File Storage
|
|
134
|
+
|
|
135
|
+
autonumber
|
|
136
|
+
|
|
137
|
+
opt Import phase
|
|
138
|
+
FILE ->>+ PDTT: New file shows up
|
|
139
|
+
PDTT ->>+ PLUGIN : Get Structure
|
|
140
|
+
PLUGIN -> FILE: Extract content information
|
|
141
|
+
PLUGIN ->> PLUGIN: Create Structure
|
|
142
|
+
PLUGIN ->>- PDTT: Return Structure
|
|
143
|
+
PDTT ->> PODS: Import ODS structure
|
|
144
|
+
Note right of PDTT: Create hierarchy<br/>AoTest,AoMeasurement,...
|
|
145
|
+
PDTT ->>- PODS: Add External Data info
|
|
146
|
+
Note right of PDTT: Attach AoFile ... for external data<br/>AoFile,AoSubmatrix,AoLocalColumn,...
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
Note over CLIENT, FILE: Now we can work with the imported files
|
|
150
|
+
|
|
151
|
+
loop Runtime phase
|
|
152
|
+
CLIENT ->> PODS: Establish ODS session
|
|
153
|
+
CLIENT ->> PODS: Work with meta data imported from structure
|
|
154
|
+
CLIENT ->> PODS: Access external channel in preview
|
|
155
|
+
PODS ->> PLUGIN: GetValues
|
|
156
|
+
PLUGIN ->> FILE: Get Channel values
|
|
157
|
+
PLUGIN ->> PODS: Return values of channels
|
|
158
|
+
PODS ->> CLIENT: Return values needed for plot
|
|
159
|
+
end
|
|
160
|
+
```
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# ASAM ODS EXD-API MDF4 plugin
|
|
2
|
+
|
|
3
|
+
[](https://github.com/peak-solution/asam_ods_exd_api_mdf4/actions/workflows/docker-build.yml)
|
|
4
|
+
[](https://pypi.org/project/asam-ods-exd-api-mdf4/)
|
|
5
|
+
[](https://pypi.org/project/asam-ods-exd-api-mdf4/)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
This repository contains a [ASAM ODS EXD-API](https://www.asam.net/standards/detail/ods/) plugin that uses [asammdf](https://pypi.org/project/asammdf/) to read the [ASAM MDF4](https://www.asam.net/standards/detail/mdf/wiki/) files.
|
|
9
|
+
|
|
10
|
+
It is built on the [ods-exd-api-box](https://pypi.org/project/ods-exd-api-box/) helper library which provides the gRPC server infrastructure and proto stubs.
|
|
11
|
+
|
|
12
|
+
## Content
|
|
13
|
+
|
|
14
|
+
### Implementation
|
|
15
|
+
* [external_data_file.py](external_data_file.py)<br>
|
|
16
|
+
Implements the `ExdFileInterface` from `ods-exd-api-box` to access MDF4 files using [asammdf](https://pypi.org/project/asammdf/).
|
|
17
|
+
Also contains the entry point to run the gRPC service.
|
|
18
|
+
|
|
19
|
+
### Tests
|
|
20
|
+
* [test_exd_api.py](tests/test_exd_api.py)<br>
|
|
21
|
+
Some basic tests on example files in `data` folder.
|
|
22
|
+
* [example_access_exd_api_mdf4.ipynb](example_access_exd_api_mdf4.ipynb)<br>
|
|
23
|
+
jupyter notebook the shows communication done by ASAM ODS server or Importer using the EXD-API plugin.
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
### Setup
|
|
28
|
+
|
|
29
|
+
Install [uv](https://docs.astral.sh/uv/) and then install the project with dev dependencies:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
uv sync --group dev
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Run Tests
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
uv run python -m unittest discover tests
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Run Plugin Locally
|
|
42
|
+
|
|
43
|
+
Use an explicit IPv4 bind address on Windows to avoid IPv6 bind issues:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
uv run asam-ods-exd-api-mdf4 --bind-address 127.0.0.1 --port 50051
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Stop the server with `Ctrl+C`. A non-zero exit code after interruption is expected.
|
|
50
|
+
|
|
51
|
+
### Run Plugin With uvx
|
|
52
|
+
|
|
53
|
+
Run the latest published package without installing it into the current project environment:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
uvx asam-ods-exd-api-mdf4 --bind-address 127.0.0.1 --port 50051
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Code Quality
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uv sync --group dev # 1. Install all dependencies
|
|
63
|
+
uv run ruff format . # 2. Format code
|
|
64
|
+
uv run ruff check --fix . # 3. Fix lint violations
|
|
65
|
+
uv run mypy external_data_file.py # 4. Type check
|
|
66
|
+
uv run python -m unittest discover tests # 5. Run tests
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Docker
|
|
70
|
+
|
|
71
|
+
### Docker Image Details
|
|
72
|
+
|
|
73
|
+
The Docker image for this project is available at:
|
|
74
|
+
|
|
75
|
+
`ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest`
|
|
76
|
+
|
|
77
|
+
This image is automatically built and pushed via a GitHub Actions workflow. To pull and run the image:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
docker pull ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest
|
|
81
|
+
docker run -v /path/to/local/data:/data -p 50051:50051 ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Using the Docker Container
|
|
85
|
+
|
|
86
|
+
To build the Docker image locally:
|
|
87
|
+
```
|
|
88
|
+
docker build -t asam-ods-exd-api-mdf4 .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
To start the Docker container:
|
|
92
|
+
```
|
|
93
|
+
docker run -v /path/to/local/data:/data -p 50051:50051 asam-ods-exd-api-mdf4
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
have a look at [start options](https://totonga.github.io/ods-exd-api-box/server-options.html) to
|
|
97
|
+
figure out how to customize the behavior of the EXD-API plugin.
|
|
98
|
+
|
|
99
|
+
## Architecture and Usage in ODS Server
|
|
100
|
+
|
|
101
|
+
```mermaid
|
|
102
|
+
sequenceDiagram
|
|
103
|
+
|
|
104
|
+
actor CLIENT as Client
|
|
105
|
+
participant PDTT as 🛠️Importer
|
|
106
|
+
participant PODS as 🗃️ASAM ODS server
|
|
107
|
+
participant PLUGIN as 📊EXD-API plugin
|
|
108
|
+
participant FILE as 🗂️File Storage
|
|
109
|
+
|
|
110
|
+
autonumber
|
|
111
|
+
|
|
112
|
+
opt Import phase
|
|
113
|
+
FILE ->>+ PDTT: New file shows up
|
|
114
|
+
PDTT ->>+ PLUGIN : Get Structure
|
|
115
|
+
PLUGIN -> FILE: Extract content information
|
|
116
|
+
PLUGIN ->> PLUGIN: Create Structure
|
|
117
|
+
PLUGIN ->>- PDTT: Return Structure
|
|
118
|
+
PDTT ->> PODS: Import ODS structure
|
|
119
|
+
Note right of PDTT: Create hierarchy<br/>AoTest,AoMeasurement,...
|
|
120
|
+
PDTT ->>- PODS: Add External Data info
|
|
121
|
+
Note right of PDTT: Attach AoFile ... for external data<br/>AoFile,AoSubmatrix,AoLocalColumn,...
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
Note over CLIENT, FILE: Now we can work with the imported files
|
|
125
|
+
|
|
126
|
+
loop Runtime phase
|
|
127
|
+
CLIENT ->> PODS: Establish ODS session
|
|
128
|
+
CLIENT ->> PODS: Work with meta data imported from structure
|
|
129
|
+
CLIENT ->> PODS: Access external channel in preview
|
|
130
|
+
PODS ->> PLUGIN: GetValues
|
|
131
|
+
PLUGIN ->> FILE: Get Channel values
|
|
132
|
+
PLUGIN ->> PODS: Return values of channels
|
|
133
|
+
PODS ->> CLIENT: Return values needed for plot
|
|
134
|
+
end
|
|
135
|
+
```
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: asam-ods-exd-api-mdf4
|
|
3
|
+
Version: 1.2.1
|
|
4
|
+
Summary: ASAM ODS EXD API implementation to read external data from MDF4 files.
|
|
5
|
+
Author: peak-solution
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/peak-solution/asam_ods_exd_api_mdf4
|
|
8
|
+
Project-URL: Repository, https://github.com/peak-solution/asam_ods_exd_api_mdf4
|
|
9
|
+
Project-URL: Issues, https://github.com/peak-solution/asam_ods_exd_api_mdf4/issues
|
|
10
|
+
Keywords: ASAM,ODS,EXD-API,MDF4,measurement data
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.14
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: asammdf<9.0.0,>=8.8.20
|
|
23
|
+
Requires-Dist: ods-exd-api-box<2.0.0,>=1.5.0
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# ASAM ODS EXD-API MDF4 plugin
|
|
27
|
+
|
|
28
|
+
[](https://github.com/peak-solution/asam_ods_exd_api_mdf4/actions/workflows/docker-build.yml)
|
|
29
|
+
[](https://pypi.org/project/asam-ods-exd-api-mdf4/)
|
|
30
|
+
[](https://pypi.org/project/asam-ods-exd-api-mdf4/)
|
|
31
|
+
[](https://opensource.org/licenses/MIT)
|
|
32
|
+
|
|
33
|
+
This repository contains a [ASAM ODS EXD-API](https://www.asam.net/standards/detail/ods/) plugin that uses [asammdf](https://pypi.org/project/asammdf/) to read the [ASAM MDF4](https://www.asam.net/standards/detail/mdf/wiki/) files.
|
|
34
|
+
|
|
35
|
+
It is built on the [ods-exd-api-box](https://pypi.org/project/ods-exd-api-box/) helper library which provides the gRPC server infrastructure and proto stubs.
|
|
36
|
+
|
|
37
|
+
## Content
|
|
38
|
+
|
|
39
|
+
### Implementation
|
|
40
|
+
* [external_data_file.py](external_data_file.py)<br>
|
|
41
|
+
Implements the `ExdFileInterface` from `ods-exd-api-box` to access MDF4 files using [asammdf](https://pypi.org/project/asammdf/).
|
|
42
|
+
Also contains the entry point to run the gRPC service.
|
|
43
|
+
|
|
44
|
+
### Tests
|
|
45
|
+
* [test_exd_api.py](tests/test_exd_api.py)<br>
|
|
46
|
+
Some basic tests on example files in `data` folder.
|
|
47
|
+
* [example_access_exd_api_mdf4.ipynb](example_access_exd_api_mdf4.ipynb)<br>
|
|
48
|
+
jupyter notebook the shows communication done by ASAM ODS server or Importer using the EXD-API plugin.
|
|
49
|
+
|
|
50
|
+
## Development
|
|
51
|
+
|
|
52
|
+
### Setup
|
|
53
|
+
|
|
54
|
+
Install [uv](https://docs.astral.sh/uv/) and then install the project with dev dependencies:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
uv sync --group dev
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Run Tests
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
uv run python -m unittest discover tests
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Run Plugin Locally
|
|
67
|
+
|
|
68
|
+
Use an explicit IPv4 bind address on Windows to avoid IPv6 bind issues:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv run asam-ods-exd-api-mdf4 --bind-address 127.0.0.1 --port 50051
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Stop the server with `Ctrl+C`. A non-zero exit code after interruption is expected.
|
|
75
|
+
|
|
76
|
+
### Run Plugin With uvx
|
|
77
|
+
|
|
78
|
+
Run the latest published package without installing it into the current project environment:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
uvx asam-ods-exd-api-mdf4 --bind-address 127.0.0.1 --port 50051
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Code Quality
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
uv sync --group dev # 1. Install all dependencies
|
|
88
|
+
uv run ruff format . # 2. Format code
|
|
89
|
+
uv run ruff check --fix . # 3. Fix lint violations
|
|
90
|
+
uv run mypy external_data_file.py # 4. Type check
|
|
91
|
+
uv run python -m unittest discover tests # 5. Run tests
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Docker
|
|
95
|
+
|
|
96
|
+
### Docker Image Details
|
|
97
|
+
|
|
98
|
+
The Docker image for this project is available at:
|
|
99
|
+
|
|
100
|
+
`ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest`
|
|
101
|
+
|
|
102
|
+
This image is automatically built and pushed via a GitHub Actions workflow. To pull and run the image:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
docker pull ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest
|
|
106
|
+
docker run -v /path/to/local/data:/data -p 50051:50051 ghcr.io/peak-solution/asam-ods-exd-api-mdf4:latest
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Using the Docker Container
|
|
110
|
+
|
|
111
|
+
To build the Docker image locally:
|
|
112
|
+
```
|
|
113
|
+
docker build -t asam-ods-exd-api-mdf4 .
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
To start the Docker container:
|
|
117
|
+
```
|
|
118
|
+
docker run -v /path/to/local/data:/data -p 50051:50051 asam-ods-exd-api-mdf4
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
have a look at [start options](https://totonga.github.io/ods-exd-api-box/server-options.html) to
|
|
122
|
+
figure out how to customize the behavior of the EXD-API plugin.
|
|
123
|
+
|
|
124
|
+
## Architecture and Usage in ODS Server
|
|
125
|
+
|
|
126
|
+
```mermaid
|
|
127
|
+
sequenceDiagram
|
|
128
|
+
|
|
129
|
+
actor CLIENT as Client
|
|
130
|
+
participant PDTT as 🛠️Importer
|
|
131
|
+
participant PODS as 🗃️ASAM ODS server
|
|
132
|
+
participant PLUGIN as 📊EXD-API plugin
|
|
133
|
+
participant FILE as 🗂️File Storage
|
|
134
|
+
|
|
135
|
+
autonumber
|
|
136
|
+
|
|
137
|
+
opt Import phase
|
|
138
|
+
FILE ->>+ PDTT: New file shows up
|
|
139
|
+
PDTT ->>+ PLUGIN : Get Structure
|
|
140
|
+
PLUGIN -> FILE: Extract content information
|
|
141
|
+
PLUGIN ->> PLUGIN: Create Structure
|
|
142
|
+
PLUGIN ->>- PDTT: Return Structure
|
|
143
|
+
PDTT ->> PODS: Import ODS structure
|
|
144
|
+
Note right of PDTT: Create hierarchy<br/>AoTest,AoMeasurement,...
|
|
145
|
+
PDTT ->>- PODS: Add External Data info
|
|
146
|
+
Note right of PDTT: Attach AoFile ... for external data<br/>AoFile,AoSubmatrix,AoLocalColumn,...
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
Note over CLIENT, FILE: Now we can work with the imported files
|
|
150
|
+
|
|
151
|
+
loop Runtime phase
|
|
152
|
+
CLIENT ->> PODS: Establish ODS session
|
|
153
|
+
CLIENT ->> PODS: Work with meta data imported from structure
|
|
154
|
+
CLIENT ->> PODS: Access external channel in preview
|
|
155
|
+
PODS ->> PLUGIN: GetValues
|
|
156
|
+
PLUGIN ->> FILE: Get Channel values
|
|
157
|
+
PLUGIN ->> PODS: Return values of channels
|
|
158
|
+
PODS ->> CLIENT: Return values needed for plot
|
|
159
|
+
end
|
|
160
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
external_data_file.py
|
|
4
|
+
pyproject.toml
|
|
5
|
+
asam_ods_exd_api_mdf4.egg-info/PKG-INFO
|
|
6
|
+
asam_ods_exd_api_mdf4.egg-info/SOURCES.txt
|
|
7
|
+
asam_ods_exd_api_mdf4.egg-info/dependency_links.txt
|
|
8
|
+
asam_ods_exd_api_mdf4.egg-info/entry_points.txt
|
|
9
|
+
asam_ods_exd_api_mdf4.egg-info/requires.txt
|
|
10
|
+
asam_ods_exd_api_mdf4.egg-info/top_level.txt
|
|
11
|
+
tests/test_asammdf_reader.py
|
|
12
|
+
tests/test_docker_integration.py
|
|
13
|
+
tests/test_example_files.py
|
|
14
|
+
tests/test_exd_api.py
|
|
15
|
+
tests/test_exd_api_datatypes.py
|
|
16
|
+
tests/test_external_data_reader.py
|
|
17
|
+
tests/test_roundtrip.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
external_data_file
|