Skip to main content

FLooPy
Tester-Agnostic Sequencer for Hardware-Testing in Python

Tests

  • ... can performed within different test-environments
  • ... can organized in hierarchical layers with (sub-) tasks
  • ... can have setup, task/test, teardown, final and output functions
  • Every variable
    • ... has an unique namespace
    • ... is stored as a time-signal with timestamps
    • ... can be sub-classed
  • Data dependencies between functions are resolved by a graph-based approach
  • Auto-Save for loop-recovery and post-processing (experimental)
  • Can handle non-reentrant tests by an extra extension (unpublished)

Loops

  • Flexible loop configuration (nested, zipped, concatenated)
  • Standard loops: loop_items, loop_lin, loop_log, loop_bisect
  • Feedback for HiL possible

Getting Started

Suppose we want to test if the internal resistance of an battery rbat is inside the test-limits:

  • The test-environment is abstracted by the namespace of the dut input and must be specified later, just before running the test-case.
  • The loop over the load current i_load can be either configured locally inside the test-case or later, just before running the test-case.

Test-Case

import floopy as fly


class Test_Rbat_Charged(fly.Task):
    dut = fly.Input()  # object to stimulate device-under-test and measure response
   
    i_load = fly.Input(min=0, max=1.5, unit='A', default=fly.loop_lin(num=3))
    
    def task(dut, i_load):
        dut.current = i_load
        return dut.voltage

    def final_fit(i=fly.Squeeze(task.i_load), v=fly.Squeeze(task)):
        import numpy as np
        return np.polyfit(i, v, deg=1)
        
    @fly.Output(min=0, ltl=0.2, utl=2, max=10, unit='ohm')
    def rbat(coeffs=final_fit):
        return coeffs[0]

Test-Plan

Now, the test-case Test_Rbat_Charged can be used with different loop-configurations and within different test-environments. For demonstration we just use the simple resistor equation as a simulation-environment.

class TestPlan_BatterCheck(fly.Task):
    def dut():
        class Dut:
            @property
            def voltage(self):
                resistance = 0.8  # ohm
                return resistance * self.current
        return Dut()

    test_rbat_charged = Test_Rbat_Charged(dut, i_load=fly.loop_log(0.1, 1, num=5))

Note, that we changed the default loop-configuration of i_load to a logarithmic scaling.

In order to perform the Test-Plan we need a DataManager saving all loop-states and measurement results as time-signals in a json-file.

>>> dm = fly.DataManager()
>>> dm.run_live(TestPlan_BatterCheck)

╭─ TestPlan_BatterCheck ─╮
│  ✔  test_rbat_charged  │
╰────────────────────────╯
File: dm/dm_2024-10-10_16:00:29.json

The test results and all variables can be analyzed via pandas-tables.

>>> dm.read_task(TestPlan_BatterCheck)
test_rbat_charged
rbat check
0.8 True
>>> tp = TestPlan_BatterCheck()
>>> dm.read_task(tp.test_rbat_charged.task)
i_load __return__
TestPlan_BatterCheck.test_rbat_charged.i_load
0.100000 0.100000 0.080000
0.177828 0.177828 0.142262
0.316228 0.316228 0.252982
0.562341 0.562341 0.449873
1.000000 1.000000 0.800000

For a real measurement we leave the test-case unchanged and just need to replace the dut function in the test-plan with something like

def dut():
    import instruments
    dut = instruments.PowerSupply()
    return dut

assuming an equal namespace

dut.voltage
dut.current

with an equal behavior.

Further information can be found in the FLooPy-Tutorial which is more detailed.

Install

Simply do either

pip install floopy

or download the repository for a more recent version, change into the floopy folder and

pip install . --user

If necessary you can run the tests with

python -m pytest

Licence

LoopyPlot is licenced under GPL 3.

Metadata

Release files for floopy 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for floopy 0.1.2
File Size Uploaded
floopy-0.1.2.tar.gz 60.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for floopy 0.1.2
File Interpreter ABI Platform
floopy-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 103.7 kB

Release files / floopy-0.1.2.tar.gz

Download URL floopy-0.1.2.tar.gz
Size 60.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3500cc2ed75f681a44cad752adb57cb0bc5612c8ba7d632677b37e46f03d0fa6
BLAKE2b-256 checksum
How to use checksums
4c04826501db2f4f37413b0a3ee7fd1d008dd5c3d4613805f3bc79ef182f0407
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / floopy-0.1.2-py3-none-any.whl

Download URL floopy-0.1.2-py3-none-any.whl
Size 43.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae8e80a9824976538511eacf36f0b0b92c3a1d5c7e6714539298d892fdf976b0
BLAKE2b-256 checksum
How to use checksums
aed0d13cd6224b07be4e76aad077ac47ad09839d2b31e97610782187d57f1809
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page