Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • bliss bliss
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 544
    • Issues 544
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 145
    • Merge requests 145
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • BlissBliss
  • blissbliss
  • Issues
  • #2666
Closed
Open
Issue created Mar 24, 2021 by Wout De Nolf@denolfMaintainer

RoiCounters DevFailed behaviour

I am trying to find the cause of #2655 (closed) and it seems to be a mixture of several things. One of these things is a DevFailed exception from readCounters (proxy None). We capture the DevFailed but cause another error downstream (TypeError) because we returns 0D arrays.


class RoiCounters(IntegratingCounterController):
    def get_values(self, from_index, *counters):
        roi_counter_size = len(RoiStat)
        try:
            raw_data = self._proxy.readCounters(from_index)
        except DevFailed:
            return [numpy.array(-1)] * len(counters)
        ...

class IntegratingCounterAcquisitionSlave(BaseCounterAcquisitionSlave):
    def reading(self):
        from_index = 0
        while (
            not self.npoints or self._nb_acq_points < self.npoints
        ) and not self._stop_flag:

            counters = list(self._counters.keys())
            data = [
                counters[i].conversion_function(x)
                for i, x in enumerate(self.device.get_values(from_index, *counters))
            ]

            # >>>> THE FOLLOWING LINE RAISES A TYPE ERROR
            if not all_equal([len(d) for d in data]):
                raise RuntimeError("Read data can't have different sizes")
         

@matias.guijarro @pguillou @claustre Hiding lima problems like this makes for difficult debugging. At least do a log_exception here and return [numpy.array([-1])] * len(counters).

Edit: I personally wouldn't capture DevFailed at all.

Edited Mar 24, 2021 by Wout De Nolf
Assignee
Assign to
Time tracking