Skip to content

Commit

Permalink
release 6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrisca Daniel (uidn3651) authored and Hrisca Daniel (uidn3651) committed Dec 7, 2020
1 parent 86eb061 commit 11ae924
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

environment:
EXE_BRANCH: "development"
EXE_BRANCH: "master"

matrix:

Expand Down
8 changes: 6 additions & 2 deletions asammdf/blocks/bus_logging_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ def extract_signal(signal, payload, raw=False, ignore_value2text_conversion=True

if is_float:
if bit_offset:
raise MdfException(f"Cannot extract float signal '{signal}' because it is not byte aligned")
raise MdfException(
f"Cannot extract float signal '{signal}' because it is not byte aligned"
)
if bit_count not in (16, 32, 64):
raise MdfException(f"Cannot extract float signal '{signal}' because it does not have a standard byte size")
raise MdfException(
f"Cannot extract float signal '{signal}' because it does not have a standard byte size"
)

if big_endian:
byte_pos = start_byte + 1
Expand Down
42 changes: 20 additions & 22 deletions asammdf/blocks/mdf_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,7 @@ def __init__(self, name=None, version="4.10", **kwargs):
self._attachments_cache = {}
self.file_comment = None
self.events = []
self.bus_logging_map = {
"CAN": {},
"ETHERNET": {},
"FLEXRAY": {},
"LIN": {}
}
self.bus_logging_map = {"CAN": {}, "ETHERNET": {}, "FLEXRAY": {}, "LIN": {}}

self._attachments_map = {}
self._ch_map = {}
Expand Down Expand Up @@ -3030,7 +3025,7 @@ def append(
size = len(elem)
if size % 2:
size += 1
elem = elem + b'\0'
elem = elem + b"\0"
data.append(UINT32_p(size))
data.append(elem)
off += size + 4
Expand All @@ -3055,7 +3050,7 @@ def append(
gp_sdata.append([info])
gp_sdata_size.append(data_size)
file.seek(0, 2)
file.write(b''.join(data))
file.write(b"".join(data))
else:
data_addr = 0
gp_sdata.append([])
Expand All @@ -3066,7 +3061,10 @@ def append(
signal.samples.itemsize + 4
)

values = [full(len(samples), samples.itemsize, dtype=uint32), samples]
values = [
full(len(samples), samples.itemsize, dtype=uint32),
samples,
]

types_ = [("o", uint32), ("s", sig_dtype)]

Expand Down Expand Up @@ -5306,7 +5304,7 @@ def extend(self, index, signals):
size = len(elem)
if size % 2:
size += 1
elem = elem + b'\0'
elem = elem + b"\0"
data.append(UINT32_p(size))
data.append(elem)
off += size + 4
Expand All @@ -5332,7 +5330,7 @@ def extend(self, index, signals):
offsets=offsets,
)
gp.signal_data[i].append(info)
stream.write(b''.join(data))
stream.write(b"".join(data))

offsets += cur_offset
fields.append(offsets)
Expand Down Expand Up @@ -8150,7 +8148,9 @@ def get_can_signal(
if len(sig):
return sig
else:
raise MdfException(f'No logging from "{signal}" was found in the measurement')
raise MdfException(
f'No logging from "{signal}" was found in the measurement'
)

raise MdfException(f'No logging from "{signal}" was found in the measurement')

Expand Down Expand Up @@ -8324,7 +8324,9 @@ def get_lin_signal(
if len(sig):
return sig
else:
raise MdfException(f'No logging from "{signal}" was found in the measurement')
raise MdfException(
f'No logging from "{signal}" was found in the measurement'
)

raise MdfException(f'No logging from "{signal}" was found in the measurement')

Expand Down Expand Up @@ -10071,9 +10073,9 @@ def _process_lin_logging(self, group_index, grp):
self._set_temporary_master(self.get_master(group_index, data=fragment))

msg_ids = (
self.get(
"LIN_Frame.ID", group=group_index, data=fragment
).astype("<u4")
self.get("LIN_Frame.ID", group=group_index, data=fragment).astype(
"<u4"
)
& 0x1FFFFFFF
)

Expand Down Expand Up @@ -10105,9 +10107,7 @@ def _process_lin_logging(self, group_index, grp):
payload = bus_data_bytes[idx]
t = bus_t[idx]

extracted_signals = extract_mux(
payload, message, msg_id, 0, t
)
extracted_signals = extract_mux(payload, message, msg_id, 0, t)

for entry, signals in extracted_signals.items():
if len(next(iter(signals.values()))["samples"]) == 0:
Expand Down Expand Up @@ -10137,9 +10137,7 @@ def _process_lin_logging(self, group_index, grp):

msg_map[entry] = cg_nr

for ch_index, ch in enumerate(
self.groups[cg_nr].channels
):
for ch_index, ch in enumerate(self.groups[cg_nr].channels):
if ch_index == 0:
continue

Expand Down
2 changes: 1 addition & 1 deletion asammdf/gui/widgets/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def scramble(self, event):
def extract_bus_logging(self, event):

version = self.extract_bus_format.currentText()

self.output_info_bus.setPlainText("")

database_files = {}
Expand Down
4 changes: 2 additions & 2 deletions asammdf/gui/widgets/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ def extract_bus_logging(self, event):
]
for msg_id in sorted(call_info["unknown_ids"]):
message.append(f"- 0x{msg_id:X}")
message.append('\n\n')
message.append("\n\n")

self.output_info_bus.setPlainText("\n".join(message))

Expand Down Expand Up @@ -1522,7 +1522,7 @@ def extract_bus_csv_logging(self, event):
]
for msg_id in sorted(call_info["unknown_ids"]):
message.append(f"- 0x{msg_id:X}")
message.append('\n\n')
message.append("\n\n")

self.output_info_bus.setPlainText("\n".join(message))

Expand Down
14 changes: 5 additions & 9 deletions asammdf/mdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4096,9 +4096,7 @@ def _extract_lin_logging(
self._set_temporary_master(self.get_master(i, data=fragment))

msg_ids = (
self.get("LIN_Frame.ID", group=i, data=fragment).astype(
"<u4"
)
self.get("LIN_Frame.ID", group=i, data=fragment).astype("<u4")
& 0x1FFFFFFF
)

Expand Down Expand Up @@ -4170,9 +4168,7 @@ def _extract_lin_logging(
name=signal["name"],
comment=signal["comment"],
unit=signal["unit"],
invalidation_bits=signal[
"invalidation_bits"
]
invalidation_bits=signal["invalidation_bits"]
if ignore_invalid_signals
else None,
)
Expand Down Expand Up @@ -4222,9 +4218,9 @@ def _extract_lin_logging(

if ignore_invalid_signals:
for ch_index, sig in enumerate(sigs, 1):
max_flags[index][ch_index] = max_flags[
index
][ch_index] or np.all(sig[1])
max_flags[index][ch_index] = max_flags[index][
ch_index
] or np.all(sig[1])

sigs.insert(0, (t, None))

Expand Down
2 changes: 1 addition & 1 deletion asammdf/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
""" asammdf version module """

__version__ = "6.0.0.dev32"
__version__ = "6.0.0"

0 comments on commit 11ae924

Please sign in to comment.