Commit f456ace2 authored by Simon Sebastian Humpohl's avatar Simon Sebastian Humpohl
Browse files

Rename to pytabor to resolve conflicts with existing pyte package (a terminal emulator)

parent 913021a7
......@@ -2,7 +2,7 @@ from pyvisa import __version__ as pyvisa_version
from distutils.version import StrictVersion
if StrictVersion(pyvisa_version) >= StrictVersion('1.6'):
from .pyte16 import *
__all__ = pyte16.__all__
from .pytabor16 import *
__all__ = pytabor16.__all__
else:
raise ImportError('Unsupported pyvisa version: {} (should be an "easy" fix)'.format(pyvisa_version))
......@@ -289,14 +289,14 @@ def open_session(resource_name = None, title_msg = None, vi_rsc_mgr = None, extr
Example:
>>> import pyte
>>> import pytabor
>>>
>>> # Connect to Arbitrary-Wave-Generator Instrument through TCPIP
>>> # (the user will be asked to enter the instrument's IP-Address):
>>> vi = pyte.open_session(resource_name='TCPIP', title_msg='Connect to AWG Instrument')
>>> vi = pytabor.open_session(resource_name='TCPIP', title_msg='Connect to AWG Instrument')
>>>
>>> # Connect to Digital-Multimeter through USB:
>>> dmm = pyte.open_session(resource_name='USB', extra_init=False)
>>> dmm = pytabor.open_session(resource_name='USB', extra_init=False)
>>>
>>> print vi.ask('*IDN?')
>>> print dmm.ask('*IDN?')
......@@ -509,18 +509,18 @@ def download_binary_data(vi, pref, bin_dat, dat_size, paranoia_level=1):
:returns: written-bytes count.
Example:
>>> import pyte
>>> import pytabor
>>>
>>> vi = pyte.open_session('192.168.0.170')
>>> vi = pytabor.open_session('192.168.0.170')
>>> _ = vi.ask('*RST; *CLS; *OPC?') # reset the instrument
>>> _ = vi.ask(':FUNC:MODE USER; *OPC?') # select arbirary-wave mode
>>> _ = vi.ask(':FREQ::RAST 2GHz; *OPC?') # Set sampling-rate = 2GHz
>>>
>>> # build sine-wave (single cycle) of 1024-points:
>>> sin_wav = pyte.build_sine_wave(cycle_len=1024)
>>> sin_wav = pytabor.build_sine_wave(cycle_len=1024)
>>>
>>> # download it to the active segment of the active channel:
>>> pyte.download_binary_data(vi, 'TRAC:DATA', sin_wav, 1024 * 2)
>>> pytabor.download_binary_data(vi, 'TRAC:DATA', sin_wav, 1024 * 2)
>>>
>>> _ = vi.ask(':OUTP ON; *OPC?') # turn on the active channel
>>> print vi.ask(':SYST:ERR?')
......@@ -589,26 +589,26 @@ def download_binary_file(vi, pref, file_path, offset=0, data_size=None, paranoia
:returns: written-bytes count.
Example:
>>> import pyte
>>> import pytabor
>>> import os
>>> file_path = os.path.expanduser('~')
>>> file_path = os.path.join(file_path, 'Documents')
>>> file_path = os.path.join(file_path, 'sin.wav')
>>>
>>> # build sine-wave (single cycle) of 1024-points:
>>> sin_wav = pyte.build_sine_wave(cycle_len=1024)
>>> sin_wav = pytabor.build_sine_wave(cycle_len=1024)
>>> # write it to binary file:
>>> sin_wav.tofile(file_path)
>>>
>>> # Later on ..
>>>
>>> vi = pyte.open_session('192.168.0.170')
>>> vi = pytabor.open_session('192.168.0.170')
>>> _ = vi.ask('*RST; *CLS; *OPC?') # reset the instrument
>>> _ = vi.ask(':FUNC:MODE USER; *OPC?') # select arbirary-wave mode
>>> _ = vi.ask(':FREQ::RAST 2GHz; *OPC?') # Set sampling-rate = 2GHz
>>>
>>> # write wave-data from file to the active segment of the active channel:
>>> pyte.download_binary_file(vi, file_path, 'TRAC:DATA')
>>> pytabor.download_binary_file(vi, file_path, 'TRAC:DATA')
>>>
>>> _ = vi.ask(':OUTP ON; *OPC?') # turn on the active channel
>>> print vi.ask(':SYST:ERR?')
......@@ -773,11 +773,11 @@ def download_segment_lengths(vi, seg_len_list, pref=':SEGM:DATA', paranoia_level
>>> _ = vi.ask(':TRACe:SELect 1; *OPC?')
>>>
>>> # Download the wave-data of all segments:
>>> pyte.download_binary_data(vi, ':TRACe:DATA', wave_data, total_size)
>>> pytabor.download_binary_data(vi, ':TRACe:DATA', wave_data, total_size)
>>>
>>> # Download the appropriate segment-lengths list:
>>> seg_lengths = [ 1024, 1024, 384, 4096, 8192 ]
>>> pyte.download_segment_lengths(vi, seg_lengths)
>>> pytabor.download_segment_lengths(vi, seg_lengths)
'''
if isinstance(seg_len_list, np.ndarray):
if seg_len_list.ndim != 1:
......@@ -814,7 +814,7 @@ def download_sequencer_table(vi, seq_table, pref=':SEQ:DATA', paranoia_level=1):
>>> _ = vi.ask(':SEQ:SELect 1; *OPC?')
>>>
>>> # Download the sequencer-table:
>>> pyte.download_sequencer_table(vi, sequencer_table)
>>> pytabor.download_sequencer_table(vi, sequencer_table)
'''
......@@ -848,7 +848,7 @@ def download_adv_seq_table(vi, adv_seq_table, pref=':ASEQ:DATA', paranoia_level=
>>> adv_sequencer_table = zip(repeats, seq_nb, jump)
>>>
>>> # Download it to instrument
>>> pyte.download_adv_seq_table(vi, adv_sequencer_table)
>>> pytabor.download_adv_seq_table(vi, adv_sequencer_table)
'''
tbl_len = len(adv_seq_table)
......@@ -882,8 +882,8 @@ def download_fast_pattern_table(vi, patt_table, pref=':PATT:COMP:FAST:DATA', par
Optionally set the point-time-resolution manually to `1/sclk`.
Example:
>>> import pyte
>>> vi = pyte.open_session('192.168.0.170')
>>> import pytabor
>>> vi = pytabor.open_session('192.168.0.170')
>>>
>>> # Create fast-pulse pattern table:
>>> volt_levels = [0.0 , 0.1 , 0.5 , 0.1 , -0.1, -0.5, -0.1, -0.05]
......@@ -897,7 +897,7 @@ def download_fast_pattern_table(vi, patt_table, pref=':PATT:COMP:FAST:DATA', par
>>> _ = vi.ask(':PATT:COMP:RES:TYPE USER; :PATT:COMP:RES 0.5e-9; *OPC?')
>>>
>>> # Download the pattern-table to instrument:
>>> pyte.download_fast_pattern_table(vi, pattern_table)
>>> pytabor.download_fast_pattern_table(vi, pattern_table)
>>>
>>> vi.close()
'''
......@@ -940,8 +940,8 @@ def download_linear_pattern_table(vi, patt_table, start_level, pref=':PATT:COMP:
Optionally set the point-time-resolution manually to `1/sclk`.
Example:
>>> import pyte
>>> vi = pyte.open_session('192.168.0.170')
>>> import pytabor
>>> vi = pytabor.open_session('192.168.0.170')
>>>
>>> # Create fast-pulse pattern table:
>>> start_level = 0.0
......@@ -956,7 +956,7 @@ def download_linear_pattern_table(vi, patt_table, start_level, pref=':PATT:COMP:
>>> _ = vi.ask(':PATT:COMP:RES:TYPE USER; :PATT:COMP:RES 0.5e-9; *OPC?')
>>>
>>> # Download the pattern-table to instrument:
>>> pyte.download_linear_pattern_table(vi, pattern_table, start_level)
>>> pytabor.download_linear_pattern_table(vi, pattern_table, start_level)
>>>
>>> vi.close()
'''
......
from distutils.core import setup
setup(
name='pyte',
version='',
packages=['pyte','teawg'],
package_dir={'pyte': 'pyte', 'teawg': 'teawg'},
name='pytabor',
version='0.0.1',
packages=['pytabor', 'teawg'],
package_dir={'pytabor': 'pytabor', 'teawg': 'teawg'},
url='',
license='',
author='Tabor electronics',
......
......@@ -7,7 +7,7 @@ import struct
import copy
import numpy as np
import warnings
import pyte
import pytabor
# WX2184 Properties
_wx2184_properties = {
......@@ -151,7 +151,7 @@ class TEWXAwg(object):
self._set_instr_address(instr_addr)
if self._instr_addr is not None:
self._visa_inst = pyte.open_session(self._instr_addr, extra_init=True)
self._visa_inst = pytabor.open_session(self._instr_addr, extra_init=True)
if self._visa_inst is not None:
idn = self._visa_inst.ask('*IDN?')
......@@ -230,7 +230,7 @@ class TEWXAwg(object):
if paranoia_level is None:
paranoia_level = self._paranoia_level
pyte.send_cmd(self._visa_inst, cmd_str, paranoia_level)
pytabor.send_cmd(self._visa_inst, cmd_str, paranoia_level)
def send_query(self, query_str):
'''Send the given query to the instrument and read the response
......@@ -255,7 +255,7 @@ class TEWXAwg(object):
if paranoia_level is None:
paranoia_level = self._paranoia_level
pyte.download_binary_data(self._visa_inst, pref, bin_dat, bin_dat.nbytes, paranoia_level)
pytabor.download_binary_data(self._visa_inst, pref, bin_dat, bin_dat.nbytes, paranoia_level)
def send_binary_file(self, file_path, pref, offset=0, data_size=None, paranoia_level=None):
"""Load binary data from the specified file and send it to instrument.
......@@ -274,7 +274,7 @@ class TEWXAwg(object):
if paranoia_level is None:
paranoia_level = self._paranoia_level
pyte.download_binary_file(self._visa_inst, pref, file_path, offset, data_size, paranoia_level)
pytabor.download_binary_file(self._visa_inst, pref, file_path, offset, data_size, paranoia_level)
def send_arbcon_wav_file(self, file_path, pref=':TRAC:DATA', bits_per_point=14, paranoia_level=None):
"""Load wave data from binary wav file created by the ArbConnection, normalize and it to instrument.
......@@ -288,7 +288,7 @@ class TEWXAwg(object):
if paranoia_level is None:
paranoia_level = self._paranoia_level
pyte.download_arbcon_wav_file(self._visa_inst, file_path, pref, bits_per_point, paranoia_level)
pytabor.download_arbcon_wav_file(self._visa_inst, file_path, pref, bits_per_point, paranoia_level)
def download_segment_lengths(self, seg_len_list, pref=':SEGM:DATA', paranoia_level=None):
'''Download Segments-Lengths Table to Instrument
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment