Skip to content

Commit b7cdda3

Browse files
committed
Make relative imports absolute
1 parent 5d790b1 commit b7cdda3

File tree

13 files changed

+46
-36
lines changed

13 files changed

+46
-36
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.22.13
2+
current_version = 0.22.14
33
commit = True
44
tag = False
55

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
2929
if (MSVC)
3030
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} /Od /fsanitize=address /Zi")
3131
else()
32-
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} -Og -g3 -ggdb --fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fsanitize=bounds") # -fsanitize=hwaddress
32+
SET(GCC_N_CLANG_BASE_OPTIONS "${GCC_N_CLANG_BASE_OPTIONS} -Og -g3 -ggdb --fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fsanitize=bounds") # -fsanitize=hwaddress
3333
endif()
3434
else ()
3535
if (MSVC)
3636
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} /Ox")
3737
else()
38-
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} -O3 --fomit-frame-pointer")
38+
SET(GCC_N_CLANG_BASE_OPTIONS "${GCC_N_CLANG_BASE_OPTIONS} -O3 --fomit-frame-pointer")
3939
endif()
4040
endif ()
4141

build_ext.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def build_extension(debug: bool = False, use_temp_dir: bool = False) -> None:
119119
if py_cfg["libdir"]:
120120
cmake_args.append(f"-DPython3_LIBRARY={str(Path(py_cfg['libdir']) / Path(py_cfg['library']))}")
121121

122-
build_args = ["--config Release", "--verbose"]
122+
build_args = []
123+
# build_args = ["--config Release", "--verbose"]
123124
# cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 /path/to/src
124125

125126
if sys.platform.startswith("darwin"):

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dynamic = ["license", "readme", "authors", "requires-python", "description", "cl
3636
[tool.poetry]
3737
authors = ["Christoph Schueler <[email protected]>"]
3838
name = "pyxcp"
39-
version = "0.22.13"
39+
version = "0.22.14"
4040
readme = "README.md"
4141
description = "Universal Calibration Protocol for Python"
4242
keywords = ["automotive", "ecu", "xcp", "asam", "autosar"]

pyxcp/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717

1818
# if you update this manually, do not forget to update
1919
# .bumpversion.cfg and pyproject.toml.
20-
__version__ = "0.22.13"
20+
__version__ = "0.22.14"

pyxcp/cpp_ext/__init__.py

-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
from .cpp_ext import ( # noqa: F401
2-
Bin,
3-
DaqList,
4-
McObject,
5-
Timestamp,
6-
TimestampInfo,
7-
TimestampType,
8-
)

pyxcp/cpp_ext/helper.hpp

+16
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,22 @@ class Timestamp {
251251
std::uint64_t m_initial;
252252
};
253253

254+
template<typename T, typename V>
255+
T variant_get(V&& value) {
256+
257+
T result;
258+
259+
const T* value_ptr = std::get_if<T>(&value);
260+
if (value_ptr == nullptr) {
261+
result = T{};
262+
}
263+
else {
264+
result = *value_ptr;
265+
}
266+
267+
return result;
268+
}
269+
254270
#if 0
255271
inline void sleep_ms(std::uint64_t milliseconds) {
256272
std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));

pyxcp/daq_stim/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from pyxcp import types
88
from pyxcp.config import get_application
9-
from pyxcp.cpp_ext import DaqList
9+
from pyxcp.cpp_ext.cpp_ext import DaqList
1010
from pyxcp.daq_stim.optimize import make_continuous_blocks
1111
from pyxcp.daq_stim.optimize.binpacking import first_fit_decreasing
1212
from pyxcp.recorder import DaqOnlinePolicy as _DaqOnlinePolicy

pyxcp/daq_stim/optimize/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from operator import attrgetter
66
from typing import List
77

8-
from pyxcp.cpp_ext import McObject
8+
from pyxcp.cpp_ext.cpp_ext import McObject
99

1010

1111
def make_continuous_blocks(chunks: List[McObject], upper_bound=None, upper_bound_initial=None) -> List[McObject]:

pyxcp/daq_stim/optimize/binpacking.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
from typing import List, Optional
55

6-
from pyxcp.cpp_ext import Bin
6+
from pyxcp.cpp_ext.cpp_ext import Bin
77

88

99
def first_fit_decreasing(items, bin_size: int, initial_bin_size: Optional[int] = None) -> List[Bin]:

pyxcp/examples/run_daq.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@
2222
False,
2323
False,
2424
[
25-
("byteCounter", 0x203EA, 0, "U8"),
26-
("wordCounter", 0x203EC, 0, "U16"),
27-
("dwordCounter", 0x20410, 0, "U32"),
28-
("sbyteCounter", 0x203EB, 0, "I8"),
25+
("byteCounter", 0x00023648, 0, "U8"),
26+
("wordCounter", 0x0002364C, 0, "U16"),
27+
("dwordCounter", 0x00023650, 0, "U32"),
28+
("sbyteCounter", 0x00023649, 0, "I8"),
2929
],
3030
),
3131
DaqList(
3232
"part_2",
33-
0,
33+
7,
3434
False,
3535
False,
3636
[
37-
("swordCounter", 0x20414, 0, "I16"),
38-
("sdwordCounter", 0x20418, 0, "I32"),
39-
("channel1", 0x203F8, 0, "F64"),
40-
("channel2", 0x20400, 0, "F64"),
41-
("channel3", 0x20408, 0, "F64"),
37+
("swordCounter", 0x00023654, 0, "I16"),
38+
("sdwordCounter", 0x00023658, 0, "I32"),
39+
("channel1", 0x00023630, 0, "F64"),
40+
("channel2", 0x00023638, 0, "F64"),
41+
("channel3", 0x00023640, 0, "F64"),
4242
],
4343
),
4444
]
@@ -117,8 +117,8 @@
117117
),
118118
]
119119

120-
# daq_parser = DaqToCsv(DAQ_LISTS) # Record to CSV file(s).
121-
daq_parser = DaqRecorder(DAQ_LISTS, "run_daq", 2) # Record to ".xmraw" file.
120+
daq_parser = DaqToCsv(DAQ_LISTS) # Record to CSV file(s).
121+
# daq_parser = DaqRecorder(DAQ_LISTS, "run_daq", 2) # Record to ".xmraw" file.
122122

123123
with ap.run(policy=daq_parser) as x:
124124
x.connect()
@@ -127,12 +127,14 @@
127127

128128
x.cond_unlock("DAQ") # DAQ resource is locked in many cases.
129129

130+
DAQ_LISTS[1].event_num = 0
131+
130132
print("setup DAQ lists.")
131133
daq_parser.setup() # Execute setup procedures.
132134
print("start DAQ lists.")
133135
daq_parser.start() # Start DAQ lists.
134136

135-
time.sleep(15.0 * 60.0) # Run for 15 minutes.
137+
time.sleep(5.0 * 60.0) # Run for 15 minutes.
136138

137139
print("Stop DAQ....")
138140
daq_parser.stop() # Stop DAQ lists.

pyxcp/transport/base.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
from typing import Any, Dict, Optional, Set, Type
66

77
import pyxcp.types as types
8-
9-
from ..cpp_ext import Timestamp, TimestampType
10-
from ..recorder import XcpLogFileWriter
11-
from ..timing import Timing
12-
from ..utils import (
8+
from pyxcp.cpp_ext.cpp_ext import Timestamp, TimestampType
9+
from pyxcp.recorder import XcpLogFileWriter
10+
from pyxcp.timing import Timing
11+
from pyxcp.utils import (
1312
CurrentDatetime,
1413
flatten,
1514
hexDump,

pyxcp/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import chardet
1010
import pytz
1111

12-
from pyxcp.cpp_ext import TimestampInfo
12+
from pyxcp.cpp_ext.cpp_ext import TimestampInfo
1313

1414

1515
def hexDump(arr):

0 commit comments

Comments
 (0)