Skip to content

Commit

Permalink
Add workaround and warning when multiplier is missing for given instr…
Browse files Browse the repository at this point in the history
…ument
  • Loading branch information
ml-evs committed Feb 25, 2024
1 parent d4c896e commit 596c0d3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion NewareNDA/NewareNDA.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,14 @@ def _bytes_to_list(bytes):
if Index == 0 or Status == 0:
return []

multiplier = multiplier_dict[Range]
if Range not in multiplier_dict:
warnings.warn(
f"""Instrument range {Range=} not a recognized value; the data cannot be automatically scaled for this instrument, disabling scaling.
For support for this instrument, please raise an issue on GitHub at https://github.com/Solid-Energy-Systems/NewareNDA/issues.
""")
multiplier = 1.0
else:
multiplier = multiplier_dict[Range]

# Create a dictionary for the record
list = [
Expand Down

0 comments on commit 596c0d3

Please sign in to comment.