Code Monkey home page Code Monkey logo

tm_devices's People

Contributors

adityakb avatar dependabot[bot] avatar ldantek avatar michaelwagoner avatar nfelt14 avatar qthompso avatar tek-githubbot-1010 avatar u625355 avatar v12ganesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tm_devices's Issues

[BUG]: Argument mismatch in the following APIs

Description of the bug

Arguments data type is mismatched in the following APIs:

Models affected: Keithley SMU 2450|2451|2460|2470 Source Measure Units.

API PI Comments
smu.commands.buffer.write.format() buffer.write.format() String argument mapped to integer.
smu.commands.buffer.make() buffer.make() Return type is a table instead of a variable.

Steps To Reproduce

  1. Create a driver object named "smu" for any of the affected models.

  2. Use the "smu" driver object to write and query the above-mentioned APIs.
    Examples:

           smu.commands.buffer.write.format() 
    
           smu.commands.buffer.make()
    
  3. Error: There is a mismatch in the data type of one of the arguments and return type is a table instead of a variable.

image

Environment Information

Operating System:

  • Windows 10, 64-bit

Software Version:

  • tm-devices : 0.1.24

Additional Information

Alternative way to make the API functional as expected:

   buffervar1 = smu.write("buffer.make(200, buffer.STYLE_FULL)")
   smu.write("buffer.write.format(extBuffer, buffer.UNIT_WATT, buffer.DIGITS_3_5)")

[BUG]: Import error on Intel Mac / Ventura 13.5

Description of the bug

We've noticed this import error upon from tm_devices import DeviceManager on Intel core I5 Macs with the Ventura 13.4 operating system

Error Domain=KMErrorDomain Code=71 "Insufficient permissions for action: Unable to load 'com.highpoint-tech.kext.HighPointIOP' in unprivileged request." UserInfo={NSLocalizedDescription=Insufficient permissions for action: Unable to load 'com.highpoint-tech.kext.HighPointIOP' in unprivileged request.}

Steps To Reproduce

  1. Obtain a Mac with an Intel chipset
  2. pip install tm_devices
  3. Run python3 to start the Python CLI
  4. In the Python CLI, run from tm_devices import DeviceManager

Environment Information

Python 3.11

image

Additional Information

No response

[BUG]: ReadtheDocs builds run out of memory

Description of the bug

The ReadtheDocs servers only have 8GB of memory available. Building the docs for this package use more memory than that due to the large API.

Steps To Reproduce

  1. Navigate to https://tm-devices.readthedocs.io/
  2. Observe that the documentation doesn't exist

Environment Information

Here is a script that can be used (at least on Windows) to track memory usage during the documentation build process.

"""Build the documentation and monitor memory usage."""
import os
import pathlib
import shutil
import threading
import time
from sphinx.application import Sphinx

import psutil

# os.environ["SKIP_TM_DEVICES_API_GENERATION"] = "true"


def monitor_memory():
    max_mem = 0
    thread_max_mem = 0
    while True:
        mem = psutil.virtual_memory().percent
        if mem > max_mem:
            max_mem = mem
        process = psutil.Process()
        thread_mem = process.memory_info().rss / 1024 / 1024  # memory usage of the process in MB
        if thread_mem > thread_max_mem:
            thread_max_mem = thread_mem
        print(
            # f"Current memory usage: {mem}%"
            # f" | "
            # f"Max memory usage: {max_mem}%"
            # f" | "
            f"Max thread memory usage: {thread_max_mem:.2f} MB"
            # f" | "
            # f"Total memory usage: {psutil.virtual_memory().used / 1024 / 1024:.2f} MB"
            ,
            end="\r",
            flush=True
        )
        time.sleep(0.5)


if __name__ == "__main__":
    # create a new thread and start running the memory monitoring script
    memory_monitor_thread = threading.Thread(target=monitor_memory, daemon=True)
    memory_monitor_thread.start()

    start_dir = os.getcwd()
    docs_dir = os.path.dirname(__file__) + "/docs"
    os.chdir(docs_dir)
    shutil.rmtree(f"{docs_dir}/_build", ignore_errors=True)
    shutil.rmtree(f"{docs_dir}/_autoapi", ignore_errors=True)

    start_time = time.perf_counter()
    # cmd = f"{sys.executable} -m sphinx -b html -W --keep-going . _build"
    try:
        app = Sphinx(
            srcdir=pathlib.Path("."),
            confdir=pathlib.Path("."),
            outdir=pathlib.Path("_build/html"),
            buildername="html",
            doctreedir=pathlib.Path("_build/html/.doctrees"),
            warningiserror=True,
            keep_going=True,
            status=None,
        )
        app.build()
    finally:
        total_time = time.perf_counter() - start_time
        total_min, total_sec = divmod(total_time, 60)
        print(f"\n\nFinished building docs in {total_min} minutes and {total_sec:.4f} seconds")
        os.chdir(start_dir)

Additional Information

No response

[BUG]: Timeout Error on Subsequent USB TMC Connections to the Oscilloscope.

Description of the bug

Timeout Error on Subsequent USB TMC Connections to the Oscilloscope.

Affected Model: MSO 4 series Oscilloscopes.

The API behaves as expected during the initial connection; however, upon subsequent USB TMC connections to the oscilloscope, an unexpected timeout error occurs, contrasting with the behavior observed in connections through PyVisa.

Steps To Reproduce

  1. Connect the oscilloscope to the system through USB TMC connection.
  2. Create a driver object named "scope" for any of the affected models.
  3. Use the "scope" driver object query the following API:
         scope.commands.idn.query()
    
  4. Close the connection.
  5. Repeat steps 1-3, observe the error.

Environment Information

Operating System:

  • Windows 10, 64-bit

Software Version:

  • tm-devices : 0.1.24

Connection type

  • USB TMC

Additional Information

Note:
This error arises during the execution of consecutive scripts, not in the context of successive API calls.

[BUG]: Unable to connect to the Oscilloscope through Socket port using a VISA Resource string

Description of the bug

Encountering issues connecting to the scope through the VISA resource string via a socket port, while successfully establishing a connection by specifying the port in the "add_scope()" function.

Steps To Reproduce

  1. Connect to the scope via Socket by passing the VISA Resource string in add_scope() function. (TCPIP::Model-Serial::port_no::SOCKET")

  2. Invalid address error is occurred.
    inval;id_Address

  3. Connect to the scope via Socket by passing the port number as a parameter to the add_scope() function.

  4. It works.

Environment Information

Operating_system: Windows
tm_device version: 1.1.0
MSO6B Oscilloscope

Additional Information

No response

[BUG]: APIs with the Query function missing for the following list of PI commands.

Description of the bug

APIs with the Query function missing for the following list of PI commands.

Models affected: MSO 2|4|5|6 series Oscilloscopes.

API PI command
scope.commands.search.search[x].trigger.a.bus.arinc429a.label.value.query() SEARCH:SEARCH:TRIGger:A:BUS:ARINC429A:LABel:VALue?
scope.commands.search.search[x].trigger.a.bus.usb.data.qualifier.query() SEARCH:SEARCH:TRIGger:A:BUS:USB:DATa:QUALifier?
scope.commands.search.search[x].trigger.a.window.crossing.query() SEARCH:SEARCH:TRIGger:A:WINdow:CROSSIng?
scope.commands.measurement.meas[x].smoothingfilter.query() MEASUrement:MEAS:SMOOTHINGFILTER?
scope.commands.plot.plot[1].label.font.size.query() PLOT:PLOT:LABel:FONT:SIZE?
scope.commands.bus.b[1].mil1553b.threshold.query() BUS:B:MIL1553B:THRESHold?
scope.commands.bus.b[1].mdio.clock.threshold.query() BUS:B:MDIO:CLOCk:THReshold?
scope.commands.ref.ref[x].deskew.query() REF:REF:DESKew?
scope.commands.ref.ref[x].label.color.query() REF:REF:LABel:COLor?
scope.commands.ref.ref[x].label.font.bold.query() REF:REF:LABel:FONT:BOLD?
scope.commands.ref.ref[x].label.font.italic.query() REF:REF:LABel:FONT:ITALic?
scope.commands.ref.ref[x].label.font.size.query() REF:REF:LABel:FONT:SIZE?
scope.commands.ref.ref[x].label.font.type.query() REF:REF:LABel:FONT:TYPE?
scope.commands.ref.ref[x].label.font.underline.query() REF:REF:LABel:FONT:UNDERline?
scope.commands.ref.ref[x].source.query() REF:REF:SOUrce?
scope.commands.ch[x].label.color.query() CH:LABel:COLor?
scope.commands.ch[x].label.font.bold.query() CH:LABel:FONT:BOLD?
scope.commands.ch[x].label.font.italic.query() CH:LABel:FONT:ITALic?
scope.commands.ch[x].label.font.size.query() CH:LABel:FONT:SIZE?
scope.commands.ch[x].label.font.type.query() CH:LABel:FONT:TYPE?
scope.commands.ch[x].label.font.underline.query() CH:LABel:FONT:UNDERline?
scope.commands.ch[x].ditherrange.query() CH:DITHERrange?
scope.commands.ch[x].scale.query() CH:SCAle?
scope.commands.ch[x].position.query() CH:POSition?
scope.commands.saveonevent.filedest.query() SAVEONEVent:FILEDest?
scope.commands.trigger.a.bus.b[x].sent.slow.identifier.value.query() TRIGger:A:BUS:B:SENT:SLOW:IDentifier:VALue?
scope.commands.measurement.edge[x].query() MEASUrement:EDGE?
scope.commands.measurement.meas[x].edge[x].query() MEASUrement:MEAS:EDGE?
scope.commands.measurement.meas[x].gating.logicsource.query() MEASUrement:MEAS:GATing:LOGICSource?
scope.commands.measurement.meas[x].gating.searchsource.query() MEASUrement:MEAS:GATing:SEARCHSource?
scope.commands.measurement.meas[x].label.query() MEASUrement:MEAS:LABel?
scope.commands.measurement.meas[x].perfreq.edge.query() MEASUrement:MEAS:PERFREQ:EDGE?
scope.commands.measurement.meas[x].transition.query() MEASUrement:MEAS:TRANSition?
scope.commands.measurement.ref[x].reflevels.basetop.query() MEASUrement:REF:REFLevels:BASETop?
scope.commands.math.math[x].function.query() MATH:MATH:FUNCtion?
scope.commands.math.math[x].label.color.query() MATH:MATH:LABel:COLor?
scope.commands.math.math[x].label.font.bold.query() MATH:MATH:LABel:FONT:BOLD?
scope.commands.math.math[x].label.font.italic.query() MATH:MATH:LABel:FONT:ITALic?
scope.commands.math.math[x].label.font.size.query() MATH:MATH:LABel:FONT:SIZE?
scope.commands.math.math[x].label.font.type.query() MATH:MATH:LABel:FONT:TYPE?
scope.commands.math.math[x].label.font.underline.query() MATH:MATH:LABel:FONT:UNDERline?
scope.commands.math.math[x].source.query() MATH:MATH:SOUrce1?
scope.commands.bus.b[x].parallel.bitsource[x].threshold.query() BUS:B:PARallel:BITSOUrce:THReshold?
scope.commands.display.plotview[x].xaxis.scale.query() DISplay:PLOTVIEW:XAXIS:SCALE?
scope.commands.display.plotview[x].yaxis.scale.query() DISplay:PLOTVIEW:YAXIS:SCALE?
scope.commands.display.global_.b[x].state.query() DISplay:GLObal:B:STATE?
scope.commands.display.global_.ch[x].state.query() DISplay:GLObal:CH:STATE?
scope.commands.display.global_.math[x].state.query() DISplay:GLObal:MATH:STATE?
scope.commands.display.global_.ref[x].state.query() DISplay:GLObal:REF:STATE?
scope.commands.display.mathfftview.math.math[x].state.query() DISplay:MATHFFTView1:MATH:MATH:STATE?
scope.commands.display.select.reference.query() DISplay:SELect:REFerence?
scope.commands.display.select.source.query() DISplay:SELect:SOUrce?
scope.commands.display.select.view.query() DISplay:SELect:VIEW?
scope.commands.display.select.waveview.source.query() DISplay:SELect:WAVEView1:SOUrce?
scope.commands.display.mathfftview.zoom.xaxis.to.query() DISplay:MATHFFTView1:ZOOM:XAXIS:TO?
scope.commands.math.math[x].interpolation.query() MATH:MATH:INTERpolation?
scope.commands.search.search[x].trigger.a.state.query() SEARCH:SEARCH:TRIGger:A:STATE?
scope.commands.search.selected.query() SEARCH:SELected?
scope.commands.search.search[x].trigger.a.bus.can.data.value.query() SEARCH:SEARCH:TRIGger:A:BUS:CAN:DATa:VALue?

Models affected: DPO/MSO/DSA 70K SX/DX/C series Oscilloscopes.

API PI Command
scope.commands.zoom.mode.query() ZOOm:MODe?
scope.commands.mch[x].maxamplitude.query() MCH:MAXAMPLitude?
scope.commands.mch[x].minamplitude.query() MCH:MINAMPLitude?
scope.commands.custom.gate.source.query() CUSTOM:GATE:SOUrce?
scope.commands.custom.gate.start.query() CUSTOM:GATE:START?
scope.commands.custom.gate.width.query() CUSTOM:GATE:WIDth?
scope.commands.custom.select.gate.query() CUSTOM:SELECT:GATE?
scope.commands.errordetector.signaltype.query() ERRORDetector:SIGnaltype?

Steps To Reproduce

  1. Create a driver object named "scope" for any of the affected models.

  2. Use the "scope" driver object to query the above-mentioned APIs.
    Examples:

                    scope.commands.search.search[1].trigger.a.state.query() 
    
                       scope.commands.math.math[1].function.query()
    
  3. Error message: The object has no attribute 'query'.

image
image

Environment Information

Operating System:

  • Windows 10, 64-bit

Software Version:

  • tm-devices : 1.1.0

Additional Information

Alternative way to make the query is as follows:

Examples:

               scope.query("ZOOm:MODe?")

               scope.query("DISplay:GLObal:B<x>:STATE?") 

[BUG]: Following list of APIs are not working as expected.

Description of the bug

Following list of APIs are not working as expected:

Models applicable :
MSO 2|4|5|6 series Oscilloscopes.

API PI
scope.commands.search.search.trigger.a.bus.b.nrz.condition SEARCH:SEARCH:TRIGger:A:BUS:B:NRZ:CONDition
scope.commands.search.search.trigger.a.bus.b.s8b0b.condition SEARCH:SEARCH:TRIGger:A:BUS:B:S8B10B:CONDition
APIs under “PSIFIVe” command tree: scope.commands.search.search.trigger.a.bus.b.psifive. Set of PI commands under "PSIFIVE": SEARCH:SEARCH:TRIGger:A:BUS:B:PSIFIVe

Models applicable to:
DPO/MSO/DSA 70K SX/DX/C series Oscilloscopes.

API PI
scope.commands.linktraining.lane.query() LINKTRaining:LANE
scope.commands.cq[x].threshold.query() CQ:THRESHold

Steps To Reproduce

  1. Create a driver object named "scope" for any of the affected models.
  2. Use the "scope" driver object to write and query the above-mentioned APIs.
    Examples:
             scope.commands.cq[1].threshold.query()

             scope.commands.linktraining.lane.query()
  1. Error: Attribute "cq" is not accepting "0" as an integer value and attribute "lane" is not accepting any integer value.

Environment Information

Operating System:

  • Windows 10, 64-bit

Software Version:

  • tm-devices : 1.1.0

Additional Information

Alternative way to make the API functional as expected:

Examples:

                  scope.query("LINKTRaining:LANE1?")

[BUG]: Documentation is unavailable

Description of the bug

The online documentation is currently unavailable. The readthedocs link takes you to a 404 Not Found page.

Steps To Reproduce

  1. Navigate to https://tm-devices.readthedocs.io/
  2. Observe that the documentation doesn't exist

Environment Information

No response

Additional Information

No response

[FEAT]: Request for DPO 7k driver

Description

Would like to request for quick implementation of DPO 7k driver since there is already DPO 7kc driver in the library :)

Additional Information

No response

[BUG]: Impossible to launch twice a test on Keithley 2450 SMU

Description of the bug

I am not able to launch more than one time a script with my Keithley2450 connected through LAN.

Steps To Reproduce

  1. Launch any examples scripts (for example: the solar cell one)
  2. It works
  3. Try again with the same scripts
  4. I get the following message everytime
 in __clear_visa_output_buffer_and_get_idn
    raise SystemError(error_msg)
      visa_resource = <'TCPIPInstrument'('TCPIP0::192.168.XXX.YYY::inst0::INSTR')>
      idn_response = ''
      error_msg = "VI_ERROR_ABORT (-1073807312): User abort occurred during transfer.\n\tUnable to read data after 2s.\n\t\n\tPlease reboot or read/clear the VISA output buffer on your device and try again."
      old_timeout = 2000
builtins.SystemError: VI_ERROR_ABORT (-1073807312): User abort occurred during transfer.
        Unable to read data after 2s.
        Please reboot or read/clear the VISA output buffer on your device and try again.

Environment Information

  • Keithley 2450 connected through LAN

Additional Information

No response

[BUG]: Glossary links on the home page don't work

Description of the bug

The glossary links on the home page of the documentation hosted on ReadtheDocs don't take you to the glossary entry. Instead, they take you to the 404 page.

Steps To Reproduce

  1. Go to https://tm-devices.readthedocs.io/latest/#supported-devices-software-solutions
  2. Click on any of the links in the table
  3. Notice how it takes you to the 404 page instead of the glossary page

Environment Information

No response

Additional Information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.