From dfc56ad366d75056b360bfe901bdf72a44305aa9 Mon Sep 17 00:00:00 2001 From: jalving Date: Wed, 17 Jul 2024 12:50:50 -0700 Subject: [PATCH] add license header everywhere; found another private method --- LICENSE.md | 2 +- docs/make.jl | 5 +++++ src/Plasmo.jl | 9 +++++++++ src/aggregate.jl | 5 +++++ src/backends/moi_backend.jl | 5 +++++ src/core_types.jl | 5 +++++ src/graph_functions/kahypar.jl | 5 +++++ src/graph_functions/partition.jl | 5 +++++ src/graph_functions/projections.jl | 5 +++++ src/graph_functions/topology.jl | 5 +++++ src/jump_interop.jl | 5 +++++ src/macros.jl | 9 +++++++-- src/node_variables.jl | 5 +++++ src/optiedge.jl | 5 +++++ src/optielement.jl | 7 ++++++- src/optigraph.jl | 5 +++++ src/optimizer_interface.jl | 5 +++++ src/optinode.jl | 5 +++++ test/runtests.jl | 5 +++++ test/test_aggregate.jl | 5 +++++ test/test_examples.jl | 5 +++++ test/test_moi_backend.jl | 5 +++++ test/test_optigraph.jl | 5 +++++ test/test_partition.jl | 5 +++++ test/test_projections.jl | 5 +++++ test/test_topology_functions.jl | 5 +++++ 26 files changed, 133 insertions(+), 4 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 373fde6c..dc437178 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The Plasmo.jl package is licensed under the Mozilla Public License, Version 2.0: -> Copyright (c) 2024: +> Copyright (c) 2021: > * Jordan Jalving, Yankai Cao, Victor Zavala, and contributors > > Mozilla Public License, version 2.0 diff --git a/docs/make.jl b/docs/make.jl index d9b0d47c..27189634 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + using Documenter, Plasmo, Suppressor, Graphs # using PlasmoPlots diff --git a/src/Plasmo.jl b/src/Plasmo.jl index 52c2eb5a..47896211 100644 --- a/src/Plasmo.jl +++ b/src/Plasmo.jl @@ -1,3 +1,12 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. +############################################################################# +# Plasmo +# A graph-based modeling language for optimization +# See https://github.com/plasmo-dev/Plasmo.jl +############################################################################# module Plasmo using Requires diff --git a/src/aggregate.jl b/src/aggregate.jl index aa1cb2c7..b786be0f 100644 --- a/src/aggregate.jl +++ b/src/aggregate.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + """ GraphReferenceMap diff --git a/src/backends/moi_backend.jl b/src/backends/moi_backend.jl index 028c69e7..12014fd4 100644 --- a/src/backends/moi_backend.jl +++ b/src/backends/moi_backend.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + """ Mapping of node variables and constraints to the optigraph backend. """ diff --git a/src/core_types.jl b/src/core_types.jl index f115be0b..19bd4cf0 100644 --- a/src/core_types.jl +++ b/src/core_types.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + abstract type AbstractOptiGraph <: JuMP.AbstractModel end abstract type AbstractOptiNode <: JuMP.AbstractModel end diff --git a/src/graph_functions/kahypar.jl b/src/graph_functions/kahypar.jl index bb001ead..917e8b72 100644 --- a/src/graph_functions/kahypar.jl +++ b/src/graph_functions/kahypar.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + """ KaHyPar.partition(graph::OptiGraph, n_parts::Int64; kwargs...) diff --git a/src/graph_functions/partition.jl b/src/graph_functions/partition.jl index e27a5861..ffc4aad6 100644 --- a/src/graph_functions/partition.jl +++ b/src/graph_functions/partition.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + """ Partition diff --git a/src/graph_functions/projections.jl b/src/graph_functions/projections.jl index 40855761..42c9b651 100644 --- a/src/graph_functions/projections.jl +++ b/src/graph_functions/projections.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + abstract type AbstractProjectionType end const GraphElement = Union{Int64,Graphs.AbstractEdge} diff --git a/src/graph_functions/topology.jl b/src/graph_functions/topology.jl index d9612bbf..ec2d22a9 100644 --- a/src/graph_functions/topology.jl +++ b/src/graph_functions/topology.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + const HyperGraphProjection = GraphProjection{GOI.HyperGraph,HyperGraphProjectionType} """ diff --git a/src/jump_interop.jl b/src/jump_interop.jl index 35b4cbe3..3f196076 100644 --- a/src/jump_interop.jl +++ b/src/jump_interop.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + # this file contains the necessary JuMP methods to work with JuMP expressions. ### directly copied functions from JuMP diff --git a/src/macros.jl b/src/macros.jl index e7d8b3e5..0a11c3a5 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -1,4 +1,9 @@ -#macro function helpers +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +# macro helpers _get_name(c::Symbol) = c _get_name(c::Nothing) = () _get_name(c::AbstractString) = c @@ -58,7 +63,7 @@ Add a group of linking constraints described by the expression `expr` parametri The @linkconstraint macro works the same way as the `JuMP.@constraint` macro. """ macro linkconstraint(graph, args...) - args, kw_args, requestedcontainer = Containers._extract_kw_args(args) + args, kw_args, = Containers.parse_macro_arguments(error, args) macro_code = quote @assert isa($graph, OptiGraph) refs = JuMP.@constraint($graph, ($(args...))) diff --git a/src/node_variables.jl b/src/node_variables.jl index c8f5f3de..4ff88a7e 100644 --- a/src/node_variables.jl +++ b/src/node_variables.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + # TODO: parameterize on precision struct NodeVariableRef <: JuMP.AbstractVariableRef diff --git a/src/optiedge.jl b/src/optiedge.jl index edd63712..47e51e0d 100644 --- a/src/optiedge.jl +++ b/src/optiedge.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + function Base.string(edge::OptiEdge) return "$(edge.label)" end diff --git a/src/optielement.jl b/src/optielement.jl index 0e820dc9..2a0ec344 100644 --- a/src/optielement.jl +++ b/src/optielement.jl @@ -1,4 +1,9 @@ -# JuMP & MOI methods that dispatch on both optinodes and optiedges +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +# This file contains JuMP & MOI methods that dispatch on both optinodes and optiedges # # MOI Methods diff --git a/src/optigraph.jl b/src/optigraph.jl index 0a5f31a7..87f36bda 100644 --- a/src/optigraph.jl +++ b/src/optigraph.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + function OptiGraph(; name::Symbol=Symbol(:g, gensym())) graph = OptiGraph( name, diff --git a/src/optimizer_interface.jl b/src/optimizer_interface.jl index f1bb0bd4..89328973 100644 --- a/src/optimizer_interface.jl +++ b/src/optimizer_interface.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + # # get/set attributes # diff --git a/src/optinode.jl b/src/optinode.jl index 40090c19..a3009f1f 100644 --- a/src/optinode.jl +++ b/src/optinode.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + function Base.string(node::OptiNode) return string(JuMP.name(node)) end diff --git a/test/runtests.jl b/test/runtests.jl index b8a3355d..000ae903 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + using Test @testset "Plasmo Tests" begin diff --git a/test/test_aggregate.jl b/test/test_aggregate.jl index 2a3f6108..81b87dc6 100644 --- a/test/test_aggregate.jl +++ b/test/test_aggregate.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + module TestAggregatation using Plasmo diff --git a/test/test_examples.jl b/test/test_examples.jl index 311810a6..e3c9a994 100644 --- a/test/test_examples.jl +++ b/test/test_examples.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + using Suppressor const EXAMPLES = filter( diff --git a/test/test_moi_backend.jl b/test/test_moi_backend.jl index a2b5f86d..fabbeded 100644 --- a/test/test_moi_backend.jl +++ b/test/test_moi_backend.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + # TODO: specific tests for MOI backend. module TestMOIGraph diff --git a/test/test_optigraph.jl b/test/test_optigraph.jl index 9f504902..30c3b8a3 100644 --- a/test/test_optigraph.jl +++ b/test/test_optigraph.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + module TestOptiGraph using Plasmo diff --git a/test/test_partition.jl b/test/test_partition.jl index 95e6e4b0..38828f6d 100644 --- a/test/test_partition.jl +++ b/test/test_partition.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + module TestPartition using Plasmo diff --git a/test/test_projections.jl b/test/test_projections.jl index 064b5dea..146944df 100644 --- a/test/test_projections.jl +++ b/test/test_projections.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + module TestGraphRepresentations using Plasmo diff --git a/test/test_topology_functions.jl b/test/test_topology_functions.jl index 6328d163..fb64d635 100644 --- a/test/test_topology_functions.jl +++ b/test/test_topology_functions.jl @@ -1,3 +1,8 @@ +# Copyright 2021, Jordan Jalving, Yankai Cao, Victor Zavala, and contributors +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + module TestGraphFunctions using Plasmo