Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • S spiir
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 73
    • Issues 73
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • lscsoft
  • spiir
  • Merge requests
  • !59

Draft: Use GstLALArrays in place of GValueArrays

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Timothy Davies requested to merge tdavies__add_gstlal_array into gstreamer_python_upgrade Oct 10, 2022
  • Overview 7
  • Commits 56
  • Pipelines 1
  • Changes 6

Resolves #70

This MR defines a new type, GstLALArray, to set and get properties on gstreamer elements that previously used GValueArray.
It wraps a GArray with the simplest API I could come up with.

GstLALArray stores GValues, which in turn store a type and a value.
When appending, it checks the GValue's type to ensure it only stores one type.
To make a multidimensional array, you can append a GValue containing a GstLALArray.

Note that when returning a GValue from C to Python, it seems to be unwrapped. However, the other direction is less reliable. Some conversion is attempted from Python types to GValues, but as described in #70 it struggles with anything other than fundamental types. As such, the python code needs to assemble a GValue with the precise type and value when appending to a GstLALArray.

Note also that GI uses comment introspection to export the types from C. Most of the comments in gstlal_array.c, for example, are meaningful code that are used during the build process.

Shortcuts/Drafts:

  • I've copy pasted some helper functions to convert GstLALArray to/from lists in python. If these helpers are acceptable, they should be in the GstLAL module.
  • The docs I've added aren't thoroughly considered
  • I couldn't get the namespaces in python (for GstLALArray and the preexisting GstLALFrHistory and GstLALGPSClock) to work quite right. The tag 'Method' was removed from a number of methods as part of that effort, and indeed it seems to be redundant, but maybe it should be verified.

The API is deliberately an MVP. It could definitely have more convenience features, but I think simple is reliable for now.

In general my emphasis was on getting something working so that testing could continue, but now that it's in that working state we'll need to consider the changes carefully.

Edited Oct 10, 2022 by Timothy Davies
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: tdavies__add_gstlal_array