Skip to content

Topology adaptivity#8

Open
Damowerko wants to merge 5 commits into
mainfrom
topology-adaptivity
Open

Topology adaptivity#8
Damowerko wants to merge 5 commits into
mainfrom
topology-adaptivity

Conversation

@Damowerko

Copy link
Copy Markdown
Owner

No description provided.

@Damowerko Damowerko left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Overall good implementation of OPFDataset. One branch is not handled. Commented out code and debug logic should be removed. Some other comments.

Comment thread src/opf/dataset.py Outdated
@@ -183,8 +195,12 @@ def __getitem__(self, index) -> PowerflowData:
data["branch"].Sf = self.Sf[index]
data["branch"].St = self.St[index]

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This case isn't handled.

Comment thread src/opf/dataset.py Outdated
data["bus", "branch", "bus"].Sf = self.Sf[index]
data["bus", "branch", "bus"].St = self.St[index]
# remove any branches with br_status=0
br_mask = self.br_status[index].bool()

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Rename to branch_mask

Comment thread src/opf/dataset.py
def case_path(self):
return Path(self.data_dir / f"{self.case_name}.json")
# TODO: eventually move this to front end
if self.case_name == "case118_ieee":

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Is this logic necessary? Can't I simply provide case_name case118_ieee_removed_branch?

Comment thread src/opf/dataset.py

Sd = torch.zeros((n_samples, n_bus, 2))
Sd[:, self.powerflow_parameters.load_bus_ids, :] = load
# branch_status = self.powerflow_parameters ...??

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

don't commit commented out code

Comment thread src/opf/dataset.py Outdated
)
# I am indexing from the end, so that I can change the size of the training dataset
# without changing wich samples are used for testing and validation
# # I am indexing from the end, so that I can change the size of the training dataset

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Remove double # #

Comment thread scripts/generate.jl
# no... this is in NOT solved... missing some logic here
continue
end
println("branch $br_removed_index found to be feasibile")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Remove the debug logging.

Comment thread scripts/generate.jl
network_data["branch"][branch_to_remove]["br_status"] = 0
branch_to_remove = rand(keys(_network_data["branch"]))
_network_data["branch"][branch_to_remove]["br_status"] = 0
# br_removed_index = parse(Int, branch_to_remove)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Remove the comented out code.

Comment thread scripts/generate.jl
"solve_time" => Array{Float64}(undef, n_samples),
"objective" => Array{Float64}(undef, n_samples),
)
br_removed_index = ""

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Remove

Comment thread scripts/generate.jl
result, solved = label_network(network_data, load)
result, solved = label_network(_network_data, load)
if !solved
# no... this is in NOT solved... missing some logic here

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Remove

Comment thread scripts/generate.jl

check_assumptions!(network_data)

# data = generate_samples_numpy(network_data, n_samples, min_load, max_load, remove_random_branch)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Remove the debug logic

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.

2 participants