-
Notifications
You must be signed in to change notification settings - Fork 8
Topology adaptivity #8
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
base: main
Are you sure you want to change the base?
Conversation
Damowerko
left a comment
There was a problem hiding this comment.
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.
src/opf/dataset.py
Outdated
| data["gen"].Sg = self.Sg[index] | ||
| if self.dual_graph: | ||
| data["branch"].Sf = self.Sf[index] | ||
| data["branch"].St = self.St[index] |
There was a problem hiding this comment.
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.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to branch_mask
| 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": |
There was a problem hiding this comment.
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?
|
|
||
| Sd = torch.zeros((n_samples, n_bus, 2)) | ||
| Sd[:, self.powerflow_parameters.load_bus_ids, :] = load | ||
| # branch_status = self.powerflow_parameters ...?? |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove double # #
| # no... this is in NOT solved... missing some logic here | ||
| continue | ||
| end | ||
| println("branch $br_removed_index found to be feasibile") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the debug logging.
| 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) |
There was a problem hiding this comment.
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.
| "solve_time" => Array{Float64}(undef, n_samples), | ||
| "objective" => Array{Float64}(undef, n_samples), | ||
| ) | ||
| br_removed_index = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
|
|
||
| check_assumptions!(network_data) | ||
|
|
||
| # data = generate_samples_numpy(network_data, n_samples, min_load, max_load, remove_random_branch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the debug logic
No description provided.