From bb6b80889f6d4b0c950b73cbaae52c2e245af8ec Mon Sep 17 00:00:00 2001 From: Bernard Knueven Date: Fri, 13 Sep 2024 14:19:20 -0600 Subject: [PATCH] adding new file header --- addheader.yml | 11 +++++++++++ doc/src/conf.py | 8 ++++++++ examples/acopf3/ACtree.py | 8 ++++++++ examples/acopf3/ccopf2wood.py | 8 ++++++++ examples/acopf3/ccopf_multistage.py | 8 ++++++++ examples/acopf3/fourstage.py | 8 ++++++++ examples/acopf3/rho_setter.py | 8 ++++++++ examples/afew.py | 8 ++++++++ examples/aircond/aircond_ama.py | 8 ++++++++ examples/aircond/aircond_cylinders.py | 8 ++++++++ examples/aircond/aircond_ef.py | 8 ++++++++ examples/aircond/aircond_seqsampling.py | 8 ++++++++ examples/aircond/bundle_pickler.py | 8 ++++++++ examples/battery/battery.py | 8 ++++++++ examples/battery/batteryext.py | 8 ++++++++ examples/battery/batterymain.py | 8 ++++++++ examples/distr/distr.py | 8 ++++++++ examples/distr/distr_admm_cylinders.py | 8 ++++++++ examples/distr/distr_data.py | 8 ++++++++ examples/distr/distr_ef.py | 8 ++++++++ examples/distr/globalmodel.py | 8 ++++++++ examples/farmer/PySP/abstract/ReferenceModel.py | 8 ++++++++ examples/farmer/PySP/concrete/ReferenceModel.py | 8 ++++++++ examples/farmer/cs_farmer.py | 8 ++++++++ examples/farmer/farmer.py | 8 ++++++++ examples/farmer/farmer_ama.py | 8 ++++++++ examples/farmer/farmer_cylinders.py | 8 ++++++++ examples/farmer/farmer_ef.py | 8 ++++++++ examples/farmer/farmer_lshapedhub.py | 8 ++++++++ examples/farmer/farmer_ph.py | 8 ++++++++ examples/farmer/farmer_rho_demo.py | 8 ++++++++ examples/farmer/farmer_seqsampling.py | 8 ++++++++ examples/farmer/from_pysp/abstract.py | 8 ++++++++ examples/farmer/from_pysp/concrete_ampl.py | 8 ++++++++ examples/farmer/schur_complement.py | 8 ++++++++ examples/generic_tester.py | 8 ++++++++ examples/hydro/PySP/models/ReferenceModel.py | 8 ++++++++ examples/hydro/hydro.py | 8 ++++++++ examples/hydro/hydro_cylinders.py | 8 ++++++++ examples/hydro/hydro_cylinders_pysp.py | 8 ++++++++ examples/hydro/hydro_ef.py | 8 ++++++++ examples/netdes/data/rename.py | 8 ++++++++ examples/netdes/drivertest.py | 8 ++++++++ examples/netdes/netdes.py | 8 ++++++++ examples/netdes/netdes_cylinders.py | 8 ++++++++ examples/netdes/netdes_ef.py | 8 ++++++++ examples/netdes/netdes_extension.py | 8 ++++++++ examples/netdes/netdes_ph.py | 8 ++++++++ examples/netdes/parse.py | 8 ++++++++ examples/run_all.py | 8 ++++++++ examples/sizes/config/rhosetter.py | 8 ++++++++ examples/sizes/models/ReferenceModel.py | 8 ++++++++ examples/sizes/sizes.py | 8 ++++++++ examples/sizes/sizes_cylinders.py | 8 ++++++++ examples/sizes/sizes_demo.py | 8 ++++++++ examples/sizes/sizes_ef.py | 8 ++++++++ examples/sizes/sizes_ph.py | 8 ++++++++ examples/sizes/sizes_pysp.py | 8 ++++++++ examples/sizes/special_cylinders.py | 8 ++++++++ examples/sizes/special_sizes.py | 8 ++++++++ examples/sslp/model/ReferenceModel.py | 8 ++++++++ examples/sslp/sslp.py | 8 ++++++++ examples/sslp/sslp_cylinders.py | 8 ++++++++ examples/sslp/sslp_ef.py | 8 ++++++++ examples/stoch_distr/globalmodel.py | 8 ++++++++ examples/stoch_distr/stoch_distr.py | 8 ++++++++ examples/stoch_distr/stoch_distr_admm_cylinders.py | 8 ++++++++ examples/stoch_distr/stoch_distr_ef.py | 8 ++++++++ examples/tryone.py | 8 ++++++++ examples/uc/cs_uc.py | 8 ++++++++ examples/uc/gradient_uc_cylinders.py | 8 ++++++++ examples/uc/rhoconfig10.py | 8 ++++++++ examples/uc/simple_ef.py | 8 ++++++++ examples/uc/uc3wood.py | 8 ++++++++ examples/uc/uc4wood.py | 8 ++++++++ examples/uc/uc_ama.py | 8 ++++++++ examples/uc/uc_cylinders.py | 8 ++++++++ examples/uc/uc_ef.py | 8 ++++++++ examples/uc/uc_funcs.py | 8 ++++++++ examples/uc/uc_lshaped.py | 8 ++++++++ examples/usar/abstract.py | 8 ++++++++ examples/usar/config.py | 8 ++++++++ examples/usar/extensive_form.py | 8 ++++++++ examples/usar/generate_data.py | 8 ++++++++ examples/usar/plot.py | 8 ++++++++ examples/usar/scenario_creator.py | 8 ++++++++ examples/usar/scenario_denouement.py | 8 ++++++++ examples/usar/wheel_spinner.py | 8 ++++++++ examples/usar/write_solutions.py | 8 ++++++++ file_header.txt | 6 ++++++ mpi_one_sided_test.py | 8 ++++++++ mpisppy/MPI.py | 8 ++++++++ mpisppy/__init__.py | 8 ++++++++ mpisppy/confidence_intervals/ciutils.py | 8 ++++++++ mpisppy/confidence_intervals/confidence_config.py | 8 ++++++++ mpisppy/confidence_intervals/mmw_ci.py | 8 ++++++++ mpisppy/confidence_intervals/mmw_conf.py | 8 ++++++++ mpisppy/confidence_intervals/multi_seqsampling.py | 8 ++++++++ mpisppy/confidence_intervals/sample_tree.py | 8 ++++++++ mpisppy/confidence_intervals/seqsampling.py | 8 ++++++++ mpisppy/confidence_intervals/zhat4xhat.py | 8 ++++++++ mpisppy/convergers/converger.py | 8 ++++++++ mpisppy/convergers/fracintsnotconv.py | 8 ++++++++ mpisppy/convergers/norm_rho_converger.py | 8 ++++++++ mpisppy/convergers/norms_and_residuals.py | 8 ++++++++ mpisppy/convergers/primal_dual_converger.py | 8 ++++++++ mpisppy/cylinders/cross_scen_spoke.py | 8 ++++++++ mpisppy/cylinders/fwph_spoke.py | 8 ++++++++ mpisppy/cylinders/hub.py | 8 ++++++++ mpisppy/cylinders/lagranger_bounder.py | 8 ++++++++ mpisppy/cylinders/lagrangian_bounder.py | 8 ++++++++ mpisppy/cylinders/lshaped_bounder.py | 8 ++++++++ mpisppy/cylinders/ph_ob.py | 8 ++++++++ mpisppy/cylinders/reduced_costs_spoke.py | 8 ++++++++ mpisppy/cylinders/slam_heuristic.py | 8 ++++++++ mpisppy/cylinders/spcommunicator.py | 8 ++++++++ mpisppy/cylinders/spoke.py | 8 ++++++++ mpisppy/cylinders/subgradient_bounder.py | 8 ++++++++ mpisppy/cylinders/xhatlooper_bounder.py | 8 ++++++++ mpisppy/cylinders/xhatshufflelooper_bounder.py | 8 ++++++++ mpisppy/cylinders/xhatspecific_bounder.py | 8 ++++++++ mpisppy/cylinders/xhatxbar_bounder.py | 8 ++++++++ mpisppy/extensions/avgminmaxer.py | 8 ++++++++ mpisppy/extensions/cross_scen_extension.py | 8 ++++++++ mpisppy/extensions/diagnoser.py | 8 ++++++++ mpisppy/extensions/extension.py | 8 ++++++++ mpisppy/extensions/fixer.py | 8 ++++++++ mpisppy/extensions/gradient_extension.py | 8 ++++++++ mpisppy/extensions/mipgapper.py | 8 ++++++++ mpisppy/extensions/mult_rho_updater.py | 8 ++++++++ mpisppy/extensions/norm_rho_updater.py | 8 ++++++++ mpisppy/extensions/phtracker.py | 8 ++++++++ mpisppy/extensions/reduced_costs_fixer.py | 8 ++++++++ mpisppy/extensions/test_extension.py | 8 ++++++++ mpisppy/extensions/wtracker_extension.py | 8 ++++++++ mpisppy/extensions/xhatbase.py | 8 ++++++++ mpisppy/extensions/xhatclosest.py | 8 ++++++++ mpisppy/extensions/xhatlooper.py | 8 ++++++++ mpisppy/extensions/xhatspecific.py | 8 ++++++++ mpisppy/extensions/xhatxbar.py | 8 ++++++++ mpisppy/fwph/fwph.py | 8 ++++++++ mpisppy/generic_cylinders.py | 8 ++++++++ mpisppy/log.py | 8 ++++++++ mpisppy/opt/aph.py | 8 ++++++++ mpisppy/opt/ef.py | 8 ++++++++ mpisppy/opt/lshaped.py | 8 ++++++++ mpisppy/opt/ph.py | 8 ++++++++ mpisppy/opt/presolve.py | 8 ++++++++ mpisppy/opt/sc.py | 8 ++++++++ mpisppy/phbase.py | 8 ++++++++ mpisppy/scenario_tree.py | 8 ++++++++ mpisppy/spbase.py | 8 ++++++++ mpisppy/spin_the_wheel.py | 8 ++++++++ mpisppy/spopt.py | 8 ++++++++ mpisppy/tests/examples/aircond.py | 8 ++++++++ mpisppy/tests/examples/aircondB.py | 8 ++++++++ mpisppy/tests/examples/apl1p.py | 8 ++++++++ mpisppy/tests/examples/distr.py | 8 ++++++++ mpisppy/tests/examples/farmer.py | 8 ++++++++ mpisppy/tests/examples/gbd/gbd.py | 8 ++++++++ mpisppy/tests/examples/hydro/hydro.py | 8 ++++++++ mpisppy/tests/examples/sizes/ReferenceModel.py | 8 ++++++++ mpisppy/tests/examples/sizes/sizes.py | 8 ++++++++ mpisppy/tests/examples/stoch_distr/stoch_distr.py | 8 ++++++++ .../stoch_distr/stoch_distr_admm_cylinders.py | 8 ++++++++ mpisppy/tests/examples/stoch_distr/stoch_distr_ef.py | 8 ++++++++ mpisppy/tests/examples/uc/uc_funcs.py | 8 ++++++++ mpisppy/tests/examples/w_test_data/farmer_get.py | 8 ++++++++ mpisppy/tests/examples/w_test_data/farmer_set.py | 8 ++++++++ mpisppy/tests/helper_extension.py | 8 ++++++++ mpisppy/tests/straight_tests.py | 8 ++++++++ mpisppy/tests/test_admmWrapper.py | 8 ++++++++ mpisppy/tests/test_aph.py | 8 ++++++++ mpisppy/tests/test_conf_int_aircond.py | 8 ++++++++ mpisppy/tests/test_conf_int_farmer.py | 8 ++++++++ mpisppy/tests/test_ef_ph.py | 8 ++++++++ mpisppy/tests/test_gradient_rho.py | 8 ++++++++ mpisppy/tests/test_pickle_bundle.py | 8 ++++++++ mpisppy/tests/test_pysp_model.py | 8 ++++++++ mpisppy/tests/test_sc.py | 8 ++++++++ mpisppy/tests/test_stoch_admmWrapper.py | 8 ++++++++ mpisppy/tests/test_w_writer.py | 8 ++++++++ mpisppy/tests/test_with_cylinders.py | 8 ++++++++ mpisppy/tests/utils.py | 8 ++++++++ mpisppy/utils/admmWrapper.py | 8 ++++++++ mpisppy/utils/amalgamator.py | 8 ++++++++ mpisppy/utils/baseparsers.py | 8 ++++++++ mpisppy/utils/callbacks/termination/__init__.py | 8 ++++++++ .../utils/callbacks/termination/solver_callbacks.py | 8 ++++++++ .../callbacks/termination/termination_callbacks.py | 8 ++++++++ .../utils/callbacks/termination/tests/markshare2.py | 8 ++++++++ .../callbacks/termination/tests/test_termination.py | 8 ++++++++ mpisppy/utils/cfg_vanilla.py | 8 ++++++++ mpisppy/utils/config.py | 8 ++++++++ mpisppy/utils/find_rho.py | 8 ++++++++ mpisppy/utils/gradient.py | 8 ++++++++ mpisppy/utils/listener_util/demo_listener_util.py | 8 ++++++++ mpisppy/utils/listener_util/doc/conf.py | 8 ++++++++ mpisppy/utils/listener_util/listener_util.py | 8 ++++++++ mpisppy/utils/lshaped_cuts.py | 8 ++++++++ mpisppy/utils/pickle_bundle.py | 8 ++++++++ mpisppy/utils/prox_approx.py | 8 ++++++++ mpisppy/utils/pysp_model/__init__.py | 8 ++++++++ mpisppy/utils/pysp_model/archivereader.py | 8 ++++++++ mpisppy/utils/pysp_model/instance_factory.py | 8 ++++++++ mpisppy/utils/pysp_model/phutils.py | 8 ++++++++ mpisppy/utils/pysp_model/pysp_model.py | 8 ++++++++ mpisppy/utils/pysp_model/tests/test_archivereader.py | 8 ++++++++ .../utils/pysp_model/tests/test_instancefactory.py | 8 ++++++++ mpisppy/utils/pysp_model/tests/test_scenariotree.py | 8 ++++++++ .../utils/pysp_model/tests/testdata/ReferenceModel.py | 8 ++++++++ .../pysp_model/tests/testdata/ScenarioStructure.py | 8 ++++++++ .../utils/pysp_model/tests/testdata/both_callbacks.py | 8 ++++++++ .../pysp_model/tests/testdata/reference_test_model.py | 8 ++++++++ .../testdata/reference_test_model_with_callback.py | 8 ++++++++ .../testdata/reference_test_scenario_tree_model.py | 8 ++++++++ mpisppy/utils/pysp_model/tree_structure.py | 8 ++++++++ mpisppy/utils/pysp_model/tree_structure_model.py | 8 ++++++++ mpisppy/utils/rho_utils.py | 8 ++++++++ mpisppy/utils/solver_spec.py | 8 ++++++++ mpisppy/utils/sputils.py | 8 ++++++++ mpisppy/utils/stoch_admmWrapper.py | 8 ++++++++ mpisppy/utils/wtracker.py | 8 ++++++++ mpisppy/utils/wxbarreader.py | 8 ++++++++ mpisppy/utils/wxbartester.py | 8 ++++++++ mpisppy/utils/wxbarutils.py | 8 ++++++++ mpisppy/utils/wxbarwriter.py | 8 ++++++++ mpisppy/utils/xhat_eval.py | 8 ++++++++ paperruns/larger_uc/ReferenceModel_OK.py | 8 ++++++++ paperruns/larger_uc/todat.py | 8 ++++++++ paperruns/larger_uc/uc_cylinders.py | 8 ++++++++ paperruns/larger_uc/uc_funcs.py | 8 ++++++++ run-mpitests.py | 8 ++++++++ setup.py | 8 ++++++++ 234 files changed, 1873 insertions(+) create mode 100644 addheader.yml create mode 100644 file_header.txt diff --git a/addheader.yml b/addheader.yml new file mode 100644 index 000000000..72287074f --- /dev/null +++ b/addheader.yml @@ -0,0 +1,11 @@ +# Usage: +# addheader -c addheader.yml +--- +root: . +text: file_header.txt +patterns: + - "*.py" + - "__init__.py" +verbose: 1 +sep_len: 80 +... diff --git a/doc/src/conf.py b/doc/src/conf.py index de060e490..0d7eab6a9 100644 --- a/doc/src/conf.py +++ b/doc/src/conf.py @@ -1,5 +1,13 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # # pyomo documentation build configuration file, created by # sphinx-quickstart on Mon Dec 12 16:08:36 2016. diff --git a/examples/acopf3/ACtree.py b/examples/acopf3/ACtree.py index 2232671ae..93f8a6dbe 100644 --- a/examples/acopf3/ACtree.py +++ b/examples/acopf3/ACtree.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### #Tree ideas; dlw Fall 2019 # Stage numbers and scenario numbers are one-based, but lists are all zero-based # Tree node numbers used in node names are zero-based. diff --git a/examples/acopf3/ccopf2wood.py b/examples/acopf3/ccopf2wood.py index 3f7ba510c..e97a774cd 100644 --- a/examples/acopf3/ccopf2wood.py +++ b/examples/acopf3/ccopf2wood.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # updated april 26 # mpiexec -np 2 python -m mpi4py ccopf2wood.py 2 3 # (see the first lines of main() to change instances) diff --git a/examples/acopf3/ccopf_multistage.py b/examples/acopf3/ccopf_multistage.py index 026891f23..5885d4bf8 100644 --- a/examples/acopf3/ccopf_multistage.py +++ b/examples/acopf3/ccopf_multistage.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # JPW and DLW; July 2019; ccopf create scenario instances for line outages # extended Fall 2019 by DLW import egret diff --git a/examples/acopf3/fourstage.py b/examples/acopf3/fourstage.py index 2387ec483..f4e5283a6 100644 --- a/examples/acopf3/fourstage.py +++ b/examples/acopf3/fourstage.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # four stage test # mpiexec -np 8 python -m mpi4py forustage.py 2 2 2 1 0 # (see the first lines of main() to change instances) diff --git a/examples/acopf3/rho_setter.py b/examples/acopf3/rho_setter.py index de29fc0b2..7c4284003 100644 --- a/examples/acopf3/rho_setter.py +++ b/examples/acopf3/rho_setter.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # January 2020; rho_setter for ccopf from n-1 stuff of a few years ago def generator_p_cost(md, g, output_level): diff --git a/examples/afew.py b/examples/afew.py index 581d82407..5bb5520ae 100644 --- a/examples/afew.py +++ b/examples/afew.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Run a few examples; dlw June 2020 # See also runall.py # Assumes you run from the examples directory. diff --git a/examples/aircond/aircond_ama.py b/examples/aircond/aircond_ama.py index aa2d205e5..44e5e8dc0 100644 --- a/examples/aircond/aircond_ama.py +++ b/examples/aircond/aircond_ama.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ An example of using amalgamator with 3 cylinders for a multistage problem To execute this: diff --git a/examples/aircond/aircond_cylinders.py b/examples/aircond/aircond_cylinders.py index f2a849142..2dc6999c8 100644 --- a/examples/aircond/aircond_cylinders.py +++ b/examples/aircond/aircond_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # NOTE: as of March 2022, consider aircondB.py as an alternative to aircond.py # Use bundle_pickler.py to create bundle pickles # NOTE: As of 3 March 2022, you can't compare pickle bundle problems with non-pickled. See _demands_creator in aircondB.py for more discusion. diff --git a/examples/aircond/aircond_ef.py b/examples/aircond/aircond_ef.py index 0793faec2..51364f3bd 100644 --- a/examples/aircond/aircond_ef.py +++ b/examples/aircond/aircond_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # multistage (4-stage) example using aircond model. Can be any number of stages, does not support unbalanced trees import pyomo.environ as pyo import numpy as np diff --git a/examples/aircond/aircond_seqsampling.py b/examples/aircond/aircond_seqsampling.py index cbd6a3777..99db45c19 100644 --- a/examples/aircond/aircond_seqsampling.py +++ b/examples/aircond/aircond_seqsampling.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Use the aircond model to illustrate how to use sequential sampling. # diff --git a/examples/aircond/bundle_pickler.py b/examples/aircond/bundle_pickler.py index a55babc7b..552b92fb9 100644 --- a/examples/aircond/bundle_pickler.py +++ b/examples/aircond/bundle_pickler.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Program to create proper bundles for aircond; DLW march 2022 # NOTE: As of 3 March 2022, you can't compare pickle bundle problems with non-pickled. See _demands_creator in aircondB.py for more discusion. # see try_pickles.bash diff --git a/examples/battery/battery.py b/examples/battery/battery.py index 158212c63..bbe0bbcf7 100644 --- a/examples/battery/battery.py +++ b/examples/battery/battery.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Solution to the Lagrangian relaxation of a hybrid solar-battery storage system from the paper: diff --git a/examples/battery/batteryext.py b/examples/battery/batteryext.py index 2be6cd07d..daacce700 100644 --- a/examples/battery/batteryext.py +++ b/examples/battery/batteryext.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import mpisppy.extension class BatteryExtension(mpisppy.extension.Extension): diff --git a/examples/battery/batterymain.py b/examples/battery/batterymain.py index 6989be62a..b418848c8 100644 --- a/examples/battery/batterymain.py +++ b/examples/battery/batterymain.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # updated April 2020 so it executes, but this needs a three driver from mpisppy.opt.ph import PH from battery import scenario_creator, scenario_denouement diff --git a/examples/distr/distr.py b/examples/distr/distr.py index fb6786b6e..91a381a97 100644 --- a/examples/distr/distr.py +++ b/examples/distr/distr.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Network Flow - various formulations import pyomo.environ as pyo import mpisppy.utils.sputils as sputils diff --git a/examples/distr/distr_admm_cylinders.py b/examples/distr/distr_admm_cylinders.py index 68ca5e434..06fec9770 100644 --- a/examples/distr/distr_admm_cylinders.py +++ b/examples/distr/distr_admm_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for distr with cylinders import mpisppy.utils.admmWrapper as admmWrapper import distr_data diff --git a/examples/distr/distr_data.py b/examples/distr/distr_data.py index ec5ca7501..580f5ceb4 100644 --- a/examples/distr/distr_data.py +++ b/examples/distr/distr_data.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Our data, gives the constraints inside each in region in region_dict_creator # and amongst the different regions in inter_region_dict_creator # The data slightly differs depending on the number of regions (num_scens) which is created for 2, 3 or 4 regions diff --git a/examples/distr/distr_ef.py b/examples/distr/distr_ef.py index 15a740f98..053e9bb66 100644 --- a/examples/distr/distr_ef.py +++ b/examples/distr/distr_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for distr with cylinders # This file can be executed thanks to python distr_ef.py --num-scens 2 --solver-name cplex_direct diff --git a/examples/distr/globalmodel.py b/examples/distr/globalmodel.py index 973afad26..88428bba8 100644 --- a/examples/distr/globalmodel.py +++ b/examples/distr/globalmodel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Distribution example without decomposition, this file is only written to execute the non-scalable example ### This code line can execute the script for a certain example diff --git a/examples/farmer/PySP/abstract/ReferenceModel.py b/examples/farmer/PySP/abstract/ReferenceModel.py index 9620fe739..bf80384f2 100644 --- a/examples/farmer/PySP/abstract/ReferenceModel.py +++ b/examples/farmer/PySP/abstract/ReferenceModel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/examples/farmer/PySP/concrete/ReferenceModel.py b/examples/farmer/PySP/concrete/ReferenceModel.py index 4c7311b46..db59ad2eb 100644 --- a/examples/farmer/PySP/concrete/ReferenceModel.py +++ b/examples/farmer/PySP/concrete/ReferenceModel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/examples/farmer/cs_farmer.py b/examples/farmer/cs_farmer.py index 691407a3d..079269bc6 100644 --- a/examples/farmer/cs_farmer.py +++ b/examples/farmer/cs_farmer.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import datetime import logging import sys diff --git a/examples/farmer/farmer.py b/examples/farmer/farmer.py index 9e22d7cec..70cf2ae80 100644 --- a/examples/farmer/farmer.py +++ b/examples/farmer/farmer.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # special for ph debugging DLW Dec 2018 # unlimited crops # ALL INDEXES ARE ZERO-BASED diff --git a/examples/farmer/farmer_ama.py b/examples/farmer/farmer_ama.py index b4eee0010..e0175a01f 100644 --- a/examples/farmer/farmer_ama.py +++ b/examples/farmer/farmer_ama.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ An example of using amalgamator and solving directly the EF To execute this: diff --git a/examples/farmer/farmer_cylinders.py b/examples/farmer/farmer_cylinders.py index f0e02c231..5a3220748 100644 --- a/examples/farmer/farmer_cylinders.py +++ b/examples/farmer/farmer_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for farmer with cylinders import farmer diff --git a/examples/farmer/farmer_ef.py b/examples/farmer/farmer_ef.py index 1f9ce374a..c86df4618 100644 --- a/examples/farmer/farmer_ef.py +++ b/examples/farmer/farmer_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This shows two ways to get parameters to the EF for solution; both are fairly short. import sys diff --git a/examples/farmer/farmer_lshapedhub.py b/examples/farmer/farmer_lshapedhub.py index d5cc4914c..255e077d8 100644 --- a/examples/farmer/farmer_lshapedhub.py +++ b/examples/farmer/farmer_lshapedhub.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for farmer with cylinders and an l-shape hub # NOTE: as of June 2020, it does not use the vanilla cylinders diff --git a/examples/farmer/farmer_ph.py b/examples/farmer/farmer_ph.py index 2ec439190..e54de9152 100644 --- a/examples/farmer/farmer_ph.py +++ b/examples/farmer/farmer_ph.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This shows using progressive hedging (PH) algorithm and using its smoothed # version (SPH) to solve the farmer problem. diff --git a/examples/farmer/farmer_rho_demo.py b/examples/farmer/farmer_rho_demo.py index b533baa39..a50df0ab8 100644 --- a/examples/farmer/farmer_rho_demo.py +++ b/examples/farmer/farmer_rho_demo.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This program can be used in two different ways: # Compute gradient-based cost and rho for a given problem # Use the gradient-based rho setter which sets adaptative gradient rho for PH. diff --git a/examples/farmer/farmer_seqsampling.py b/examples/farmer/farmer_seqsampling.py index 801926796..3d5a434a9 100644 --- a/examples/farmer/farmer_seqsampling.py +++ b/examples/farmer/farmer_seqsampling.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Illustrate the use of sequential sampling for programmers. # # This is an atypical program in that it allows for a command line diff --git a/examples/farmer/from_pysp/abstract.py b/examples/farmer/from_pysp/abstract.py index 4014950e0..0385b75ca 100644 --- a/examples/farmer/from_pysp/abstract.py +++ b/examples/farmer/from_pysp/abstract.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # from PySP where it was an AbstractModel, with AMPL format data import os diff --git a/examples/farmer/from_pysp/concrete_ampl.py b/examples/farmer/from_pysp/concrete_ampl.py index 51fb331cf..1ad72adb5 100644 --- a/examples/farmer/from_pysp/concrete_ampl.py +++ b/examples/farmer/from_pysp/concrete_ampl.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # from PySP where it was a concrete model with AMPL format scenario tree data import os import sys diff --git a/examples/farmer/schur_complement.py b/examples/farmer/schur_complement.py index d2960300d..b654cc545 100644 --- a/examples/farmer/schur_complement.py +++ b/examples/farmer/schur_complement.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import pyomo.environ as pe import farmer import mpisppy.utils.sputils as sputils diff --git a/examples/generic_tester.py b/examples/generic_tester.py index beab9a482..07579eb7b 100644 --- a/examples/generic_tester.py +++ b/examples/generic_tester.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This might make a mess in terms of output files.... # (re)baseline by uncommenting rebaseline_xhat lines # NOTE: the asynchronous nature of mip-sppy makes it hard to hit baselines. diff --git a/examples/hydro/PySP/models/ReferenceModel.py b/examples/hydro/PySP/models/ReferenceModel.py index 4518a909e..3449c6eba 100644 --- a/examples/hydro/PySP/models/ReferenceModel.py +++ b/examples/hydro/PySP/models/ReferenceModel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/examples/hydro/hydro.py b/examples/hydro/hydro.py index 09b174846..625eeedab 100644 --- a/examples/hydro/hydro.py +++ b/examples/hydro/hydro.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # updated april 2020 # DLW: mpisppy version, May 2019 # diff --git a/examples/hydro/hydro_cylinders.py b/examples/hydro/hydro_cylinders.py index 4410c2aab..16623f1b1 100644 --- a/examples/hydro/hydro_cylinders.py +++ b/examples/hydro/hydro_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for the hydro example with cylinders # Modfied April 2022 by DLW to illustrate config.py diff --git a/examples/hydro/hydro_cylinders_pysp.py b/examples/hydro/hydro_cylinders_pysp.py index af5c93a43..fe752f10e 100644 --- a/examples/hydro/hydro_cylinders_pysp.py +++ b/examples/hydro/hydro_cylinders_pysp.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for the hydro example with cylinders import hydro diff --git a/examples/hydro/hydro_ef.py b/examples/hydro/hydro_ef.py index bb05271ba..7af467ed6 100644 --- a/examples/hydro/hydro_ef.py +++ b/examples/hydro/hydro_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys import hydro import pyomo.environ as pyo diff --git a/examples/netdes/data/rename.py b/examples/netdes/data/rename.py index 1deb82ad9..7b31c3882 100644 --- a/examples/netdes/data/rename.py +++ b/examples/netdes/data/rename.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import subprocess piper = subprocess.Popen(['ls'], diff --git a/examples/netdes/drivertest.py b/examples/netdes/drivertest.py index d0d6efdc8..2e9b4a4bb 100644 --- a/examples/netdes/drivertest.py +++ b/examples/netdes/drivertest.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # DLW version: add Xhat import netdes diff --git a/examples/netdes/netdes.py b/examples/netdes/netdes.py index d0b831a5f..3a2308a9a 100644 --- a/examples/netdes/netdes.py +++ b/examples/netdes/netdes.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Implementation of a simple network design problem. See README for more info Created: 9 November 2019 by DTM diff --git a/examples/netdes/netdes_cylinders.py b/examples/netdes/netdes_cylinders.py index ebc6af132..a974d51e0 100644 --- a/examples/netdes/netdes_cylinders.py +++ b/examples/netdes/netdes_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys import os import copy diff --git a/examples/netdes/netdes_ef.py b/examples/netdes/netdes_ef.py index b57bc82cd..0975ce401 100644 --- a/examples/netdes/netdes_ef.py +++ b/examples/netdes/netdes_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Solve the EF of the network problems ''' from mpisppy.opt.ef import ExtensiveForm diff --git a/examples/netdes/netdes_extension.py b/examples/netdes/netdes_extension.py index acd803f6c..25da4ca6c 100644 --- a/examples/netdes/netdes_extension.py +++ b/examples/netdes/netdes_extension.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import numpy as np import pyomo.environ as pyo import mpisppy.utils.sputils as sputils diff --git a/examples/netdes/netdes_ph.py b/examples/netdes/netdes_ph.py index c544cea03..6bdb17e37 100644 --- a/examples/netdes/netdes_ph.py +++ b/examples/netdes/netdes_ph.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Solve the EF of the network problems ''' from netdes import scenario_creator, scenario_denouement diff --git a/examples/netdes/parse.py b/examples/netdes/parse.py index 22c69ebc8..aef06ebc8 100644 --- a/examples/netdes/parse.py +++ b/examples/netdes/parse.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Parse data from an instance file TODO: Currently storing the (dense) adjacency matrix. Cheaper not to. diff --git a/examples/run_all.py b/examples/run_all.py index 466374aba..884bf6132 100644 --- a/examples/run_all.py +++ b/examples/run_all.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Run a lot of examples for regression testing; dlw May 2020 # Not intended to be user-friendly. # Assumes you run from the examples directory. diff --git a/examples/sizes/config/rhosetter.py b/examples/sizes/config/rhosetter.py index 04d36d0d6..4d2cc810b 100644 --- a/examples/sizes/config/rhosetter.py +++ b/examples/sizes/config/rhosetter.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/examples/sizes/models/ReferenceModel.py b/examples/sizes/models/ReferenceModel.py index 872958490..cf4d1a3ac 100644 --- a/examples/sizes/models/ReferenceModel.py +++ b/examples/sizes/models/ReferenceModel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/examples/sizes/sizes.py b/examples/sizes/sizes.py index 5aab2311e..5aef3005d 100644 --- a/examples/sizes/sizes.py +++ b/examples/sizes/sizes.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import os import models.ReferenceModel as ref import mpisppy.utils.sputils as sputils diff --git a/examples/sizes/sizes_cylinders.py b/examples/sizes/sizes_cylinders.py index bdf438950..f4e475075 100644 --- a/examples/sizes/sizes_cylinders.py +++ b/examples/sizes/sizes_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys import copy import sizes diff --git a/examples/sizes/sizes_demo.py b/examples/sizes/sizes_demo.py index 6fac0deb5..b5cc77375 100644 --- a/examples/sizes/sizes_demo.py +++ b/examples/sizes/sizes_demo.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # updated 23 April 2020 # Serial (not cylinders) diff --git a/examples/sizes/sizes_ef.py b/examples/sizes/sizes_ef.py index 36c52fbe3..9c1855757 100644 --- a/examples/sizes/sizes_ef.py +++ b/examples/sizes/sizes_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys import mpisppy.phbase import pyomo.environ as pyo diff --git a/examples/sizes/sizes_ph.py b/examples/sizes/sizes_ph.py index d010cebcf..6489e0ac4 100644 --- a/examples/sizes/sizes_ph.py +++ b/examples/sizes/sizes_ph.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # updated 23 April 2020 # Serial (not cylinders) diff --git a/examples/sizes/sizes_pysp.py b/examples/sizes/sizes_pysp.py index 80e562f32..825e4bb09 100644 --- a/examples/sizes/sizes_pysp.py +++ b/examples/sizes/sizes_pysp.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys from pyomo.environ import SolverFactory diff --git a/examples/sizes/special_cylinders.py b/examples/sizes/special_cylinders.py index 66e64cbc4..f9a0ab4f2 100644 --- a/examples/sizes/special_cylinders.py +++ b/examples/sizes/special_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ** special ** import sys import copy diff --git a/examples/sizes/special_sizes.py b/examples/sizes/special_sizes.py index f4733d8f1..24b9cd03e 100644 --- a/examples/sizes/special_sizes.py +++ b/examples/sizes/special_sizes.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # special sizes to support exotic options import os import models.ReferenceModel as ref diff --git a/examples/sslp/model/ReferenceModel.py b/examples/sslp/model/ReferenceModel.py index ce144ae4c..06bfc6d21 100644 --- a/examples/sslp/model/ReferenceModel.py +++ b/examples/sslp/model/ReferenceModel.py @@ -1,4 +1,12 @@ # -*- coding: utf-8 -*- +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ Created on Fri Feb 8 11:49:24 2013 diff --git a/examples/sslp/sslp.py b/examples/sslp/sslp.py index 25150178c..2179d944c 100644 --- a/examples/sslp/sslp.py +++ b/examples/sslp/sslp.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # update April 2020: BUT this really needs upper and lower bound spokes # dlw February 2019: PySP 2 for the sslp example diff --git a/examples/sslp/sslp_cylinders.py b/examples/sslp/sslp_cylinders.py index 7b758e4e6..2e61f0a4a 100644 --- a/examples/sslp/sslp_cylinders.py +++ b/examples/sslp/sslp_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys import os import copy diff --git a/examples/sslp/sslp_ef.py b/examples/sslp/sslp_ef.py index 31c3cc308..e33e867bf 100644 --- a/examples/sslp/sslp_ef.py +++ b/examples/sslp/sslp_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Solve the EF of the sslp problems ''' from mpisppy.opt.ef import ExtensiveForm diff --git a/examples/stoch_distr/globalmodel.py b/examples/stoch_distr/globalmodel.py index a7d4f9e06..e12141525 100644 --- a/examples/stoch_distr/globalmodel.py +++ b/examples/stoch_distr/globalmodel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Stochastic distribution example without decomposition, this file is only written to execute the non-scalable example ### This code line can execute the script for a certain example diff --git a/examples/stoch_distr/stoch_distr.py b/examples/stoch_distr/stoch_distr.py index b99729a3f..6d93e057b 100644 --- a/examples/stoch_distr/stoch_distr.py +++ b/examples/stoch_distr/stoch_distr.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Network Flow - various formulations import pyomo.environ as pyo import mpisppy.utils.sputils as sputils diff --git a/examples/stoch_distr/stoch_distr_admm_cylinders.py b/examples/stoch_distr/stoch_distr_admm_cylinders.py index 0f005b1ec..cb825ff0b 100644 --- a/examples/stoch_distr/stoch_distr_admm_cylinders.py +++ b/examples/stoch_distr/stoch_distr_admm_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for stoch_distr with cylinders # Driver file for stochastic admm diff --git a/examples/stoch_distr/stoch_distr_ef.py b/examples/stoch_distr/stoch_distr_ef.py index df88ce7a8..23662ee26 100644 --- a/examples/stoch_distr/stoch_distr_ef.py +++ b/examples/stoch_distr/stoch_distr_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for stoch_distr with cylinders # This file can be executed thanks to python stoch_distr_ef.py --num-stoch-scens 2 --solver-name xpress --num-stoch-scens 2 --num-admm-subproblems 3 --scalable --mnpr 6 diff --git a/examples/tryone.py b/examples/tryone.py index f4edef836..a5e277ecc 100644 --- a/examples/tryone.py +++ b/examples/tryone.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # For specific tests during development # See also runall.py # Assumes you run from the examples directory. diff --git a/examples/uc/cs_uc.py b/examples/uc/cs_uc.py index a10792324..0541b32d0 100644 --- a/examples/uc/cs_uc.py +++ b/examples/uc/cs_uc.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import datetime import logging import sys diff --git a/examples/uc/gradient_uc_cylinders.py b/examples/uc/gradient_uc_cylinders.py index b05278e6a..52d1f8014 100644 --- a/examples/uc/gradient_uc_cylinders.py +++ b/examples/uc/gradient_uc_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # TBD: put in more options: threads, mipgaps for spokes diff --git a/examples/uc/rhoconfig10.py b/examples/uc/rhoconfig10.py index 708b32d35..caf683f65 100644 --- a/examples/uc/rhoconfig10.py +++ b/examples/uc/rhoconfig10.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from pyomo.environ import * # TBD - we can't get the rho scale factor into the callback easily, so we hard-code for now. diff --git a/examples/uc/simple_ef.py b/examples/uc/simple_ef.py index 0f20abd2b..88bd0f3aa 100644 --- a/examples/uc/simple_ef.py +++ b/examples/uc/simple_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys import uc_funcs as uc import pyomo.environ as pyo diff --git a/examples/uc/uc3wood.py b/examples/uc/uc3wood.py index db7f154b7..dd3f48a4b 100644 --- a/examples/uc/uc3wood.py +++ b/examples/uc/uc3wood.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # updated 23April2020 # dlw August 2019: 3driver caller for the uc example; unix path names diff --git a/examples/uc/uc4wood.py b/examples/uc/uc4wood.py index 19dc79fbc..b1e996807 100644 --- a/examples/uc/uc4wood.py +++ b/examples/uc/uc4wood.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ## includes fwph # updated 23April2020 # dlw August 2019: 3driver caller for the uc example; unix path names diff --git a/examples/uc/uc_ama.py b/examples/uc/uc_ama.py index fc72fe696..34da9c6d5 100644 --- a/examples/uc/uc_ama.py +++ b/examples/uc/uc_ama.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ An example of using amalgamator with 3 cylinders and one extension To execute this: diff --git a/examples/uc/uc_cylinders.py b/examples/uc/uc_cylinders.py index 92aff1609..eadf3986a 100644 --- a/examples/uc/uc_cylinders.py +++ b/examples/uc/uc_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # TBD: put in more options: threads, mipgaps for spokes diff --git a/examples/uc/uc_ef.py b/examples/uc/uc_ef.py index 65b2d7bc6..cc4dc3267 100644 --- a/examples/uc/uc_ef.py +++ b/examples/uc/uc_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys import uc_funcs as uc import pyomo.environ as pyo diff --git a/examples/uc/uc_funcs.py b/examples/uc/uc_funcs.py index 1fafd8474..e820353ad 100644 --- a/examples/uc/uc_funcs.py +++ b/examples/uc/uc_funcs.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # NOTE: this file has some "legacy" functions with wrappers # (but it even has some legacy wrappers....) diff --git a/examples/uc/uc_lshaped.py b/examples/uc/uc_lshaped.py index 433fafa59..af24dc7c2 100644 --- a/examples/uc/uc_lshaped.py +++ b/examples/uc/uc_lshaped.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for farmer with cylinders import uc_funcs as uc diff --git a/examples/usar/abstract.py b/examples/usar/abstract.py index 91492d36d..5b8779324 100644 --- a/examples/usar/abstract.py +++ b/examples/usar/abstract.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Provides an importable function for creating an `AbstractModel`.""" import pyomo.environ as pyo diff --git a/examples/usar/config.py b/examples/usar/config.py index be28db674..e65180b84 100644 --- a/examples/usar/config.py +++ b/examples/usar/config.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Functions for adding configuration to a `ConfigDict`. To add the USAR problem-specific configuration, call `add_common_args`. diff --git a/examples/usar/extensive_form.py b/examples/usar/extensive_form.py index a44cda802..7689fcea1 100644 --- a/examples/usar/extensive_form.py +++ b/examples/usar/extensive_form.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Provides top-level functions for USAR with `ExtensiveForm`. This script is intended to be run from the command line. Command-line diff --git a/examples/usar/generate_data.py b/examples/usar/generate_data.py index 8d16b2b0c..1db0721bd 100644 --- a/examples/usar/generate_data.py +++ b/examples/usar/generate_data.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Contains helper functions to randomly generate USAR problem data. Depot and household coordinates are generated uniformly at random. diff --git a/examples/usar/plot.py b/examples/usar/plot.py index c726ec189..cd2f21acd 100644 --- a/examples/usar/plot.py +++ b/examples/usar/plot.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Functions for obtaining and plotting team schedules. The problem of assigning departures to teams and obtaining team-specific diff --git a/examples/usar/scenario_creator.py b/examples/usar/scenario_creator.py index d95f2155a..82d52b48e 100644 --- a/examples/usar/scenario_creator.py +++ b/examples/usar/scenario_creator.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Provides a function which creates `ConcreteModel`\s for scenarios.""" from typing import Dict, Sequence diff --git a/examples/usar/scenario_denouement.py b/examples/usar/scenario_denouement.py index b0eb3a81b..663c8ed52 100644 --- a/examples/usar/scenario_denouement.py +++ b/examples/usar/scenario_denouement.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Provides a function which is called after optimization.""" import pyomo.environ as pyo diff --git a/examples/usar/wheel_spinner.py b/examples/usar/wheel_spinner.py index e161a998e..1fb994851 100644 --- a/examples/usar/wheel_spinner.py +++ b/examples/usar/wheel_spinner.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Provides top-level functions for USAR with `WheelSpinner`. This script is intended to be run from the command line. Command-line diff --git a/examples/usar/write_solutions.py b/examples/usar/write_solutions.py index 9f7985a30..e96fa25f2 100644 --- a/examples/usar/write_solutions.py +++ b/examples/usar/write_solutions.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """Provides functions to plot the solution of a scenario.""" import os diff --git a/file_header.txt b/file_header.txt new file mode 100644 index 000000000..4f15a8422 --- /dev/null +++ b/file_header.txt @@ -0,0 +1,6 @@ +mpi-sppy: MPI-based Stochastic Programming in PYthon + +Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +Sustainable Energy, LLC, The Regents of the University of California, et al. +All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +full copyright and license information. \ No newline at end of file diff --git a/mpi_one_sided_test.py b/mpi_one_sided_test.py index ed2638f1d..93c511469 100644 --- a/mpi_one_sided_test.py +++ b/mpi_one_sided_test.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Basic test script to make sure that the one-sided MPI calls work as intended. Runs on two processes. Will raise an assertion error if the Lock/Get/Unlock combination blocks. Otherwise, exits normally and produces diff --git a/mpisppy/MPI.py b/mpisppy/MPI.py index be580552d..71f75d27d 100644 --- a/mpisppy/MPI.py +++ b/mpisppy/MPI.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### try: from mpi4py.MPI import * diff --git a/mpisppy/__init__.py b/mpisppy/__init__.py index 99a0e122c..a58efecf8 100644 --- a/mpisppy/__init__.py +++ b/mpisppy/__init__.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from pyomo.common.timing import TicTocTimer as _TTT # Register numpy types in Pyomo, see https://github.com/Pyomo/pyomo/issues/3091 from pyomo.common.dependencies import numpy_available as _np_avail diff --git a/mpisppy/confidence_intervals/ciutils.py b/mpisppy/confidence_intervals/ciutils.py index 52dbac971..c08a85eca 100644 --- a/mpisppy/confidence_intervals/ciutils.py +++ b/mpisppy/confidence_intervals/ciutils.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Utility functions for mmw, sequantial sampling and sample trees import os diff --git a/mpisppy/confidence_intervals/confidence_config.py b/mpisppy/confidence_intervals/confidence_config.py index 5e4c8a4e9..aab82f6b1 100644 --- a/mpisppy/confidence_intervals/confidence_config.py +++ b/mpisppy/confidence_intervals/confidence_config.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # configuration data (and parsers) for confidence intervals def confidence_config(cfg): diff --git a/mpisppy/confidence_intervals/mmw_ci.py b/mpisppy/confidence_intervals/mmw_ci.py index 3708aa4f4..276d30178 100644 --- a/mpisppy/confidence_intervals/mmw_ci.py +++ b/mpisppy/confidence_intervals/mmw_ci.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Code to evaluate a given x-hat given as a nonant-cache, and the MMW confidence interval. diff --git a/mpisppy/confidence_intervals/mmw_conf.py b/mpisppy/confidence_intervals/mmw_conf.py index 2bd602c81..541e2d997 100644 --- a/mpisppy/confidence_intervals/mmw_conf.py +++ b/mpisppy/confidence_intervals/mmw_conf.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # To test: (from confidence_intervals directory; assumes the npy file is in the farmer directory) # python mmw_conf.py mpisppy/tests/examples/farmer.py --xhatpath ../../examples/farmer/farmer_root_nonants.npy --confidence-level 0.95 --EF-solver-name gurobi --MMW-num-batches 3 --MMW-batch-size 5 diff --git a/mpisppy/confidence_intervals/multi_seqsampling.py b/mpisppy/confidence_intervals/multi_seqsampling.py index fdbf19469..7f04b830d 100644 --- a/mpisppy/confidence_intervals/multi_seqsampling.py +++ b/mpisppy/confidence_intervals/multi_seqsampling.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Code that is producing an xhat and a confidence interval using sequantial sampling # This extension of SeqSampling works for multistage, using independent # scenarios instead of a single scenario tree. diff --git a/mpisppy/confidence_intervals/sample_tree.py b/mpisppy/confidence_intervals/sample_tree.py index 11ab6364f..4b23aa66a 100644 --- a/mpisppy/confidence_intervals/sample_tree.py +++ b/mpisppy/confidence_intervals/sample_tree.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### #Code for sampling for multistage problem import numpy as np diff --git a/mpisppy/confidence_intervals/seqsampling.py b/mpisppy/confidence_intervals/seqsampling.py index 515bb1536..ccb33aacf 100644 --- a/mpisppy/confidence_intervals/seqsampling.py +++ b/mpisppy/confidence_intervals/seqsampling.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Code that is producing a xhat and a confidence interval using sequential sampling # This is the implementation of the 2 following papers: # [bm2011] Bayraksan, G., Morton,D.P.: A Sequential Sampling Procedure for Stochastic Programming. Operations Research 59(4), 898-913 (2011) diff --git a/mpisppy/confidence_intervals/zhat4xhat.py b/mpisppy/confidence_intervals/zhat4xhat.py index 4f0c6cd82..1d9cb4a4a 100644 --- a/mpisppy/confidence_intervals/zhat4xhat.py +++ b/mpisppy/confidence_intervals/zhat4xhat.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # script to estimate zhat from a given xhat for a given model import sys diff --git a/mpisppy/convergers/converger.py b/mpisppy/convergers/converger.py index 12685515c..9b3cd671b 100644 --- a/mpisppy/convergers/converger.py +++ b/mpisppy/convergers/converger.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Base class for converger objects DTM Dec 2019 diff --git a/mpisppy/convergers/fracintsnotconv.py b/mpisppy/convergers/fracintsnotconv.py index 832fb32bf..e841fd893 100644 --- a/mpisppy/convergers/fracintsnotconv.py +++ b/mpisppy/convergers/fracintsnotconv.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ fraction of ints converger to illustrate a custom converger that does not directly use mpi reduce calls. DLW Jan 2019 diff --git a/mpisppy/convergers/norm_rho_converger.py b/mpisppy/convergers/norm_rho_converger.py index 939640f5d..d13c1092b 100644 --- a/mpisppy/convergers/norm_rho_converger.py +++ b/mpisppy/convergers/norm_rho_converger.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Adapted from the PySP extension adaptive_rho_converger, authored by Gabriel Hackebeil diff --git a/mpisppy/convergers/norms_and_residuals.py b/mpisppy/convergers/norms_and_residuals.py index 421341e2e..7bb191913 100644 --- a/mpisppy/convergers/norms_and_residuals.py +++ b/mpisppy/convergers/norms_and_residuals.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys import os diff --git a/mpisppy/convergers/primal_dual_converger.py b/mpisppy/convergers/primal_dual_converger.py index c87b9143e..69ef0cb7d 100644 --- a/mpisppy/convergers/primal_dual_converger.py +++ b/mpisppy/convergers/primal_dual_converger.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import numpy as np import os import pandas as pd diff --git a/mpisppy/cylinders/cross_scen_spoke.py b/mpisppy/cylinders/cross_scen_spoke.py index e2cecc73a..598914477 100644 --- a/mpisppy/cylinders/cross_scen_spoke.py +++ b/mpisppy/cylinders/cross_scen_spoke.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from pyomo.repn.standard_repn import generate_standard_repn from mpisppy import MPI from mpisppy.utils.lshaped_cuts import LShapedCutGenerator diff --git a/mpisppy/cylinders/fwph_spoke.py b/mpisppy/cylinders/fwph_spoke.py index 3bcd4b7e3..1530c514f 100644 --- a/mpisppy/cylinders/fwph_spoke.py +++ b/mpisppy/cylinders/fwph_spoke.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import mpisppy.cylinders.spoke class FrankWolfeOuterBound(mpisppy.cylinders.spoke.OuterBoundSpoke): diff --git a/mpisppy/cylinders/hub.py b/mpisppy/cylinders/hub.py index a6e5fa03e..08b6962ce 100644 --- a/mpisppy/cylinders/hub.py +++ b/mpisppy/cylinders/hub.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import numpy as np import abc import logging diff --git a/mpisppy/cylinders/lagranger_bounder.py b/mpisppy/cylinders/lagranger_bounder.py index 2f7fc7521..db7712346 100644 --- a/mpisppy/cylinders/lagranger_bounder.py +++ b/mpisppy/cylinders/lagranger_bounder.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Indepedent Lagrangian that takes x values as input and # updates its own W. diff --git a/mpisppy/cylinders/lagrangian_bounder.py b/mpisppy/cylinders/lagrangian_bounder.py index 57c8aa98c..91e819c51 100644 --- a/mpisppy/cylinders/lagrangian_bounder.py +++ b/mpisppy/cylinders/lagrangian_bounder.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import mpisppy.cylinders.spoke class _LagrangianMixin: diff --git a/mpisppy/cylinders/lshaped_bounder.py b/mpisppy/cylinders/lshaped_bounder.py index cd4fdc988..dee891eb5 100644 --- a/mpisppy/cylinders/lshaped_bounder.py +++ b/mpisppy/cylinders/lshaped_bounder.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import logging import time import random diff --git a/mpisppy/cylinders/ph_ob.py b/mpisppy/cylinders/ph_ob.py index 2c238c703..9616e713e 100644 --- a/mpisppy/cylinders/ph_ob.py +++ b/mpisppy/cylinders/ph_ob.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Runs PH with smaller rhos in order to compute a lower bound # By default rescale the hub "default-rho" values (multiply by rf) but there are other options to set rho: # - set rho manually (use _hack_set_rho) diff --git a/mpisppy/cylinders/reduced_costs_spoke.py b/mpisppy/cylinders/reduced_costs_spoke.py index 86737c62a..e0f4b80df 100644 --- a/mpisppy/cylinders/reduced_costs_spoke.py +++ b/mpisppy/cylinders/reduced_costs_spoke.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import math import pyomo.environ as pyo from pyomo.common.collections import ComponentSet diff --git a/mpisppy/cylinders/slam_heuristic.py b/mpisppy/cylinders/slam_heuristic.py index fa22aae3d..743b730c7 100644 --- a/mpisppy/cylinders/slam_heuristic.py +++ b/mpisppy/cylinders/slam_heuristic.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import abc import logging import time diff --git a/mpisppy/cylinders/spcommunicator.py b/mpisppy/cylinders/spcommunicator.py index af0d6865c..13c941c8c 100644 --- a/mpisppy/cylinders/spcommunicator.py +++ b/mpisppy/cylinders/spcommunicator.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ Conventional wisdom seems to be that we should use Put calls locally (i.e. a process should Put() into its own buffer), and Get calls for communication (i.e. call Get on a remote target, rather than your local diff --git a/mpisppy/cylinders/spoke.py b/mpisppy/cylinders/spoke.py index c4aa06028..7dd95035d 100644 --- a/mpisppy/cylinders/spoke.py +++ b/mpisppy/cylinders/spoke.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import numpy as np import abc import enum diff --git a/mpisppy/cylinders/subgradient_bounder.py b/mpisppy/cylinders/subgradient_bounder.py index b903bb25f..4212e59f9 100644 --- a/mpisppy/cylinders/subgradient_bounder.py +++ b/mpisppy/cylinders/subgradient_bounder.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import mpisppy.cylinders.spoke from mpisppy.cylinders.lagrangian_bounder import _LagrangianMixin diff --git a/mpisppy/cylinders/xhatlooper_bounder.py b/mpisppy/cylinders/xhatlooper_bounder.py index 4f88e6c99..8877da638 100644 --- a/mpisppy/cylinders/xhatlooper_bounder.py +++ b/mpisppy/cylinders/xhatlooper_bounder.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # updated April 2020 import mpisppy.cylinders.spoke as spoke from mpisppy.extensions.xhatlooper import XhatLooper diff --git a/mpisppy/cylinders/xhatshufflelooper_bounder.py b/mpisppy/cylinders/xhatshufflelooper_bounder.py index 30788cb33..a106c217a 100644 --- a/mpisppy/cylinders/xhatshufflelooper_bounder.py +++ b/mpisppy/cylinders/xhatshufflelooper_bounder.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import os import time import logging diff --git a/mpisppy/cylinders/xhatspecific_bounder.py b/mpisppy/cylinders/xhatspecific_bounder.py index cf67a766c..ceb26251e 100644 --- a/mpisppy/cylinders/xhatspecific_bounder.py +++ b/mpisppy/cylinders/xhatspecific_bounder.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # udpated April 20 # specific xhat supplied (copied from xhatlooper_bounder by DLW, Dec 2019) diff --git a/mpisppy/cylinders/xhatxbar_bounder.py b/mpisppy/cylinders/xhatxbar_bounder.py index 20fc9267f..558856a06 100644 --- a/mpisppy/cylinders/xhatxbar_bounder.py +++ b/mpisppy/cylinders/xhatxbar_bounder.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # udpated April 20 # xbar from xhat (copied from xhat specific, DLW Feb 2023) diff --git a/mpisppy/extensions/avgminmaxer.py b/mpisppy/extensions/avgminmaxer.py index b7b9b82d1..5df4e47c2 100644 --- a/mpisppy/extensions/avgminmaxer.py +++ b/mpisppy/extensions/avgminmaxer.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # An extension to compute and output avg, min, max for # a component (e.g., first stage cost). # DLW, Feb 2019 diff --git a/mpisppy/extensions/cross_scen_extension.py b/mpisppy/extensions/cross_scen_extension.py index 082322cb9..0b94e7acd 100644 --- a/mpisppy/extensions/cross_scen_extension.py +++ b/mpisppy/extensions/cross_scen_extension.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from mpisppy.extensions.extension import Extension from mpisppy.utils.sputils import find_active_objective from pyomo.repn.standard_repn import generate_standard_repn diff --git a/mpisppy/extensions/diagnoser.py b/mpisppy/extensions/diagnoser.py index d462cafca..cdf63e6ef 100644 --- a/mpisppy/extensions/diagnoser.py +++ b/mpisppy/extensions/diagnoser.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # An extension to output diagnostic information at each iteration # to a file for each scenario. # DLW, March 2019 diff --git a/mpisppy/extensions/extension.py b/mpisppy/extensions/extension.py index 853bd7dc3..9d6365ff7 100644 --- a/mpisppy/extensions/extension.py +++ b/mpisppy/extensions/extension.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' A template for creating PH_extension.py files NOTE: we pass in the ph object, so extensions can wreck everything if they want to! diff --git a/mpisppy/extensions/fixer.py b/mpisppy/extensions/fixer.py index e61209235..e7f90a99a 100644 --- a/mpisppy/extensions/fixer.py +++ b/mpisppy/extensions/fixer.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ Code for WW style fixing of integers. This can be used as the only extension, but it could be called from a "multi" extension. diff --git a/mpisppy/extensions/gradient_extension.py b/mpisppy/extensions/gradient_extension.py index c0470807e..c9dba8466 100644 --- a/mpisppy/extensions/gradient_extension.py +++ b/mpisppy/extensions/gradient_extension.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import os import time diff --git a/mpisppy/extensions/mipgapper.py b/mpisppy/extensions/mipgapper.py index e382afa38..c74e5ba52 100644 --- a/mpisppy/extensions/mipgapper.py +++ b/mpisppy/extensions/mipgapper.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ Code for a mipgap schedule. This can be used as the only extension, but it could also be called from a "multi" extension. diff --git a/mpisppy/extensions/mult_rho_updater.py b/mpisppy/extensions/mult_rho_updater.py index 8162c724f..60eb8db62 100644 --- a/mpisppy/extensions/mult_rho_updater.py +++ b/mpisppy/extensions/mult_rho_updater.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # DLW March 2023 A simple rho updater. Hold rho as a constant multple of the convergence metric # but only update when convergence improves diff --git a/mpisppy/extensions/norm_rho_updater.py b/mpisppy/extensions/norm_rho_updater.py index c22b90ccc..e76cdd14e 100644 --- a/mpisppy/extensions/norm_rho_updater.py +++ b/mpisppy/extensions/norm_rho_updater.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Adapted from the PySP extension adaptive_rho_converger, authored by Gabriel Hackebeil diff --git a/mpisppy/extensions/phtracker.py b/mpisppy/extensions/phtracker.py index 82fb72742..c95ab4624 100644 --- a/mpisppy/extensions/phtracker.py +++ b/mpisppy/extensions/phtracker.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' An extension to track the PH object (mpisppy.opt.ph.PH) during execution. Must use the PH object for this to work ''' diff --git a/mpisppy/extensions/reduced_costs_fixer.py b/mpisppy/extensions/reduced_costs_fixer.py index 2a3353590..7cb82305d 100644 --- a/mpisppy/extensions/reduced_costs_fixer.py +++ b/mpisppy/extensions/reduced_costs_fixer.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import numpy as np import pandas as pd diff --git a/mpisppy/extensions/test_extension.py b/mpisppy/extensions/test_extension.py index e65e8a7f0..8f6d4ea11 100644 --- a/mpisppy/extensions/test_extension.py +++ b/mpisppy/extensions/test_extension.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This is an extension to be used for testing. # Not all extension points are guaranteed to be here (see the parent class) diff --git a/mpisppy/extensions/wtracker_extension.py b/mpisppy/extensions/wtracker_extension.py index 6479f9754..709e37899 100644 --- a/mpisppy/extensions/wtracker_extension.py +++ b/mpisppy/extensions/wtracker_extension.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import pyomo.environ as pyo diff --git a/mpisppy/extensions/xhatbase.py b/mpisppy/extensions/xhatbase.py index 893f302e1..23d16272a 100644 --- a/mpisppy/extensions/xhatbase.py +++ b/mpisppy/extensions/xhatbase.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import re import pyomo.environ as pyo diff --git a/mpisppy/extensions/xhatclosest.py b/mpisppy/extensions/xhatclosest.py index bfac87390..67905a10b 100644 --- a/mpisppy/extensions/xhatclosest.py +++ b/mpisppy/extensions/xhatclosest.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # dlw, Feb 2018. Code for closes scenario to xbar # TODO Apr. 2020 Eliminate old references to companiondriver import numpy as np diff --git a/mpisppy/extensions/xhatlooper.py b/mpisppy/extensions/xhatlooper.py index 6037cf803..382a04d7c 100644 --- a/mpisppy/extensions/xhatlooper.py +++ b/mpisppy/extensions/xhatlooper.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # look for an xhat. # Written to be the only extension or called from an extension "manager." # DLW, Jan 2019 diff --git a/mpisppy/extensions/xhatspecific.py b/mpisppy/extensions/xhatspecific.py index e57df1cc7..914896039 100644 --- a/mpisppy/extensions/xhatspecific.py +++ b/mpisppy/extensions/xhatspecific.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Try a particular scenario as xhat. This is mainly for regression testing. # DLW, Feb 2019 # This extension uses options["xhat_scenario_dict"] (keys are node names) diff --git a/mpisppy/extensions/xhatxbar.py b/mpisppy/extensions/xhatxbar.py index 4ad13a8b1..5875d77f3 100644 --- a/mpisppy/extensions/xhatxbar.py +++ b/mpisppy/extensions/xhatxbar.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Try xbar as xhat. diff --git a/mpisppy/fwph/fwph.py b/mpisppy/fwph/fwph.py index 91e29be35..7855db8de 100644 --- a/mpisppy/fwph/fwph.py +++ b/mpisppy/fwph/fwph.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Implementation of the Frank-Wolfe Progressive Hedging (FW-PH) algorithm described in the paper: diff --git a/mpisppy/generic_cylinders.py b/mpisppy/generic_cylinders.py index 8c0c61670..1cfb59de6 100644 --- a/mpisppy/generic_cylinders.py +++ b/mpisppy/generic_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Generic_cylinder test driver. Adapted from run_all.py by dlw August 2024. import sys diff --git a/mpisppy/log.py b/mpisppy/log.py index 28ca6697e..1c1d5d3c9 100644 --- a/mpisppy/log.py +++ b/mpisppy/log.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ This is the logging configuration for mpisppy. diff --git a/mpisppy/opt/aph.py b/mpisppy/opt/aph.py index 38f419db2..44d66fdf9 100644 --- a/mpisppy/opt/aph.py +++ b/mpisppy/opt/aph.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # APH import numpy as np diff --git a/mpisppy/opt/ef.py b/mpisppy/opt/ef.py index 857db0f85..6c647d812 100644 --- a/mpisppy/opt/ef.py +++ b/mpisppy/opt/ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import mpisppy.spbase import pyomo.environ as pyo import logging diff --git a/mpisppy/opt/lshaped.py b/mpisppy/opt/lshaped.py index 1c597d2ee..dfcb141d7 100644 --- a/mpisppy/opt/lshaped.py +++ b/mpisppy/opt/lshaped.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import pyomo.environ as pyo import mpisppy.utils.sputils as sputils import numpy as np diff --git a/mpisppy/opt/ph.py b/mpisppy/opt/ph.py index 26b626c19..2d768f5ea 100644 --- a/mpisppy/opt/ph.py +++ b/mpisppy/opt/ph.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # PH-specific code import mpisppy.phbase diff --git a/mpisppy/opt/presolve.py b/mpisppy/opt/presolve.py index d097e0b18..87edece58 100644 --- a/mpisppy/opt/presolve.py +++ b/mpisppy/opt/presolve.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This module defines a presolver, which is used like an extension to an # SPBase object. However, it may be useful for this presolver extension diff --git a/mpisppy/opt/sc.py b/mpisppy/opt/sc.py index 89ce24de2..8e085f878 100644 --- a/mpisppy/opt/sc.py +++ b/mpisppy/opt/sc.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from mpisppy.spbase import SPBase import pyomo.environ as pyo import logging diff --git a/mpisppy/phbase.py b/mpisppy/phbase.py index 7595167b6..04108ed2f 100644 --- a/mpisppy/phbase.py +++ b/mpisppy/phbase.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import time import logging diff --git a/mpisppy/scenario_tree.py b/mpisppy/scenario_tree.py index 27ed400c5..56ad03939 100644 --- a/mpisppy/scenario_tree.py +++ b/mpisppy/scenario_tree.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # scenario_tree.py; PySP 2.0 scenario structure # ALL INDEXES ARE ZERO-BASED import logging diff --git a/mpisppy/spbase.py b/mpisppy/spbase.py index d7010c0ae..f2475e087 100644 --- a/mpisppy/spbase.py +++ b/mpisppy/spbase.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # base class for hub and for spoke strata import os diff --git a/mpisppy/spin_the_wheel.py b/mpisppy/spin_the_wheel.py index 9289a3a37..c6913538d 100644 --- a/mpisppy/spin_the_wheel.py +++ b/mpisppy/spin_the_wheel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from pyomo.environ import value from mpisppy import haveMPI, global_toc, MPI diff --git a/mpisppy/spopt.py b/mpisppy/spopt.py index 7c79087f0..ea1deb3fd 100644 --- a/mpisppy/spopt.py +++ b/mpisppy/spopt.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # base class for hub and for spoke strata import logging diff --git a/mpisppy/tests/examples/aircond.py b/mpisppy/tests/examples/aircond.py index a012662c5..99b841c6e 100644 --- a/mpisppy/tests/examples/aircond.py +++ b/mpisppy/tests/examples/aircond.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### #ReferenceModel for full set of scenarios for AirCond; June 2021 # Dec 2021; numerous enhancements by DLW; do not change defaults # Feb 2022: Changed all inventory cost coefficients to be positive numbers diff --git a/mpisppy/tests/examples/aircondB.py b/mpisppy/tests/examples/aircondB.py index 074288b3e..65cf217bf 100644 --- a/mpisppy/tests/examples/aircondB.py +++ b/mpisppy/tests/examples/aircondB.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### #ReferenceModel for full set of scenarios for AirCond; June 2021 # PICKLE BUNDLE VERSION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Dec 2021; numerous enhancements by DLW; do not change defaults diff --git a/mpisppy/tests/examples/apl1p.py b/mpisppy/tests/examples/apl1p.py index fc88798bb..7ae904cf9 100644 --- a/mpisppy/tests/examples/apl1p.py +++ b/mpisppy/tests/examples/apl1p.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### #ReferenceModel for full set of scenarios for APL1P; May 2021 #We use costs from Bailey, Jensen and Morton, Response Surface Analysis of Two-Stage Stochastic Linear Programming with Recourse #(costs are 10x higher than in the original [Infanger 1992] paper) diff --git a/mpisppy/tests/examples/distr.py b/mpisppy/tests/examples/distr.py index 699d50ba0..95fd7dfdb 100644 --- a/mpisppy/tests/examples/distr.py +++ b/mpisppy/tests/examples/distr.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This file is used in the tests and should not be modified! import pyomo.environ as pyo diff --git a/mpisppy/tests/examples/farmer.py b/mpisppy/tests/examples/farmer.py index 0ba7a74a1..1113115b0 100644 --- a/mpisppy/tests/examples/farmer.py +++ b/mpisppy/tests/examples/farmer.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # special for ph debugging DLW Dec 2018 # unlimited crops # ALL INDEXES ARE ZERO-BASED diff --git a/mpisppy/tests/examples/gbd/gbd.py b/mpisppy/tests/examples/gbd/gbd.py index 4950b103a..86c0c4f6f 100644 --- a/mpisppy/tests/examples/gbd/gbd.py +++ b/mpisppy/tests/examples/gbd/gbd.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### #ReferenceModel for full set of scenarios for GBD; Aug 2021 #From original Ferguson and Dantzig 1956 #Extended scenarios as done in Seq Sampling by B&M diff --git a/mpisppy/tests/examples/hydro/hydro.py b/mpisppy/tests/examples/hydro/hydro.py index fff31ae7d..2eb7a3c5e 100644 --- a/mpisppy/tests/examples/hydro/hydro.py +++ b/mpisppy/tests/examples/hydro/hydro.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # updated april 2020 # DLW: mpisppy version, May 2019 # diff --git a/mpisppy/tests/examples/sizes/ReferenceModel.py b/mpisppy/tests/examples/sizes/ReferenceModel.py index 872958490..cf4d1a3ac 100644 --- a/mpisppy/tests/examples/sizes/ReferenceModel.py +++ b/mpisppy/tests/examples/sizes/ReferenceModel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/tests/examples/sizes/sizes.py b/mpisppy/tests/examples/sizes/sizes.py index 3e2896df0..392fe2e07 100644 --- a/mpisppy/tests/examples/sizes/sizes.py +++ b/mpisppy/tests/examples/sizes/sizes.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import os import mpisppy.tests.examples.sizes.ReferenceModel as ref import mpisppy.utils.sputils as sputils diff --git a/mpisppy/tests/examples/stoch_distr/stoch_distr.py b/mpisppy/tests/examples/stoch_distr/stoch_distr.py index ff04034c1..6aaca0055 100644 --- a/mpisppy/tests/examples/stoch_distr/stoch_distr.py +++ b/mpisppy/tests/examples/stoch_distr/stoch_distr.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This file is used in the tests and should not be modified! # Network Flow - various formulations diff --git a/mpisppy/tests/examples/stoch_distr/stoch_distr_admm_cylinders.py b/mpisppy/tests/examples/stoch_distr/stoch_distr_admm_cylinders.py index 6977bc55d..17d99891f 100644 --- a/mpisppy/tests/examples/stoch_distr/stoch_distr_admm_cylinders.py +++ b/mpisppy/tests/examples/stoch_distr/stoch_distr_admm_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This file is used in the tests and should not be modified! # general example driver for stoch_distr with cylinders diff --git a/mpisppy/tests/examples/stoch_distr/stoch_distr_ef.py b/mpisppy/tests/examples/stoch_distr/stoch_distr_ef.py index bbc6542fd..4839b2786 100644 --- a/mpisppy/tests/examples/stoch_distr/stoch_distr_ef.py +++ b/mpisppy/tests/examples/stoch_distr/stoch_distr_ef.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This file is used in the tests and should not be modified! # general example driver for stoch_distr with cylinders diff --git a/mpisppy/tests/examples/uc/uc_funcs.py b/mpisppy/tests/examples/uc/uc_funcs.py index 80e670798..d34644728 100644 --- a/mpisppy/tests/examples/uc/uc_funcs.py +++ b/mpisppy/tests/examples/uc/uc_funcs.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Feb 2021: DTM: Why is the number of scenarios hardcoded and not a # scenario_creator_kwarg? # (maybe there is a super-computer reason) diff --git a/mpisppy/tests/examples/w_test_data/farmer_get.py b/mpisppy/tests/examples/w_test_data/farmer_get.py index 435fd4bcd..70e77b34a 100644 --- a/mpisppy/tests/examples/w_test_data/farmer_get.py +++ b/mpisppy/tests/examples/w_test_data/farmer_get.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for farmer with cylinders import farmer diff --git a/mpisppy/tests/examples/w_test_data/farmer_set.py b/mpisppy/tests/examples/w_test_data/farmer_set.py index e06357faa..e97d84b89 100644 --- a/mpisppy/tests/examples/w_test_data/farmer_set.py +++ b/mpisppy/tests/examples/w_test_data/farmer_set.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # general example driver for farmer with cylinders import farmer diff --git a/mpisppy/tests/helper_extension.py b/mpisppy/tests/helper_extension.py index 13cbc0751..f945c081b 100644 --- a/mpisppy/tests/helper_extension.py +++ b/mpisppy/tests/helper_extension.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This is an extension to be used for testing. from collections import defaultdict diff --git a/mpisppy/tests/straight_tests.py b/mpisppy/tests/straight_tests.py index 025d58067..d4d015fbf 100644 --- a/mpisppy/tests/straight_tests.py +++ b/mpisppy/tests/straight_tests.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # straight smoke tests (with no unittest, which is a bummer but we need mpiexec) import os diff --git a/mpisppy/tests/test_admmWrapper.py b/mpisppy/tests/test_admmWrapper.py index f0f26c8ed..42e5300c4 100644 --- a/mpisppy/tests/test_admmWrapper.py +++ b/mpisppy/tests/test_admmWrapper.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import unittest import mpisppy.utils.admmWrapper as admmWrapper import examples.distr as distr diff --git a/mpisppy/tests/test_aph.py b/mpisppy/tests/test_aph.py index 84d26fe30..4e3743308 100644 --- a/mpisppy/tests/test_aph.py +++ b/mpisppy/tests/test_aph.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Provide some test for aph under mpi-sppy. # Author: David L. Woodruff (started circa September 2019) # add farmer tests April 2021 diff --git a/mpisppy/tests/test_conf_int_aircond.py b/mpisppy/tests/test_conf_int_aircond.py index a078222de..497710b52 100644 --- a/mpisppy/tests/test_conf_int_aircond.py +++ b/mpisppy/tests/test_conf_int_aircond.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Provide some test for confidence intervals """ diff --git a/mpisppy/tests/test_conf_int_farmer.py b/mpisppy/tests/test_conf_int_farmer.py index 4751e6a78..118033326 100644 --- a/mpisppy/tests/test_conf_int_farmer.py +++ b/mpisppy/tests/test_conf_int_farmer.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Provide some test for confidence intervals """ diff --git a/mpisppy/tests/test_ef_ph.py b/mpisppy/tests/test_ef_ph.py index 1f0c2b7e5..bc945884e 100644 --- a/mpisppy/tests/test_ef_ph.py +++ b/mpisppy/tests/test_ef_ph.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Author: David L. Woodruff (circa January 2019) """ IMPORTANT: diff --git a/mpisppy/tests/test_gradient_rho.py b/mpisppy/tests/test_gradient_rho.py index f0b0496e9..7c019a974 100644 --- a/mpisppy/tests/test_gradient_rho.py +++ b/mpisppy/tests/test_gradient_rho.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Author: Ulysse Naepels and D.L. Woodruff """ IMPORTANT: diff --git a/mpisppy/tests/test_pickle_bundle.py b/mpisppy/tests/test_pickle_bundle.py index 4179b569d..3aab96251 100644 --- a/mpisppy/tests/test_pickle_bundle.py +++ b/mpisppy/tests/test_pickle_bundle.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Provide some test for pickled bundles """ diff --git a/mpisppy/tests/test_pysp_model.py b/mpisppy/tests/test_pysp_model.py index 0b9459571..fd5a388e2 100644 --- a/mpisppy/tests/test_pysp_model.py +++ b/mpisppy/tests/test_pysp_model.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import unittest import pyomo.environ as pyo import os.path diff --git a/mpisppy/tests/test_sc.py b/mpisppy/tests/test_sc.py index e2772b8ea..e9cd1610e 100644 --- a/mpisppy/tests/test_sc.py +++ b/mpisppy/tests/test_sc.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import unittest import sys import os diff --git a/mpisppy/tests/test_stoch_admmWrapper.py b/mpisppy/tests/test_stoch_admmWrapper.py index 28b13fbc4..38e49e932 100644 --- a/mpisppy/tests/test_stoch_admmWrapper.py +++ b/mpisppy/tests/test_stoch_admmWrapper.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import unittest import subprocess import examples.stoch_distr.stoch_distr_admm_cylinders as stoch_distr_admm_cylinders diff --git a/mpisppy/tests/test_w_writer.py b/mpisppy/tests/test_w_writer.py index 0269aa150..6946919e7 100644 --- a/mpisppy/tests/test_w_writer.py +++ b/mpisppy/tests/test_w_writer.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Author: """ IMPORTANT: diff --git a/mpisppy/tests/test_with_cylinders.py b/mpisppy/tests/test_with_cylinders.py index a06f5661e..8de3fb5b1 100644 --- a/mpisppy/tests/test_with_cylinders.py +++ b/mpisppy/tests/test_with_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Author: D.L. Woodruff 2023 """ mpiexec -np 2 python -m mpi4py test_with_cylinders.py diff --git a/mpisppy/tests/utils.py b/mpisppy/tests/utils.py index 02487aa59..4d570d4e2 100644 --- a/mpisppy/tests/utils.py +++ b/mpisppy/tests/utils.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import pyomo.environ as pyo diff --git a/mpisppy/utils/admmWrapper.py b/mpisppy/utils/admmWrapper.py index 6795a7fb6..a58442b4a 100644 --- a/mpisppy/utils/admmWrapper.py +++ b/mpisppy/utils/admmWrapper.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### #creating the class AdmmWrapper import mpisppy.utils.sputils as sputils import pyomo.environ as pyo diff --git a/mpisppy/utils/amalgamator.py b/mpisppy/utils/amalgamator.py index 27b28dc47..a25457d6a 100644 --- a/mpisppy/utils/amalgamator.py +++ b/mpisppy/utils/amalgamator.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Amalgamator.py starting point; DLW March 2021 # To test : python amalgamator.py 10 --solver-name=cplex --default-rho=1 diff --git a/mpisppy/utils/baseparsers.py b/mpisppy/utils/baseparsers.py index f5f82c1b0..dab7d78a5 100644 --- a/mpisppy/utils/baseparsers.py +++ b/mpisppy/utils/baseparsers.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # set up the most common parser args for mpi-sppy examples """ NOTE TO NEW USERS: just using these parsers will not, itself, do anything. You have to use the values when you create the dictionaries that are passed diff --git a/mpisppy/utils/callbacks/termination/__init__.py b/mpisppy/utils/callbacks/termination/__init__.py index 0ecd1a3f6..2b1724d56 100644 --- a/mpisppy/utils/callbacks/termination/__init__.py +++ b/mpisppy/utils/callbacks/termination/__init__.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from .termination_callbacks import ( supports_termination_callback, set_termination_callback, diff --git a/mpisppy/utils/callbacks/termination/solver_callbacks.py b/mpisppy/utils/callbacks/termination/solver_callbacks.py index 7831079ee..360186220 100644 --- a/mpisppy/utils/callbacks/termination/solver_callbacks.py +++ b/mpisppy/utils/callbacks/termination/solver_callbacks.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # NOTES: The design of the generic termination callback below is strictly MIP-centric. # Specifically, we assume the following 3 attributes can be extracted, and diff --git a/mpisppy/utils/callbacks/termination/termination_callbacks.py b/mpisppy/utils/callbacks/termination/termination_callbacks.py index fa582a343..5409ad195 100644 --- a/mpisppy/utils/callbacks/termination/termination_callbacks.py +++ b/mpisppy/utils/callbacks/termination/termination_callbacks.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from pyomo.solvers.plugins.solvers.cplex_persistent import CPLEXPersistent from pyomo.solvers.plugins.solvers.gurobi_persistent import GurobiPersistent from pyomo.solvers.plugins.solvers.xpress_persistent import XpressPersistent diff --git a/mpisppy/utils/callbacks/termination/tests/markshare2.py b/mpisppy/utils/callbacks/termination/tests/markshare2.py index f2518fb4c..0c891e8ee 100644 --- a/mpisppy/utils/callbacks/termination/tests/markshare2.py +++ b/mpisppy/utils/callbacks/termination/tests/markshare2.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' markshare2 instance from MIPLIB 2017: https://miplib.zib.de/instance_details_markshare2.html diff --git a/mpisppy/utils/callbacks/termination/tests/test_termination.py b/mpisppy/utils/callbacks/termination/tests/test_termination.py index 302831df5..f5162b679 100644 --- a/mpisppy/utils/callbacks/termination/tests/test_termination.py +++ b/mpisppy/utils/callbacks/termination/tests/test_termination.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import pytest from mpisppy.utils.callbacks.termination.termination_callbacks import ( diff --git a/mpisppy/utils/cfg_vanilla.py b/mpisppy/utils/cfg_vanilla.py index 9899c8569..24e25810e 100644 --- a/mpisppy/utils/cfg_vanilla.py +++ b/mpisppy/utils/cfg_vanilla.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### """ **** cfg version of vanilla that uses the Pyomo configuration system Plain versions of dictionaries that can be modified for each example as needed. ASSUME the corresponding args have been set up. diff --git a/mpisppy/utils/config.py b/mpisppy/utils/config.py index e41207797..397b1179a 100644 --- a/mpisppy/utils/config.py +++ b/mpisppy/utils/config.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Replace baseparsers.py and enhance functionality. # A class drived form pyomo.common.config is defined with # supporting member functions. diff --git a/mpisppy/utils/find_rho.py b/mpisppy/utils/find_rho.py index f8577717c..b0a679e84 100644 --- a/mpisppy/utils/find_rho.py +++ b/mpisppy/utils/find_rho.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Code to compute rhos from Ws. It also provides a corresponding rho setter. # To test: /examples/farmer/farmer_demo.py diff --git a/mpisppy/utils/gradient.py b/mpisppy/utils/gradient.py index a1508291d..01072a0a7 100644 --- a/mpisppy/utils/gradient.py +++ b/mpisppy/utils/gradient.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Code to compute gradient cost and rhos from the gradient. It also provides a corresponding rho setter. # To test: /examples/farmer/farmer_rho_demo.py diff --git a/mpisppy/utils/listener_util/demo_listener_util.py b/mpisppy/utils/listener_util/demo_listener_util.py index f01d0587b..3c4e5c391 100644 --- a/mpisppy/utils/listener_util/demo_listener_util.py +++ b/mpisppy/utils/listener_util/demo_listener_util.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Demonstrate some uses of listener_util.py for asynchronous computing. # This very silly and of limited value. # DLW March 2019 diff --git a/mpisppy/utils/listener_util/doc/conf.py b/mpisppy/utils/listener_util/doc/conf.py index dab662f36..59f0db4a2 100644 --- a/mpisppy/utils/listener_util/doc/conf.py +++ b/mpisppy/utils/listener_util/doc/conf.py @@ -1,5 +1,13 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # # pyomo documentation build configuration file, created by # sphinx-quickstart on Mon Dec 12 16:08:36 2016. diff --git a/mpisppy/utils/listener_util/listener_util.py b/mpisppy/utils/listener_util/listener_util.py index 93a61733c..0ab5fa050 100644 --- a/mpisppy/utils/listener_util/listener_util.py +++ b/mpisppy/utils/listener_util/listener_util.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Async Utility. Started by Bill Hart, # simple generalization by Dave Woodruff 2019. # See doc/philosophy.rst diff --git a/mpisppy/utils/lshaped_cuts.py b/mpisppy/utils/lshaped_cuts.py index e322ef144..910dc4048 100644 --- a/mpisppy/utils/lshaped_cuts.py +++ b/mpisppy/utils/lshaped_cuts.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from pyomo.core.base.block import _BlockData, declare_custom_block import pyomo.environ as pe from pyomo.solvers.plugins.solvers.persistent_solver import PersistentSolver diff --git a/mpisppy/utils/pickle_bundle.py b/mpisppy/utils/pickle_bundle.py index 6e7cb6d41..587b2869e 100644 --- a/mpisppy/utils/pickle_bundle.py +++ b/mpisppy/utils/pickle_bundle.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Utilities to support formation and use of "proper" bundles # NOTE: if/because we require the bundles to consume entire diff --git a/mpisppy/utils/prox_approx.py b/mpisppy/utils/prox_approx.py index 5427a8323..a089fced2 100644 --- a/mpisppy/utils/prox_approx.py +++ b/mpisppy/utils/prox_approx.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from math import isclose from pyomo.environ import value diff --git a/mpisppy/utils/pysp_model/__init__.py b/mpisppy/utils/pysp_model/__init__.py index 83a28073a..83e2b831a 100644 --- a/mpisppy/utils/pysp_model/__init__.py +++ b/mpisppy/utils/pysp_model/__init__.py @@ -1 +1,9 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### from .pysp_model import PySPModel diff --git a/mpisppy/utils/pysp_model/archivereader.py b/mpisppy/utils/pysp_model/archivereader.py index 25e48d81c..8d19880e3 100644 --- a/mpisppy/utils/pysp_model/archivereader.py +++ b/mpisppy/utils/pysp_model/archivereader.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # _________________________________________________________________________ # # PyUtilib: A Python utility library. diff --git a/mpisppy/utils/pysp_model/instance_factory.py b/mpisppy/utils/pysp_model/instance_factory.py index 963221f3b..2fe974b61 100644 --- a/mpisppy/utils/pysp_model/instance_factory.py +++ b/mpisppy/utils/pysp_model/instance_factory.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/phutils.py b/mpisppy/utils/pysp_model/phutils.py index 16d3f0763..4e1ad1c58 100644 --- a/mpisppy/utils/pysp_model/phutils.py +++ b/mpisppy/utils/pysp_model/phutils.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/pysp_model.py b/mpisppy/utils/pysp_model/pysp_model.py index 902dde1d7..d7ffd16f7 100644 --- a/mpisppy/utils/pysp_model/pysp_model.py +++ b/mpisppy/utils/pysp_model/pysp_model.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import logging import pyomo.environ as pyo diff --git a/mpisppy/utils/pysp_model/tests/test_archivereader.py b/mpisppy/utils/pysp_model/tests/test_archivereader.py index 3aa876ab8..c5e7ab7a6 100644 --- a/mpisppy/utils/pysp_model/tests/test_archivereader.py +++ b/mpisppy/utils/pysp_model/tests/test_archivereader.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # # Unit Tests for misc/archivereader # diff --git a/mpisppy/utils/pysp_model/tests/test_instancefactory.py b/mpisppy/utils/pysp_model/tests/test_instancefactory.py index da7f316fc..92680efc5 100644 --- a/mpisppy/utils/pysp_model/tests/test_instancefactory.py +++ b/mpisppy/utils/pysp_model/tests/test_instancefactory.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/tests/test_scenariotree.py b/mpisppy/utils/pysp_model/tests/test_scenariotree.py index ca2a020e5..79149da82 100644 --- a/mpisppy/utils/pysp_model/tests/test_scenariotree.py +++ b/mpisppy/utils/pysp_model/tests/test_scenariotree.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/tests/testdata/ReferenceModel.py b/mpisppy/utils/pysp_model/tests/testdata/ReferenceModel.py index dd34bdc1e..bbd5037e3 100644 --- a/mpisppy/utils/pysp_model/tests/testdata/ReferenceModel.py +++ b/mpisppy/utils/pysp_model/tests/testdata/ReferenceModel.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/tests/testdata/ScenarioStructure.py b/mpisppy/utils/pysp_model/tests/testdata/ScenarioStructure.py index 0102ef89b..6aaaf2e3f 100644 --- a/mpisppy/utils/pysp_model/tests/testdata/ScenarioStructure.py +++ b/mpisppy/utils/pysp_model/tests/testdata/ScenarioStructure.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import networkx G = networkx.DiGraph() diff --git a/mpisppy/utils/pysp_model/tests/testdata/both_callbacks.py b/mpisppy/utils/pysp_model/tests/testdata/both_callbacks.py index f7cd1861e..87bf3e29c 100644 --- a/mpisppy/utils/pysp_model/tests/testdata/both_callbacks.py +++ b/mpisppy/utils/pysp_model/tests/testdata/both_callbacks.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/tests/testdata/reference_test_model.py b/mpisppy/utils/pysp_model/tests/testdata/reference_test_model.py index dd34bdc1e..bbd5037e3 100644 --- a/mpisppy/utils/pysp_model/tests/testdata/reference_test_model.py +++ b/mpisppy/utils/pysp_model/tests/testdata/reference_test_model.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/tests/testdata/reference_test_model_with_callback.py b/mpisppy/utils/pysp_model/tests/testdata/reference_test_model_with_callback.py index 36ebb7023..c2d8820da 100644 --- a/mpisppy/utils/pysp_model/tests/testdata/reference_test_model_with_callback.py +++ b/mpisppy/utils/pysp_model/tests/testdata/reference_test_model_with_callback.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/tests/testdata/reference_test_scenario_tree_model.py b/mpisppy/utils/pysp_model/tests/testdata/reference_test_scenario_tree_model.py index a8ee1c84d..1df6694fe 100644 --- a/mpisppy/utils/pysp_model/tests/testdata/reference_test_scenario_tree_model.py +++ b/mpisppy/utils/pysp_model/tests/testdata/reference_test_scenario_tree_model.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/tree_structure.py b/mpisppy/utils/pysp_model/tree_structure.py index 01655ef5e..c1e94bca5 100644 --- a/mpisppy/utils/pysp_model/tree_structure.py +++ b/mpisppy/utils/pysp_model/tree_structure.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/pysp_model/tree_structure_model.py b/mpisppy/utils/pysp_model/tree_structure_model.py index f1c3af318..1a667d252 100644 --- a/mpisppy/utils/pysp_model/tree_structure_model.py +++ b/mpisppy/utils/pysp_model/tree_structure_model.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects diff --git a/mpisppy/utils/rho_utils.py b/mpisppy/utils/rho_utils.py index a62d7577a..f99f16e52 100644 --- a/mpisppy/utils/rho_utils.py +++ b/mpisppy/utils/rho_utils.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import pandas as pd diff --git a/mpisppy/utils/solver_spec.py b/mpisppy/utils/solver_spec.py index e03349e40..7823fdd56 100644 --- a/mpisppy/utils/solver_spec.py +++ b/mpisppy/utils/solver_spec.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Utility to allow for a heirarchy of solvers and options # and perhaps utilities to support special options like threads and mipgap diff --git a/mpisppy/utils/sputils.py b/mpisppy/utils/sputils.py index cbb83e3ec..8e9984e36 100644 --- a/mpisppy/utils/sputils.py +++ b/mpisppy/utils/sputils.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Base and utility functions for mpisppy # Note to developers: things called spcomm are way more than just a comm; SPCommunicator diff --git a/mpisppy/utils/stoch_admmWrapper.py b/mpisppy/utils/stoch_admmWrapper.py index 8c548af62..6a6caa8d7 100644 --- a/mpisppy/utils/stoch_admmWrapper.py +++ b/mpisppy/utils/stoch_admmWrapper.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### #creating the class stoch_admmWrapper import mpisppy.utils.sputils as sputils import pyomo.environ as pyo diff --git a/mpisppy/utils/wtracker.py b/mpisppy/utils/wtracker.py index bfac9a6f2..124a2ca3f 100644 --- a/mpisppy/utils/wtracker.py +++ b/mpisppy/utils/wtracker.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Started by DLW, March 2023 """ diff --git a/mpisppy/utils/wxbarreader.py b/mpisppy/utils/wxbarreader.py index 2e964a8d6..a3f4e5901 100644 --- a/mpisppy/utils/wxbarreader.py +++ b/mpisppy/utils/wxbarreader.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' An extension to initialize PH weights and/or PH xbar values from csv files. To use, specify either or both of the following keys to the options dict: diff --git a/mpisppy/utils/wxbartester.py b/mpisppy/utils/wxbartester.py index 4b029782a..5444fc026 100644 --- a/mpisppy/utils/wxbartester.py +++ b/mpisppy/utils/wxbartester.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Driver script to test the w/xbar read/write extensions using UC ''' diff --git a/mpisppy/utils/wxbarutils.py b/mpisppy/utils/wxbarutils.py index 04c8d64b3..0ded848f0 100644 --- a/mpisppy/utils/wxbarutils.py +++ b/mpisppy/utils/wxbarutils.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' Utilities for reading and writing W and x-bar values in and out of csv files. diff --git a/mpisppy/utils/wxbarwriter.py b/mpisppy/utils/wxbarwriter.py index 9b5ffa14d..566b29974 100644 --- a/mpisppy/utils/wxbarwriter.py +++ b/mpisppy/utils/wxbarwriter.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### ''' An extension to save PH weights and/or PH xbar values to csv files. To use, specify either or both of the following keys to the options dict: diff --git a/mpisppy/utils/xhat_eval.py b/mpisppy/utils/xhat_eval.py index d62d8a684..afb7e643a 100644 --- a/mpisppy/utils/xhat_eval.py +++ b/mpisppy/utils/xhat_eval.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # Code to evaluate a given x-hat, but given as a nonant-cache # To test: python xhat_eval.py --num-scens=3 --EF-solver-name=cplex diff --git a/paperruns/larger_uc/ReferenceModel_OK.py b/paperruns/larger_uc/ReferenceModel_OK.py index 4fe493c39..725ce5cbf 100644 --- a/paperruns/larger_uc/ReferenceModel_OK.py +++ b/paperruns/larger_uc/ReferenceModel_OK.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # modified April 2020 by DLW because Pyomo wants domains for Params: within=Any # OK from ME form latorre from Carrion and Arroyo v2 (so no multi-stage) # ######################################################################################################## diff --git a/paperruns/larger_uc/todat.py b/paperruns/larger_uc/todat.py index ed781d97b..9e98b17d3 100644 --- a/paperruns/larger_uc/todat.py +++ b/paperruns/larger_uc/todat.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import pandas as pd import numpy as np diff --git a/paperruns/larger_uc/uc_cylinders.py b/paperruns/larger_uc/uc_cylinders.py index 9ce55b8c3..d230adb58 100644 --- a/paperruns/larger_uc/uc_cylinders.py +++ b/paperruns/larger_uc/uc_cylinders.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### # This software is distributed under the 3-clause BSD License. # TBD: put in more options: threads, mipgaps for spokes diff --git a/paperruns/larger_uc/uc_funcs.py b/paperruns/larger_uc/uc_funcs.py index 1662b1b36..aa728f315 100644 --- a/paperruns/larger_uc/uc_funcs.py +++ b/paperruns/larger_uc/uc_funcs.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import os diff --git a/run-mpitests.py b/run-mpitests.py index 6f1bd6552..e30c0709d 100644 --- a/run-mpitests.py +++ b/run-mpitests.py @@ -1,3 +1,11 @@ +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import sys from runtests.mpi import Tester import os.path diff --git a/setup.py b/setup.py index b85e062b5..4e667b093 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,12 @@ #!/bin/usr/env python3 +############################################################################### +# mpi-sppy: MPI-based Stochastic Programming in PYthon +# +# Copyright (c) 2024, Lawrence Livermore National Security, LLC, Alliance for +# Sustainable Energy, LLC, The Regents of the University of California, et al. +# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md for +# full copyright and license information. +############################################################################### import glob import sys import os