microsoft / microsoft/Qcodes

hdf5 formatter cannot write a dataset twice

Open
#448 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When calling the `write_copy` method of the dataset on an existing location an error is generated.

A minimal example:

```
import numpy as np
import qcodes
from qcodes.tests.data_mocks import DataSet2D
from qcodes.data.hdf5_format import HDF5Format

qcodes.DataSet.default_formatter = HDF5Format()

dataset = DataSet2D()
dataset.write()
newlocation = dataset.location
dataset.write_copy(location=newlocation)
```
And another variation
```
from qcodes.tests.data_mocks import DataSet2D
from qcodes.data.hdf5_format import HDF5Format,HDF5FormatMetadata
qcodes.DataSet.default_formatter = HDF5Format()

dataset = DataSet2D()
dataset.write()
dataset.formatter.write(dataset, force_write=True)
```
@core @AdriaanRol

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

Start by reproducing the two examples with DataSet2D and inspect qcodes/data/hdf5_format.py, especially the formatter write path and write_copy handling for an existing location. Determine why a second write raises an error, then verify that repeated writes to the same dataset location complete successfully without breaking the initial write behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.