microsoft / microsoft/Qcodes

Custom metadata changes the database schema (?!?)

Open
#898 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new dataset
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

### Steps to reproduce
1.
Rerun the following code 6 times, each iteration with a different word (of the list ['these', 'tags', 'break', 'the', 'database']) substituted for ####
```
meas = Measurement()
meas.registerParameter(dac.ch1) # register the first independent parameter
meas.registerParameter(dmm.v1, setpoints=(dac.ch1,)) # now register the dependent oone

with meas.run() as datasaver:
datasaver._dataset.add_metadata('####', '####')

for set_v in np.linspace(0, 25, 100):
dac.ch1.set(set_v)
get_v = dmm.v1.get()
datasaver.addResult((dac.ch1, set_v),
(dmm.v1, get_v))


dataid = datasaver.id # convenient to have for plotting
```
### Expected behaviour
Either a field (e.g. called 'metadata') of the table _runs_ gets filled with a json serialization of the custom metadata, or there is an extra table (metadata: tagid | run_id | name | value) which get populated with the custom metadata tags.

### Actual behaviour
![image](https://user-images.githubusercontent.com/980920/33560496-2741bec4-d910-11e7-9fca-092034e6a484.png)

### System
**operating system**

**qcodes branch**
feature/dataset

**qcodes commit**

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the six-run example and start at the _dataset.add_metadata call, then inspect how the run schema and custom metadata are persisted. Done means adding metadata no longer changes the database schema unexpectedly and the metadata remains available in the database in a consistent form.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.