MONAI
MONAI copied to clipboard
Add methods to get all key chains, and convert it from/to list format in ConfigParser
Is your feature request related to a problem? Please describe. Currently one can recursively get value from a chain of keys separated by special characters. For example, one can do the following
cfg = ConfigParser(config)
key_chain = "key1#key2#key3"
cfg.get(key_chain)
The problem is format may not interface with other code/module well. One example is Auto3D which format key chain in a list ['key1', 'key2', 'key3']. It would be good to add some convenient functions in the ConfigParser class to support easy interface
Describe the solution you'd like Two new functions
- convert a list of keys to the key chain
- recursively find out all possible key_chains in the self.config of ConfigParser