### Build and Configure Development Environment Source: https://joulescope.readthedocs.io/en/latest/user/install.html Install requirements and build native modules for development. ```bash pip3 install -U -r requirements.txt ``` ```bash python setup.py build_ext --inplace export PYTHONPATH=`cwd` ``` ```bash python setup.py build_ext --inplace set PYTHONPATH=%cd% ``` -------------------------------- ### Install pyjoulescope via PyPI Source: https://joulescope.readthedocs.io/en/latest/user/install.html Install the package using pip. ```bash pip3 install -U joulescope ``` -------------------------------- ### Install pyjoulescope from Source Source: https://joulescope.readthedocs.io/en/latest/user/install.html Install developer dependencies or the package itself from the local directory. ```bash pip3 install -U -e .[dev] ``` ```bash pip3 install -U . ``` -------------------------------- ### Install Python and Dependencies on macOS Source: https://joulescope.readthedocs.io/en/latest/user/install.html Use Homebrew to install Python and libusb. ```bash $ brew install python3 libusb $ python3 -VV ``` -------------------------------- ### Manage Virtual Environments Source: https://joulescope.readthedocs.io/en/latest/user/install.html Commands to install virtualenv, create environments, and activate them on different platforms. ```bash pip3 install -U virtualenv ``` ```bash virtualenv ~/venv/joulescope ``` ```bash source ~/venv/joulescope/bin/activate ``` ```bash virtualenv c:\venv\joulescope source c:\venv\joulescope\Scripts\activate ``` -------------------------------- ### Install Python and Dependencies on Linux Source: https://joulescope.readthedocs.io/en/latest/user/install.html Install Python development headers and libusb using the system package manager. ```bash $ sudo apt install python3-dev python3-pip libusb-1.0-0 $ python3 -VV ``` -------------------------------- ### Verify Python Installation on Windows Source: https://joulescope.readthedocs.io/en/latest/user/install.html Check the installed Python version using the command prompt. ```bash > python -VV Python 3.13.0 (tags/v3.13.0:60403a5, Oct 7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] ``` -------------------------------- ### Install pyjoulescope with Trusted Host Source: https://joulescope.readthedocs.io/en/latest/user/install.html Bypass SSL certificate verification if corporate IT policies block PyPI. ```bash pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org -U joulescope ``` -------------------------------- ### Display CLI help Source: https://joulescope.readthedocs.io/en/latest/user/quickstart.html List all available commands for the joulescope CLI tool. ```bash joulescope help ``` -------------------------------- ### Capture data via CLI Source: https://joulescope.readthedocs.io/en/latest/user/quickstart.html Use the command-line tool to capture a contiguous 1.0 second duration of data to a file. ```bash joulescope capture --contiguous 1.0 mycapture.jls ``` -------------------------------- ### Configure Linux udev Rules Source: https://joulescope.readthedocs.io/en/latest/user/install.html Grant user permissions to access Joulescope hardware. ```bash $ wget https://raw.githubusercontent.com/jetperch/pyjoulescope/master/99-joulescope.rules $ sudo cp 99-joulescope.rules /etc/udev/rules.d/ $ sudo udevadm control --reload-rules ``` -------------------------------- ### Read and average data in Python Source: https://joulescope.readthedocs.io/en/latest/user/quickstart.html Open the instrument, read 0.25 seconds of data, and calculate the mean current and voltage. ```python import joulescope import numpy as np with joulescope.scan_require_one(config='auto') as js: data = js.read(contiguous_duration=0.25) current, voltage = np.mean(data, axis=0) print(f'{current} A, {voltage} V') ``` -------------------------------- ### Clone pyjoulescope Repository Source: https://joulescope.readthedocs.io/en/latest/user/install.html Download the source code from GitHub. ```bash git clone https://github.com/jetperch/pyjoulescope.git ``` -------------------------------- ### Download pyjoulescope Source Archives Source: https://joulescope.readthedocs.io/en/latest/user/install.html Download the source code as a tarball or ZIP file. ```bash curl -Ol https://github.com/jetperch/pyjoulescope/tarball/master ``` ```bash https://github.com/jetperch/pyjoulescope/archive/master.zip ``` -------------------------------- ### Run package via Python module Source: https://joulescope.readthedocs.io/en/latest/user/quickstart.html Execute the joulescope package directly using the Python interpreter, useful when running from source. ```bash python3 -m joulescope --help ``` -------------------------------- ### Capture and Analyze Joulescope Data Source: https://joulescope.readthedocs.io/en/latest/index.html This snippet captures 0.1 seconds of data from a Joulescope and calculates the average current and voltage. Ensure the Joulescope is connected and recognized by the system. ```python import joulescope import numpy as np with joulescope.scan_require_one(config='auto') as js: data = js.read(contiguous_duration=0.1) current, voltage = np.mean(data, axis=0, dtype=np.float64) print(f'{current} A, {voltage} V') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.