Pygobject workaround
This merge request allows users to build gstreamer pipelines with newer pygobject by working around missing type conversions. There has been no movement from the community on this despite it being reported
- https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/50
- https://gitlab.gnome.org/GNOME/pygobject/-/issues/488
We have about 3 years (and counting) of incompatibility between pygobject and gstreamer regarding array properties for elements. When it is fixed upstream, it will be easy to revert this change or leave it in place until backwards compatibility for the incompatible code is no longer needed.
Merge request reports
Activity
I was able to run an end-to-end small offline analysis using the igwn environment. There are python incompatibilities in our plotting scripts (which have nothing to do with this merge request), but the core codes all worked and I pushed through a result
BEFORE
AFTER
Why the change? I don't know, but we can't even begin to investigate without the work in this MR.
I added one additional value error and then tested some reasonable cases - of course users could still figure out some way to break this, but I think the state at the moment is reasonable so I will merge
from gstlal import pipeio import numpy # set works pipeio.format_property(set([1,2,3])) # tuple works pipeio.format_property(tuple([1,2,3])) # dictionary works pipeio.format_property({k:1 for k in [1,2]}) # generator works pipeio.format_property((x for x in [1,2,3,])) # 1D array works pipeio.format_property(numpy.ones((2))) # 2D array works pipeio.format_property(numpy.ones((2,2))) # 3D array does not - a value error is raised pipeio.format_property(numpy.ones((2,2,2)))
added 13 commits
-
4e04daf7...6e67f141 - 7 commits from branch
master
- c17d9727 - Patrick Godwin's code: work around backwards incompatible pygobject handling of arrays
- 15f8e7a2 - Patrick Godwin's code: work around backwards incompatible pygobject handling of arrays
- 10215d2b - Patrick Godwin's code: work around backwards incompatible pygobject handling of arrays
- 4be53f91 - gstlal/python/gstpipetools.py: pygobject work around
- fe38fbf3 - handle 1D arrays
- 4ee39870 - add assert for higher D arrays
Toggle commit list-
4e04daf7...6e67f141 - 7 commits from branch