Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia1.0 #4

Merged
merged 33 commits into from
Apr 16, 2019
Merged

Julia1.0 #4

merged 33 commits into from
Apr 16, 2019

Conversation

andrewrosemberg
Copy link
Owner

Code to julia 1.0.

@codecov
Copy link

codecov bot commented Apr 4, 2019

Codecov Report

Merging #4 into master will decrease coverage by 6.12%.
The diff coverage is 46.31%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
- Coverage   49.53%   43.41%   -6.13%     
==========================================
  Files           6        7       +1     
  Lines         216      205      -11     
==========================================
- Hits          107       89      -18     
- Misses        109      116       +7
Impacted Files Coverage Δ
src/utilities.jl 63.15% <100%> (-3.51%) ⬇️
src/constraint.jl 100% <100%> (+28.57%) ⬆️
src/HydroPowerModels.jl 100% <100%> (ø) ⬆️
src/variable.jl 100% <100%> (+42.85%) ⬆️
src/simulate.jl 100% <100%> (+4.76%) ⬆️
src/train.jl 100% <100%> (ø)
src/IO.jl 18.65% <16.39%> (-11.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d067199...e874f74. Read the comment docs.

using Base.Test
@test isapprox(results["simulations"][1]["objective"], 12400.00, atol=1e-2)
using Test
@test isapprox(results[:simulations][1][1][:objective], 10496.09, atol=1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm. To get the old behaviour you need something like

sum(s[:stage_objective] for s in results[:simulations][1])

We could make this nicer.

objective_bound = 0.0
optimizer = with_optimizer(params["optimizer"]),
lower_bound = 0.0,
direct_mode=false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm. I should probably document this better.

src/IO.jl Outdated Show resolved Hide resolved
using Base.Test
@test isapprox(results["simulations"][1]["objective"], 12400.00, atol=1e-2)
using Test
@test isapprox(sum(s[:stage_objective] for s in results[:simulations][1]), 9400.0, atol=1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did the value (12400) change? Is it because you run more iterations? (I can't guarantee that SDDP.jl is bug-free, so changes like this are worth investigating.)

Copy link
Owner Author

Choose a reason for hiding this comment

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

It doesn't seem to be because I run more iterations. I augmented it because with 60 iterations, in the new framework, the sddp was not returning a stable solution.

My best guess is that the scenarios are not being sampled in the same way. I tried to seed it, but no luck. Do you believe this could be the reason?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, it's probably because I turn cut selection on by default now. You can set the cut_deletion_minimum argument in train to a large number like 1_000_000 if you want to turn it off.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Just added the cut_deletion_minimum argument. However, I was not doing this on the old release. Couldn't this be because the random generator has actually changed and my seed doesn't work the same way?

I was advise to start testing the lower-bound instead of the simulation cost.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

Will do this from now on!

using Base.Test
@test isapprox(results["simulations"][1]["objective"], 59800.0, atol=1e-2)
using Test
@test isapprox(results[:simulations][1][1][:objective], 58528.47, atol=1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto on the value.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Changed to sum(s[:stage_objective] for s in results[:simulations][1]), but still different.

docs/src/getstarted.md Outdated Show resolved Hide resolved
src/IO.jl Outdated Show resolved Hide resolved
src/IO.jl Outdated Show resolved Hide resolved
src/constraint.jl Outdated Show resolved Hide resolved
src/IO.jl Outdated Show resolved Hide resolved
src/IO.jl Show resolved Hide resolved
src/IO.jl Outdated Show resolved Hide resolved
src/IO.jl Show resolved Hide resolved
src/IO.jl Show resolved Hide resolved
@andrewrosemberg
Copy link
Owner Author

Use import or using?
Reexport.@reexport using PowerModels, SDDP

@odow
Copy link
Collaborator

odow commented Apr 12, 2019

Probably using. It's more user friendly. Within a package, I'm trying to mainly use import. The reexport is a thorn though.

src/IO.jl Outdated Show resolved Hide resolved
src/IO.jl Show resolved Hide resolved
@Thuener Thuener mentioned this pull request Apr 16, 2019
@Thuener Thuener merged commit 464251d into master Apr 16, 2019
@andrewrosemberg andrewrosemberg deleted the julia070dev branch October 9, 2019 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants