Skip to content

Commit

Permalink
Merge pull request #19 from splendor-collab/bug/fix_deprecation_warning
Browse files Browse the repository at this point in the history
Fix deprecation warning by no longer using disable channel
  • Loading branch information
slwatkins authored May 7, 2024
2 parents 5b4d5fe + f8acc16 commit 7c70e72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ install_requires =
numpy
scipy
matplotlib
moku>=3.0.0
moku>=3.2.0
h5py
pyyaml
pyserial
Expand Down
27 changes: 12 additions & 15 deletions src/splendaq/daq/_log_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def __exit__(self, type, value, traceback):
chan_list = [1, 2]

for chan in chan_list:
self.DL.enable_input(chan, False) # disable inputs
self.DL.generate_waveform(chan, 'Off') # disable outputs
self.DL.disable_channel(chan) # disable inputs

self.DL.relinquish_ownership()

Expand Down Expand Up @@ -164,7 +164,7 @@ def set_input_channels(self, channels, impedance="1MOhm", coupling="DC",
disable_chans = [chan not in channels for chan in chan_list]
for chan, disable in zip(chan_list, disable_chans):
if disable:
self.DL.disable_channel(chan)
self.DL.enable_input(chan, False)
else:
ind = channels.index(chan)
self.DL.set_frontend(
Expand Down Expand Up @@ -405,7 +405,7 @@ def dc_settings(dc_level=0):
'dc_level': dc_level,
}

def set_output_channel(self, channel, waveformtype, load="1MOhm",
def set_output_channel(self, channel, waveformtype, load="HiZ",
**settings):
"""
Method to turn on an output channel and generate the speicified
Expand All @@ -423,19 +423,19 @@ def set_output_channel(self, channel, waveformtype, load="1MOhm",
The waveform type to generate, must be one of 'Sine',
'Square', 'Ramp', 'Pulse', 'DC'. Can also be set to 'Off'
to turn the channel off.
load : str, optional
The load impedance to use for the output channel. For a
Moku:Pro or Moku:Lab, this must be one of '1MOhm' or
'50Ohm'. For a Moku:Go, this can only be '1MOhm'. Default
is '1MOhm'.
termination : str, optional
The waveform termination to use for the output channel.
For a Moku:Pro or Moku:Lab, this must be one of 'HiZ' or
'50Ohm'. For a Moku:Go, this can only be 'HiZ'. Default
is 'HiZ'.
settings : dict
The dictionary containing all of the settings needed for
the specified waveform type.
"""

if self._device in ["Moku:Pro", "Moku:Lab"]:
self.DL.set_output_load(channel, load)
self.DL.set_output_termination(channel, load)
self.DL.generate_waveform(
channel,
waveformtype,
Expand Down Expand Up @@ -489,12 +489,9 @@ def log_data(self, duration, savepath='./', comments='',
# Wait for the logging session to progress by sleeping 0.5sec
time.sleep(0.5)
# Get current progress percentage and check if it's complete
try:
progress = self.DL.logging_progress()
remaining_time = progress['time_remaining']
is_logging = remaining_time >= 0
except:
is_logging = False
progress = self.DL.logging_progress()
remaining_time = progress['time_remaining']
is_logging = remaining_time > 0

filenames.append(logfile['file_name'])

Expand Down

0 comments on commit 7c70e72

Please sign in to comment.