Ticket #9067 (closed: fixed)
Config keys
Reported by: | Owen Arnold | Owned by: | Dan Nixon |
---|---|---|---|
Priority: | major | Milestone: | Release 3.4 |
Component: | Python | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Harry Jeffery |
Description
This is a suggestion that I personally would find quite useful - lets see how it fares with the triage stages.
The config dictionary-like object exposed to python doesn't have a keys() method. This makes it very hard to figure out what keys are available to extract values for. I think a keys() method would make this type more pythonic.
Change History
comment:1 Changed 7 years ago by Nick Draper
- Status changed from new to assigned
- Owner changed from Anyone to Martyn Gigg
comment:2 Changed 5 years ago by Dan Nixon
- Owner changed from Martyn Gigg to Dan Nixon
- Milestone changed from Backlog to Release 3.4
comment:4 Changed 5 years ago by Dan Nixon
Clang format Refs #9067
Changeset: e0525f2bb9f6c200787d5ef0638ee8d2382aa150
comment:5 Changed 5 years ago by Dan Nixon
Work recursively as nesting length is not constant
Refs #9067
Changeset: dfd22f0bd180d2a5b9d6babaac9b9b2d9332b7d5
comment:6 Changed 5 years ago by Dan Nixon
- Status changed from inprogress to verify
- Resolution set to fixed
This is being verified as pull request #585.
comment:7 Changed 5 years ago by Harry Jeffery
- Status changed from verify to verifying
- Tester set to Harry Jeffery
comment:8 Changed 5 years ago by Harry Jeffery
Something to consider:
It looks like getKeysRecursive could/should be private to the class. You could also change its type to void getKeysRecursive(const std::string& root, std::vector<std::string>& keys). That way it can insert the keys into the output keys vector directly, and just pass the reference down the layers. It would save on the construction/destruction of the vector for each call, and you don't have to copy the keys around each time you move up a layer.
comment:9 Changed 5 years ago by Dan Nixon
Good point on the vector allocation, I was keeping getKeysRecursive as similar as possible to the existing getKeys but I think the scope of how useful it actually is is limited.
comment:10 Changed 5 years ago by Dan Nixon
comment:11 Changed 5 years ago by Dan Nixon
comment:12 Changed 5 years ago by Harry Jeffery
- Status changed from verifying to closed
Merge pull request #585 from mantidproject/9067_configservice_keys_python_api
Add keys() method to ConfigService
Full changeset: 19ff857cbb0944afd11d12ee83e0475f1380ccb3
comment:13 Changed 5 years ago by Dan Nixon
comment:14 Changed 5 years ago by Dan Nixon
Clang format Refs #9067
Changeset: 3a1d44537a95217e7e3f7d31421ded0784e5b408
comment:15 Changed 5 years ago by Dan Nixon
Work recursively as nesting length is not constant
Refs #9067
Changeset: b5ff8c338bb3433889bff875c18c9aa16af230a3
comment:16 Changed 5 years ago by Dan Nixon
comment:17 Changed 5 years ago by Dan Nixon
comment:18 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 9910