Repository: Pyomo/pyomo

Issue:
Dead code
Just out of curiousity, is there a reason for this dead code?

https://github.com/Pyomo/pyomo/blob/4f882680ed15de09dbbf4e25deeeadd56eb54263/pyomo/core/base/PyomoModel.py#L741
Dead code
Just out of curiousity, is there a reason for this dead code?

https://github.com/Pyomo/pyomo/blob/4f882680ed15de09dbbf4e25deeeadd56eb54263/pyomo/core/base/PyomoModel.py#L741


Discussion:
It is legacy code from the old Coopr days.  I am pretty sure it was left in as a "reminder" of how we used to do certain things -- but at this point, it should be safe (and a good idea) to remove it.

The "pyomo solution process" used to proceed through the following process:
  1. create the abstract model
  2. create a concrete instance by applying data
  3. "preprocess" the instance to gather various statistics and clean up some data structures
  4. write the instance to some output format (LP or NL)
  5. invoke the solver
  6. process the solver output

A number of years ago, as transformations became more prevalent and users began to write more complex scripts, we realized that the "preprocess" step was very specific to the "old" workflow and didn't map well onto the current "concept of operations" so it was removed.
It is legacy code from the old Coopr days.  I am pretty sure it was left in as a "reminder" of how we used to do certain things -- but at this point, it should be safe (and a good idea) to remove it.

The "pyomo solution process" used to proceed through the following process:
  1. create the abstract model
  2. create a concrete instance by applying data
  3. "preprocess" the instance to gather various statistics and clean up some data structures
  4. write the instance to some output format (LP or NL)
  5. invoke the solver
  6. process the solver output

A number of years ago, as transformations became more prevalent and users began to write more complex scripts, we realized that the "preprocess" step was very specific to the "old" workflow and didn't map well onto the current "concept of operations" so it was removed.

Resolving patch:
diff --git a/pyomo/core/base/PyomoModel.py b/pyomo/core/base/PyomoModel.py
--- a/pyomo/core/base/PyomoModel.py
+++ b/pyomo/core/base/PyomoModel.py
@@ -734,32 +734,6 @@ def create_instance( self, filename=None, data=None, name=None,
                        namespaces=_namespaces,
                        profile_memory=profile_memory )
 
-        #
-        # Preprocess the new model
-        #
-
-        if False and preprocess is True:
-
-            if report_timing is True:
-                start_time = time.time()
-
-            instance.preprocess()
-
-            if report_timing is True:
-                total_time = time.time() - start_time
-                print("      %6.2f seconds required for preprocessing" % total_time)
-
-            if (pympler_available is True) and (profile_memory >= 2):
-                mem_used = muppy.get_size(muppy.get_objects())
-                print("      Total memory = %d bytes following instance preprocessing" % mem_used)
-                print("")
-
-            if (pympler_available is True) and (profile_memory >= 2):
-                print("")
-                print("      Summary of objects following instance preprocessing")
-                post_preprocessing_summary = summary.summarize(muppy.get_objects())
-                summary.print_(post_preprocessing_summary, limit=100)
-
         #
         # Indicate that the model is concrete/constructed
         #


Test patch: