Changeset 2110


Ignore:
Timestamp:
Jan 2, 2010 4:52:46 PM (10 years ago)
Author:
jwatson
Message:

Promoted the scenario tree model to a pysp/util package (with Bill's excellent guidance), and eliminated the replicated ScenarioStructure?.py files from the examples directory.

The only place the master scenario tree model exists is now in coopr/pysp/util/scenariomodels.py, and the (abstract) model is called scenario_tree_model.

Location:
coopr.pysp/trunk
Files:
3 added
8 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/ef.py

    r2058 r2110  
    122122   #
    123123
    124    treeimport = pyutilib.misc.import_file(model_directory+os.sep+"ScenarioStructure.py")
    125 
    126    tree_data = treeimport.model.create(instance_directory+os.sep+"ScenarioStructure.dat")
     124   from coopr.pysp.util.scenariomodels import scenario_tree_model
     125
     126   tree_data = scenario_tree_model.create(instance_directory+os.sep+"ScenarioStructure.dat")
    127127
    128128   #
  • coopr.pysp/trunk/coopr/pysp/ph_script.py

    r2062 r2110  
    358358      #
    359359
    360       scenario_tree_model = None
     360      from coopr.pysp.util.scenariomodels import scenario_tree_model
    361361      scenario_tree_instance = None
    362 
    363       try:
    364          scenario_tree_model_filename = options.model_directory+os.sep+"ScenarioStructure.py"
    365          if options.verbose is True:
    366             print "Scenario tree model filename="+scenario_tree_model_filename
    367          scenario_tree_import = pyutilib.misc.import_file(scenario_tree_model_filename)
    368          scenario_tree_model = scenario_tree_import.model
    369       except IOError:
    370          print "***ERROR: Failed to load scenario tree reference model from file="+scenario_tree_model_filename
    371          return   
    372362
    373363      try:
Note: See TracChangeset for help on using the changeset viewer.