entropy-lab / entropy

BSD 3-Clause "New" or "Revised" License
30 stars 13 forks source link

InProcessParamStore does not parse dot-notation keys #209

Open urig opened 2 years ago

urig commented 2 years ago

The ParamStore API currently supports both specifying keys as dictionary keys:

param_store['key'] = value

and as attributes:

param_store.key = value

However, this key/attribute equivalence does not extended to parsing dot notation into full blown nested dictionary hierarchy. More formally:

Steps to reproduce:

param_store= InProcessParamStore()
param_store["qubit1.flux_capacitor.freq"] = 8.0

Expected result:

param_store.qubit1.flux_capacitor.freq == 8.0 # should be True

Actual result:

AttributeError is raised complaining about qubit1 not being an attribute.

We should consider augmenting the InProcessParamStore implementation so that it fulfills the above expectation.

galwiner commented 2 years ago

@urig I think this is now resolved, right?