Changeset 119

Show
Ignore:
Timestamp:
02/15/08 17:41:37 (5 years ago)
Author:
emuller
Message:

Add as_dict because transfering accross nodes of ParameterSets?
is not working in ipython ... this is a workaround for now

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/parameters.py

    r116 r119  
    296296 
    297297        return tmp 
     298 
     299 
     300    def as_dict(self): 
     301        """ returns a copy of the ParameterSet tree structure 
     302        as a nested dictionary""" 
     303 
     304        tmp = {} 
     305         
     306        for key in self: 
     307            value = self[key] 
     308            if isinstance(value, ParameterSet): 
     309                # recurse 
     310                tmp[key]=value.as_dict() 
     311            else: 
     312                tmp[key]=value 
     313 
     314        return tmp 
     315 
    298316 
    299317    def iter_range_key(self,range_key):