Skip to content

Commit

Permalink
fixes #1000 #1044
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Jul 30, 2024
1 parent 28a0d6e commit f4d4fea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/asammdf/gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/asammdf/mdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit f4d4fea

Please sign in to comment.