File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -371,3 +371,26 @@ def default_shape(problem, n):
371371 dH = (n , problem .n_eq_constr , n_var ),
372372 )
373373 return DEFAULTS
374+
375+
376+ # ===========================================================================
377+ # Backward compatibility for moved parallelization classes
378+ # ===========================================================================
379+
380+ def __getattr__ (name ):
381+ """
382+ Provide backward compatibility for StarmapParallelization import.
383+ This class was moved from pymoo.core.problem to pymoo.parallelization.
384+ """
385+ if name == 'StarmapParallelization' :
386+ import warnings
387+ warnings .warn (
388+ "Importing 'StarmapParallelization' from 'pymoo.core.problem' is deprecated. "
389+ "Please use 'from pymoo.parallelization import StarmapParallelization' instead. "
390+ "This backward compatibility import will be removed in a future version." ,
391+ DeprecationWarning ,
392+ stacklevel = 2
393+ )
394+ from pymoo .parallelization import StarmapParallelization
395+ return StarmapParallelization
396+ raise AttributeError (f"module '{ __name__ } ' has no attribute '{ name } '" )
You can’t perform that action at this time.
0 commit comments