From f4d4feaf8b7647fef5d628c7e6b42386db4b004d Mon Sep 17 00:00:00 2001 From: danielhrisca Date: Tue, 30 Jul 2024 10:25:30 +0300 Subject: [PATCH] fixes #1000 #1044 --- src/asammdf/gui/utils.py | 3 ++- src/asammdf/mdf.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/asammdf/gui/utils.py b/src/asammdf/gui/utils.py index b6f021a91..e853f2035 100644 --- a/src/asammdf/gui/utils.py +++ b/src/asammdf/gui/utils.py @@ -1207,7 +1207,7 @@ def check_generated_function(func, trace, function_source, silent, parent=None): args = inspect.signature(func) kwargs = {} for i, (arg_name, arg) in enumerate(args.parameters.items()): - kwargs[arg_name] = random.randint(1, 2**64) + kwargs[arg_name] = random.randint(1, 256) trace = "" @@ -1220,6 +1220,7 @@ def check_generated_function(func, trace, function_source, silent, parent=None): except: sample_by_sample = False trace = f"Sample by sample: {format_exc()}" + print(f"Sample by sample {kwargs=}: {format_exc()}") else: if not isinstance(res, (int, float)): sample_by_sample = False diff --git a/src/asammdf/mdf.py b/src/asammdf/mdf.py index e87d36998..a8a6cc7be 100644 --- a/src/asammdf/mdf.py +++ b/src/asammdf/mdf.py @@ -11,7 +11,7 @@ from enum import Enum from functools import reduce import gzip -from io import BytesIO +from io import BufferedIOBase, BytesIO import logging import os from pathlib import Path @@ -233,7 +233,7 @@ def __init__( if name: if is_file_like(name): - if isinstance(name, BytesIO): + if isinstance(name, (BytesIO, BufferedIOBase)): original_name = None file_stream = name do_close = False @@ -4393,7 +4393,6 @@ def to_dataframe( dataframe : pandas.DataFrame """ - print("use_interpolation", use_interpolation) if isinstance(raw, dict): if "__default__" not in raw: raise MdfException("The raw argument given as dict must contain the __default__ key")