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

connectivity refactor #828

Merged
merged 12 commits into from
Nov 29, 2023
Merged

connectivity refactor #828

merged 12 commits into from
Nov 29, 2023

Conversation

SouthEndMusic
Copy link
Collaborator

Fixes #814.

@SouthEndMusic SouthEndMusic marked this pull request as draft November 24, 2023 15:41
@SouthEndMusic
Copy link
Collaborator Author

@visr regarding #825: I had 2 tests sometimes failing which I think I now fixed:

  • One from expand logic mapping. I saw that the behavior there depended on the order of a loop over a dictionary, I fixed that.
  • One from allocation. I tested the exact flow values and allocated values coming out of the LP solve. The allocated values are always the same, the flows not. I suspect that that is because the exact value of some flows does not matter for the minimization of the objective function. Still interesting that the solver behaves non-deterministically. I decided to stop testing the exact flow values.

@SouthEndMusic SouthEndMusic marked this pull request as ready for review November 29, 2023 08:49
Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

I had a few comments.
Apart from them, it looks good to me.

core/src/io.jl Outdated Show resolved Hide resolved
core/src/io.jl Outdated
Comment on lines 194 to 199
for i in 1:length(flow_vertical_dict_inverse)
id = flow_vertical_dict_inverse[i]
push!(from_node_id, id.value)
push!(to_node_id, id.value)
push!(unique_edge_ids_flow, missing)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for i in 1:length(flow_vertical_dict_inverse)
id = flow_vertical_dict_inverse[i]
push!(from_node_id, id.value)
push!(to_node_id, id.value)
push!(unique_edge_ids_flow, missing)
end
for id in flow_vertical_dict_inverse
push!(from_node_id, id.value)
push!(to_node_id, id.value)
push!(unique_edge_ids_flow, missing)
end

core/src/io.jl Outdated
Comment on lines 201 to 206
for i in 1:length(flow_dict_inverse)
from_id, to_id = flow_dict_inverse[i]
push!(from_node_id, from_id.value)
push!(to_node_id, to_id.value)
push!(unique_edge_ids_flow, graph[from_id, to_id].id)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for i in 1:length(flow_dict_inverse)
from_id, to_id = flow_dict_inverse[i]
push!(from_node_id, from_id.value)
push!(to_node_id, to_id.value)
push!(unique_edge_ids_flow, graph[from_id, to_id].id)
end
for (from_id, to_id) in flow_dict_inverse
push!(from_node_id, from_id.value)
push!(to_node_id, to_id.value)
push!(unique_edge_ids_flow, graph[from_id, to_id].id)
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Regarding this and previous one: I deliberately do not do this, to ensure the order is correct

Copy link
Contributor

Choose a reason for hiding this comment

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

So you verified that iterating through it and indexing one-by-one doesn't behave the same?

core/src/utils.jl Show resolved Hide resolved
@SouthEndMusic SouthEndMusic merged commit a1b848f into main Nov 29, 2023
12 of 13 checks passed
@SouthEndMusic SouthEndMusic deleted the connectivity_refactor branch November 29, 2023 12:17
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.

Connectivity refactor
2 participants