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

Update to Julia1.6.7 and Gurobi 9.5 #72

Merged
merged 8 commits into from
Oct 6, 2022
Merged

Conversation

RuaridhMacd
Copy link
Collaborator

Gurobi 9.5 has some significant improvements over previous versions, so it would be good to ensure it works with Dolphyn.

To do so, we need to update to the latest version of Gurobi.jl (v0.11.3), which in turn requires Julia v1.6 or later.

I have updated the default environment packages to use the updated version of Gurobi.jl and tested everything using Julia v1.6.7, the current long-term support version of Julia.

It would be nice to move to Julia v1.8+ in the future, but certain elements of the output-writing functions are hard-coded to require Julia v1.7 or less. We could update this code or resync the GenX components with the main GenX repo, where they have already resolved this issue.

@RuaridhMacd RuaridhMacd added the enhancement New feature or request label Oct 4, 2022
@Betristor
Copy link
Collaborator

@RuaridhMacd I'm always using julia 1.7.2 to debug code and run examples, everything works fine to me except for writing output where version check is implemented. But I extended them to version 1.8 and there is no bug reporting.

Betristor
Betristor previously approved these changes Oct 5, 2022
@RuaridhMacd
Copy link
Collaborator Author

RuaridhMacd commented Oct 5, 2022

Julia 1.7.x should also work. I went with Julia.1.6.7 because it's the LTS version, so hopefully will be available to new users for a long time.

It sounds like we have the same issues in 1.8. There are if-else statements which are hardcoded based on the Julia version which create a DataFrame column (or take some other necessary action) inside the loop, instead of outside and then editing it. Versions 1.8+ aren't accounted for in the if-else, e.g. in write_subsidy_revenue.jl:

if v"1.3" <= VERSION < v"1.4"
	dfSubRevenue[!,:SubsidyRevenue] .= 0.0
elseif v"1.4" <= VERSION < v"1.8"
	dfSubRevenue.SubsidyRevenue = zeros(size(dfSubRevenue, 1))
	#dfSubRevenue[:,:SubsidyRevenue] = zeros(size(dfSubRevenue, 1))
end

Some actions will also be skipped for >v1.8 for the same reason, so I'm not sure any results can be guaranteed to be accurate.

The main GenX repo has removed these hard-coded steps, so we can fix it in the next week or two.

@Betristor
Copy link
Collaborator

Julia 1.7.x should also work. I went with Julia.1.6.7 because it's the LTS version, so hopefully will be available to new users for a long time.

It sounds like we have the same issues in 1.8. There are if-else statements which are hardcoded based on the Julia version which create a DataFrame column (or take some other necessary action) inside the loop, instead of outside and then editing it. Versions 1.8+ aren't accounted for in the if-else, e.g. in write_subsidy_revenue.jl:

if v"1.3" <= VERSION < v"1.4"
	dfSubRevenue[!,:SubsidyRevenue] .= 0.0
elseif v"1.4" <= VERSION < v"1.8"
	dfSubRevenue.SubsidyRevenue = zeros(size(dfSubRevenue, 1))
	#dfSubRevenue[:,:SubsidyRevenue] = zeros(size(dfSubRevenue, 1))
end

Some actions will also be skipped for >v1.8 for the same reason, so I'm not sure any results can be guaranteed to be accurate.

The main GenX repo has removed these hard-coded steps, so we can fix it in the next week or two.

I turned it into <= when I tried julia 1.8. Lately I'm using julia 1.7.2 as my main dev version. But it works for v1.8 and no error occurred.

This avoids conflicts between versions of Julia, particularly between <v1.7 and >=v1.7
@RuaridhMacd
Copy link
Collaborator Author

I turned it into <= when I tried julia 1.8. Lately I'm using julia 1.7.2 as my main dev version. But it works for v1.8 and no error occurred.

That sounds good. I've made some further changes to merge this with the Logging PR.

I've added the DOLPHYNJulEnv folder to the .gitignore, as different formats can be used between Julia versions. This was causing my v1.6.7 runs to fail using the environment made using v1.7+

@RuaridhMacd RuaridhMacd requested a review from Betristor October 6, 2022 15:05
@Betristor
Copy link
Collaborator

Gitignore could be generated using gitignore command line tool in https://www.toptal.com/developers/gitignore. This tool contain many templates for gitignore. I remembered that I made these changes (extend version check into v1.8) in PR #46 but it's not merged so it's fine to implement it here.

@RuaridhMacd RuaridhMacd merged commit ac081b8 into main Oct 6, 2022
@RuaridhMacd RuaridhMacd deleted the update_to_julia1_6_7 branch October 6, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants