microsoft / microsoft/Qcodes

loading dataset with new dataset code fails

Open
#1,121 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

Importing a dataset with `import_dat_file` fails for simple datasets.

A minimal example:
```
import os
from qcodes.dataset.legacy_import import import_dat_file

from qcodes.dataset.database import initialise_database
from qcodes.dataset.experiment_container import new_experiment

import numpy as np
import qcodes.tests
import qcodes.tests.data_mocks

# create dataset
ds=qcodes.tests.data_mocks.DataSet2D()
ds.write()
location=ds.location

initialise_database()

# put the old data in a new experiment
new_experiment('old_data_loading', sample_name='no_sample')
location1d = os.path.join(qcodes.DataSet.default_io.base_location, location)
run_ids = import_dat_file(location1d)
```
The code fails with error `AttributeError: 'NoneType' object has no attribute 'isidentifier'`
@WilliamHPNielsen @jenshnielsen @sohailc

Contributor guide

Open the contributing guide

Research direction

Start at import_dat_file in qcodes.dataset.legacy_import and reproduce the minimal example from the issue with qcodes.tests.data_mocks.DataSet2D. Trace the NoneType.isidentifier failure; done means the simple dataset imports successfully and import_dat_file returns run IDs without the AttributeError.

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.