Show
Ignore:
Timestamp:
05/11/08 19:04:57 (3 months ago)
Author:
borning
Message:

added initialize_from_xml_file method to XMLConfiguration; used it in reestimate method in EstimationRunner? to allow reloading the xml file

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/urbansim/estimation/estimation_runner.py

    r3311 r3323  
    8787        Estimator.__init__(self, config, save_estimation_results=save_estimation_results) 
    8888 
    89     def reestimate(self, submodels=None): 
     89    def reestimate(self, submodels=None, reload_xml_file=True): 
    9090        """Launch a re-estimation without recomputing all variables. 'submodels' is a list or single number of submodels to re-estimate. 
    91         If it is None, all submodels are re-estimated. 
     91        If it is None, all submodels are re-estimated.  If self.xml_configuration is not None and reload_xml_file is True, re-read 
     92        the contents of the xml configuration file in case it has changed.  This will usually be what you want to do when  
     93        using reestimate from the command line -- but not from the GUI (since with the GUI, the XMLConfiguration might have been  
     94        edited but not yet saved back to the file). 
    9295        """ 
    9396        specification_dict=None 
    9497        if self.xml_configuration is not None: 
     98            if reload_xml_file: 
     99                self.xml_configuration.initialize_from_xml_file() 
    95100            specification_dict = self.xml_configuration.get_estimation_specification(self.estimated_model) 
    96101        Estimator.reestimate(self, self.specification_module, specification_dict=specification_dict, type=self.model_group, submodels=submodels)