Skip to content

Commit

Permalink
RDT Upgrade (#2)
Browse files Browse the repository at this point in the history
* update

* minimum core set that is compatible with PowerModelsDistribution 0.18

* support for x_e variables

* hardening variables added

* implementation of ue_variables

* added support for creating switches from inline data

* Input of scenario damage information

* data structures for scenarios

* added switch state variables

* Added xe_s variables

* added z_e variables

* he variables

* added ue_s variables

* constraint 1b added

* simplyfying the model

* objective function implementation

* modification to constraints to reflect simplified model

* constraint 4a

* total load served constraint

* flow variables for branch_ne

* variables for expansion switches and transformers

* nodal flow balance constraint

* small updates

* Partial implementation of constraint 2d

* constraint 2d for expansion branches

* constraint 2d

* made a smaller testing case

* amp constraint for ne branches

* Shifted to a more standard power flow model

* constraints for phase angle difference

* Implementation of constraint 2a

* constrant 2e

* Implementation of constraint 4a

* Implementation of switch constraints

* completed expansion inline constraints

* Implementation of constraints for inline switches

* Code backup

* Radial constraint working

* FIX: broken CI

Was running Julia 1.0 tests, but min version is Julia 1.6

* REF: Cleanup

- Remove PowerModels dependency
- Update logger dependencies (remove Memento)
- Import PMD functions
- export PMD, JuMP, commonly used functions
- updated file formatting

* UPD: github actions workflows

* UPD: Documenter.jl script

* FIX: documenter

* FIX: documenter

* UPD: JuMP NL syntax

* RM: travis ci

* ADD: unit tests

* TEST: add feasibility pump (mip_solver)

* Relax tests due to numerical instabilities

* v0.1 release prep

* debug ci

---------

Co-authored-by: jtabarez <53569964+jtabarez@users.noreply.github.com>
Co-authored-by: Russell Bent <rbent@lanl.gov>
  • Loading branch information
3 people authored Oct 15, 2024
1 parent 1a1602a commit 7319dc6
Show file tree
Hide file tree
Showing 57 changed files with 57,555 additions and 85 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1.6'
- '1'
- 'nightly'
os:
Expand All @@ -21,12 +21,12 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v2
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
Expand All @@ -39,8 +39,8 @@ jobs:
- uses: julia-actions/julia-buildpkg@latest
continue-on-error: ${{ matrix.version == 'nightly' }}
- uses: julia-actions/julia-runtest@latest
continue-on-error: ${{ matrix.version == 'nightly' }}
continue-on-error: ${{ matrix.version == 'nightly' || (matrix.version == '1.6' && matrix.os == 'macOS-latest') }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
44 changes: 44 additions & 0 deletions .github/workflows/deploydocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["gh-pages"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'gh-pages'
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Documentation
on:
push:
branches: [master]
branches: [main]
tags: '*'
pull_request:
types: [opened, synchronize, reopened]
Expand All @@ -11,7 +11,7 @@ jobs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
with:
version: '1'
Expand Down
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
PowerModelsDistributionRDT.jl Change Log
===================================
# PowerModelsDistributionRDT.jl Change Log

## staged

### staged
- none

## v0.1.0 - 2024-10-15

- Initial Release
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Redistributions in binary form must reproduce the above copyright notice, this l
Neither the name of Triad National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY TRIAD NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TRIAD NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

32 changes: 21 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
name = "PowerModelsDistributionRDT"
uuid = "66cb097a-b461-11e9-2c74-17ced528deb4"
authors = ["David M Fobes <dfobes@lanl.gov>", "Jose Tabarez", "Russell Bent"]
authors = ["Russell Bent", "David M Fobes <dfobes@lanl.gov>", "Jose Tabarez"]
version = "0.1.0"

[deps]
InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
Memento = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9"
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"
PowerModelsDistribution = "d7431456-977f-11e9-2de3-97ff7677985e"
PowerModelsONM = "25264005-a304-4053-a338-565045d392ac"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[compat]
InfrastructureModels = "~0.5"
Ipopt = ">=0.4"
JuMP = "~0.21"
MathOptInterface = "~0.8, ~0.9"
Memento = "~0.10, ~0.11, ~0.12, ~0.13, ~1.0, ~1.1"
PowerModels = "~0.17"
PowerModelsDistribution = "^0.10"
InfrastructureModels = "0.7"
Ipopt = "1.0.2"
JSON = "0.21"
JuMP = "1.23.2"
PowerModelsDistribution = "0.16"
PowerModelsONM = "4.0"
SCS = "1.1"
julia = "1.6"

[extras]
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84"
Memento = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9"
SCIP = "82193955-e24f-5292-bf16-6f2c5261a85f"
SCS = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Ipopt"]
test = ["Test", "Ipopt", "Memento", "SCS", "Juniper", "HiGHS", "SCIP"]
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "1"
22 changes: 16 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
using Documenter
using PowerModelsDistributionRDT


# build documents
makedocs(
sitename = "PowerModelsDistributionRDT",
format = Documenter.HTML(),
modules = [PowerModelsDistributionRDT]
format=Documenter.HTML(
analytics="",
mathengine=Documenter.MathJax(),
prettyurls=false,
collapselevel=2,
),
warnonly=true,
sitename="PowerModelsDistributionRDT",
authors="Russell Bent, Jose Tabarez, David M Fobes, and contributors",
)

# Documenter can also automatically deploy documentation to gh-pages.
# See "Hosting Documentation" and deploydocs() in the Documenter manual
# for more information.
#=deploydocs(
repo = "<repository url>"
)=#
deploydocs(
repo="github.com/lanl-ansi/PowerModelsDistributionRDT.jl.git",
push_preview=false,
devbranch="main",
)
46 changes: 38 additions & 8 deletions src/PowerModelsDistributionRDT.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,50 @@
module PowerModelsDistributionRDT

import JuMP
import Memento

import InfrastructureModels
import PowerModels
import PowerModelsDistribution
# InfrastructureModels ecosystem
import InfrastructureModels as _IM
import InfrastructureModels: ismultinetwork, ismultiinfrastructure

import PowerModelsDistribution as _PMD
import PowerModelsDistribution: ref, var, con, sol, ids, nw_ids, nw_id_default, nws, pmd_it_sym
import PowerModelsDistribution: AbstractUnbalancedPowerModel, ACRUPowerModel, ACPUPowerModel, IVRUPowerModel, LPUBFDiagPowerModel, LinDist3FlowPowerModel, NFAUPowerModel

import PowerModelsONM as _PMONM

import SHA

const _PMs = PowerModels
const _PMD = PowerModelsDistribution
import Logging
import LoggingExtras

function __init__()
global _LOGGER = Memento.getlogger(PowerModels)
global _LOGGER = Logging.ConsoleLogger(; meta_formatter=_PMD._pmd_metafmt)
global _DEFAULT_LOGGER = Logging.current_logger()

Logging.global_logger(_LOGGER)

_PMD.set_logging_level!(:Info)
_PMONM.set_log_level!(:Info)
end

include("core/ref.jl")
include("core/variable.jl")
include("core/constraint_template.jl")
include("core/constraint.jl")
include("core/data.jl")
include("core/objective.jl")
include("core/eng2math.jl")

include("io/common.jl")
include("io/json_parse.jl")

include("prob/rdt.jl")

include("form/dcp.jl")
include("form/shared.jl")
include("form/acr.jl")
include("form/acp.jl")
include("form/apo.jl")
include("form/lindistflow.jl")

include("core/export.jl") # must be last include to properly export functions
end # module
Loading

2 comments on commit 7319dc6

@pseudocubic
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/117347

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 7319dc623e57a02ed5f1a90da652df5a28f74425
git push origin v0.1.0

Please sign in to comment.