Skip to content

Commit

Permalink
add license header everywhere; found another private method
Browse files Browse the repository at this point in the history
  • Loading branch information
jalving committed Jul 17, 2024
1 parent 63e64f8 commit dfc56ad
Show file tree
Hide file tree
Showing 26 changed files with 133 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 9 additions & 0 deletions src/Plasmo.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/aggregate.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/backends/moi_backend.jl
Original file line number Diff line number Diff line change
@@ -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.
"""
Expand Down
5 changes: 5 additions & 0 deletions src/core_types.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/graph_functions/kahypar.jl
Original file line number Diff line number Diff line change
@@ -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...)
Expand Down
5 changes: 5 additions & 0 deletions src/graph_functions/partition.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/graph_functions/projections.jl
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
5 changes: 5 additions & 0 deletions src/graph_functions/topology.jl
Original file line number Diff line number Diff line change
@@ -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}

"""
Expand Down
5 changes: 5 additions & 0 deletions src/jump_interop.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 7 additions & 2 deletions src/macros.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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...)))
Expand Down
5 changes: 5 additions & 0 deletions src/node_variables.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/optiedge.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/optielement.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/optigraph.jl
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 5 additions & 0 deletions src/optimizer_interface.jl
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down
5 changes: 5 additions & 0 deletions src/optinode.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/test_aggregate.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/test_examples.jl
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
5 changes: 5 additions & 0 deletions test/test_moi_backend.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/test_optigraph.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/test_partition.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/test_projections.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/test_topology_functions.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit dfc56ad

Please sign in to comment.