Skip to content

Commit

Permalink
Merge pull request #47 from MartaVanin/master
Browse files Browse the repository at this point in the history
changes for v0.5, mostly deps
  • Loading branch information
MartaVanin authored Dec 1, 2021
2 parents 9539121 + ced6f92 commit aadc48d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Staged

## v0.5.0
- add support JuMP 0.22, PMD 0.12,0.13, IM 0.7
- nicer ternary operators
- change cite to IEEE TPWRS early access

## v0.4.1-2
- clean-up of bad data code
- adds bad data documentation
Expand Down
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PowerModelsDistributionStateEstimation"
uuid = "d0713e65-ce0c-4a8e-a1da-2ed737d217c5"
authors = ["Marta Vanin", "Tom Van Acker"]
version = "0.4.2"
version = "0.5.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -27,12 +27,12 @@ DataFrames = "~0.21.0"
Distributions = "0.22.3 - 0.24.14"
ForwardDiff = "~0.10.18"
GaussianMixtures = "0.3.2"
InfrastructureModels = "0.6.0"
InfrastructureModels = "~0.6, ~0.7"
JSON = "~0.18, ~0.19, ~0.20, ~0.21"
JuMP = "~0.21.4"
JuMP = "~0.21, ~0.22"
LoggingExtras = "~0.4"
Optim = "~1.2.0"
PowerModelsDistribution = "0.11.1"
PowerModelsDistribution = "~0.11, ~0.12, ~0.13"
SpecialFunctions = "~0.10.3"
julia = "^1"

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ the following contributors:
If you find PowerModelsDistributionStateEstimation.jl useful for your work, we kindly invite you to cite our [paper](https://arxiv.org/abs/2011.11614):

```bibtex
@article{VaninPMDSE,
title = {A framework for constrained static state estimation in unbalanced distribution networks},
volume = {},
number = {},
journal = {[Online], arXiv:2011.11614 [eess.SY] },
author = {Vanin, Marta and Van Acker, Tom and D'hulst, Reinhilde and Van Hertem, Dirk},
month = {Nov.},
year = {2020},
}
@ARTICLE{9552554,
author={Vanin, Marta and Van Acker, Tom and D'hulst, Reinhilde and Van Hertem, Dirk},
journal={IEEE Transactions on Power Systems},
title={A Framework for Constrained Static State Estimation in Unbalanced Distribution Networks},
year={2021},
volume={},
number={},
pages={1-1},
doi={10.1109/TPWRS.2021.3116291}}
```

Expand Down
6 changes: 3 additions & 3 deletions src/core/constraint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ function constraint_mc_residual(pm::_PMD.AbstractUnbalancedPowerModel, i::Int; n
res[idx] * rsc * σ >= - (var[c] - μ)
)
elseif crit == "mle"
( isa(dst[idx], ExtendedBeta{Float64}) || isa(dst[idx], _GMM.GMM) ) ? pkg_id = _PMDSE : pkg_id = _DST
( !isa(dst[idx], _GMM.GMM) && !isinf(pkg_id.minimum(dst[idx])) ) ? lb = pkg_id.minimum(dst[idx]) : lb = -10
( !isa(dst[idx], _GMM.GMM) && !isinf(pkg_id.maximum(dst[idx])) ) ? ub = pkg_id.maximum(dst[idx]) : ub = 10
pkg_id = ( isa(dst[idx], ExtendedBeta{Float64}) || isa(dst[idx], _GMM.GMM) ) ? _PMDSE : _DST
lb = ( !isa(dst[idx], _GMM.GMM) && !isinf(pkg_id.minimum(dst[idx])) ) ? pkg_id.minimum(dst[idx]) : -10
ub = ( !isa(dst[idx], _GMM.GMM) && !isinf(pkg_id.maximum(dst[idx])) ) ? pkg_id.maximum(dst[idx]) : 10
if isa(dst[idx], _GMM.GMM) lb = _PMD.ref(pm, nw, :meas, i, "min") end
if isa(dst[idx], _GMM.GMM) ub = _PMD.ref(pm, nw, :meas, i, "max") end

Expand Down
2 changes: 1 addition & 1 deletion src/core/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The function takes as input either a single measurement dictionary, e.g., `data[
and their product is used as the upper bound. Otherwise,
"""
function assign_residual_ub!(data::Dict; chosen_upper_bound::Float64=100.0, rescale::Bool=false)
rescale ? upp_bound = chosen_upper_bound*data["se_settings"]["rescaler"] : upp_bound = chosen_upper_bound
upp_bound = rescale ? chosen_upper_bound*data["se_settings"]["rescaler"] : chosen_upper_bound
if haskey(data, "meas")
for (_, meas) in data["meas"]
meas["res_max"] = upp_bound
Expand Down
2 changes: 1 addition & 1 deletion src/core/variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function variable_mc_residual( pm::_PMD.AbstractUnbalancedPowerModel;
if bounded
for i in _PMD.ids(pm, nw, :meas), c in 1:connections[i]
JuMP.set_lower_bound(res[i][c], 0.0)
haskey(_PMD.ref(pm, nw, :meas, i), "res_max") ? res_max = meas["res_max"] : res_max = Inf
res_max = haskey(_PMD.ref(pm, nw, :meas, i), "res_max") ? meas["res_max"] : Inf
JuMP.set_upper_bound(res[i][c], res_max)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/io/measurement_parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function read_measurement!(data::Dict, meas_row::_DFS.DataFrameRow, sample_fake_
if sample_fake_meas
sorted_args = sample_fake_measurements(meas_row[:dst], sorted_args, seed)
end
meas_row[:dst] == "ExtendedBeta" ? pkg_id = _PMDSE : pkg_id = _DST
pkg_id = meas_row[:dst] == "ExtendedBeta" ? _PMDSE : _DST
data["dst"] = [getfield(pkg_id, Symbol(meas_row[:dst]))(tuple(sa...)...) for sa in sorted_args]
end
"""
Expand Down

2 comments on commit aadc48d

@MartaVanin
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/49704

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.5.0 -m "<description of version>" aadc48d3e3ac413dfeac2e873b03bb02959d6de3
git push origin v0.5.0

Please sign in to comment.