Skip to content

Commit

Permalink
adding new file header
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed Sep 13, 2024
1 parent 5a6811e commit bb6b808
Show file tree
Hide file tree
Showing 234 changed files with 1,873 additions and 0 deletions.
11 changes: 11 additions & 0 deletions addheader.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Usage:
# addheader -c addheader.yml
---
root: .
text: file_header.txt
patterns:
- "*.py"
- "__init__.py"
verbose: 1
sep_len: 80
...
8 changes: 8 additions & 0 deletions doc/src/conf.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 8 additions & 0 deletions examples/acopf3/ACtree.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 8 additions & 0 deletions examples/acopf3/ccopf2wood.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 8 additions & 0 deletions examples/acopf3/ccopf_multistage.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/acopf3/fourstage.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 8 additions & 0 deletions examples/acopf3/rho_setter.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
8 changes: 8 additions & 0 deletions examples/afew.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 8 additions & 0 deletions examples/aircond/aircond_ama.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
8 changes: 8 additions & 0 deletions examples/aircond/aircond_cylinders.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 8 additions & 0 deletions examples/aircond/aircond_ef.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/aircond/aircond_seqsampling.py
Original file line number Diff line number Diff line change
@@ -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.
#

Expand Down
8 changes: 8 additions & 0 deletions examples/aircond/bundle_pickler.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/battery/battery.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
8 changes: 8 additions & 0 deletions examples/battery/batteryext.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
8 changes: 8 additions & 0 deletions examples/battery/batterymain.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/distr/distr.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/distr/distr_admm_cylinders.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/distr/distr_data.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/distr/distr_ef.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/distr/globalmodel.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/PySP/abstract/ReferenceModel.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/PySP/concrete/ReferenceModel.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/cs_farmer.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/farmer.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/farmer_ama.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/farmer_cylinders.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/farmer_ef.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/farmer_lshapedhub.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/farmer_ph.py
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/farmer_rho_demo.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 8 additions & 0 deletions examples/farmer/farmer_seqsampling.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit bb6b808

Please sign in to comment.