MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

Add methods to get all key chains, and convert it from/to list format in ConfigParser

Open mingxin-zheng opened this issue 3 years ago • 0 comments

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

  1. convert a list of keys to the key chain
  2. recursively find out all possible key_chains in the self.config of ConfigParser

mingxin-zheng avatar Aug 12 '22 13:08 mingxin-zheng