model_organization.utils module¶
Functions
|
Check if a file of directory is contained in another. |
|
Convenience method to get the directory of a given python module |
|
Return the next name that numerically follows old |
|
|
|
Split up the key by . |
|
|
|
Function to create a list |
-
dir_contains
(dirname, path, exists=True)[source]¶ Check if a file of directory is contained in another.
- Parameters
Notes
path and dirname must be either both absolute or both relative paths
-
go_through_dict
(key, d, setdefault=None)[source]¶ Split up the key by . and get the value from the base dictionary d
- Parameters
key (str) – The key in the config configuration. If the key goes some levels deeper, keys may be separated by a
'.'
(e.g.'namelists.weathergen'
). Hence, to insert a','
, it must be escaped by a preceeding''
.d (dict) – The configuration dictionary containing the key
setdefault (callable) – If not None and an item is not existent in d, it is created by calling the given function
- Returns
str – The last level of the key
dict – The dictionary in d that contains the last level of the key