Skip to content

improve handling of extraction when data unavailable #112

@orgua

Description

@orgua

data-cli -> Extracting GPIO if gpio not available fails with exception

TODO:

  • also check other extraction-functions
  • validate by unittests
root@ba8009bb0a16:/workspace/shepherd/2025-11-28_11-47-41_riotee_test# shepherd-data extract-gpio sheep05.h5
Extracting gpio-trace from from 'sheep05.h5' ...
Traceback (most recent call last):
  File "/usr/local/bin/shepherd-data", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/shepherd_data/cli.py", line 311, in extract_gpio
    wfs = shpr.gpio_to_waveforms()
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/shepherd_core/reader.py", line 723, in gpio_to_waveforms
    gpio_f = self.get_filter_for_redundant_states(gpio_ps)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/shepherd_core/reader.py", line 704, in get_filter_for_redundant_states
    data_1 = np.concatenate(([not data[0]], data[:-1]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions