bps submit TypeError about SerializedDataCoordinate

Description

 
From https://lsstc.slack.com/archives/C01FBUGM2CV/p1619719789074900 
 
File "/software/lsstsw/stack_20210415/stack/miniconda3-py38_4.9.2-0.5.0/Linux64/ctrl_bps/21.0.0-15-g989803d+0f295defb6/python/lsst/ctrl/bps/quantum_clustering_funcs.py", line 75, in single_quantum_clustering
info["label"] = label
TypeError: 'SerializedDataCoordinate' object does not support item assignment

Checklist

Lucidchart Diagrams

Issue Matrix

hide

Activity

Show:
Michelle Gower
April 29, 2021 at 9:29 PM

Thanks.  Code updated and pushed (after running a pipelines check to test it).

Tim Jenness
April 29, 2021 at 9:29 PM

Change looks good (please squash the two commits).

Tim Jenness
April 29, 2021 at 7:58 PM

You can already get the dict of the dataId directly from the DataCoordinate: https://github.com/lsst/daf_butler/blob/master/python/lsst/daf/butler/core/dimensions/_coordinate.py#L656-L659

The code there shows you how to do it but adding `.byName()` is what you probably want there.

Michelle Gower
April 29, 2021 at 7:40 PM

The following line of code bothers me: 

data_id = quantum_node.quantum.dataId.to_simple().dataId

I looked around for a little bit but must have missed any way to do it better.  In the future, it would be nice if there was an API to get a dictionary of dataId values so that this code isn't as brittle.

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Reviewers

Tim Jenness

RubinTeam

Components

Checklist

Created April 29, 2021 at 6:41 PM
Updated April 29, 2021 at 10:09 PM
Resolved April 29, 2021 at 10:09 PM