Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for VectorOfVectors by setting vector_len field when declaring variables #25

Merged
merged 25 commits into from
Jan 2, 2024

Conversation

iguinn
Copy link
Collaborator

@iguinn iguinn commented Nov 30, 2023

When setting up a processing chain, it is now possible to read and write VectorOfVectors (see issue #3). To do so, when declaring an output variable, set vector_len to a variable that is a scalar integer. For example, here we set vt_min/max_out to have lengths determined by n_min/max_out:

          "vt_max_out, vt_min_out, n_max_out, n_min_out": {
          "function": "get_multi_local_extrema",
          "module": "dspeed.processors.get_multi_local_extrema",
          "args": ["wf_shorttrap", 250, 250, 1, 500, 0, "vt_max_out(20, vector_len=n_max_out)",
            "vt_min_out(20, vector_len=n_min_out)", "n_max_out", "n_min_out"],
          "unit": ["ns", "ns", "none", "none"]
        },

In addition, the WaveformBrowser is capable of drawing VectorOfVector quantities, using verticle or horizontal lines:
Untitled

Some other changes:

  • get_multi_local_extrema now uses uint32 for n_min and n_max. This is necessary to use these as the lengths in a VectorOfVectors. Instead of returning NaN, return 0
  • Fixed tests for get_multi_local_extrema
  • Fixed bug where dimensionless quantities were getting written in waveform browser legends with the word "dimensionless"
  • Updated sipm config file in tests to use VectorOfVectors
  • Now require LGDO version >= 1.4

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (71e3f9c) 60.83% compared to head (c5849f0) 61.39%.

Files Patch % Lines
src/dspeed/processing_chain.py 71.05% 22 Missing ⚠️
src/dspeed/vis/waveform_browser.py 60.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
+ Coverage   60.83%   61.39%   +0.56%     
==========================================
  Files          46       46              
  Lines        2913     2976      +63     
==========================================
+ Hits         1772     1827      +55     
- Misses       1141     1149       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gipert
Copy link
Member

gipert commented Dec 30, 2023

Pinning legend-pydataobj to v1.5.0a1 should fix the CI!

@gipert
Copy link
Member

gipert commented Jan 2, 2024

Using setup.cfg from main should fix everything

@iguinn iguinn merged commit fe1bf0d into legend-exp:main Jan 2, 2024
11 checks passed
@gipert gipert linked an issue Jan 2, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Processors with variable numbers of outputs
2 participants