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

PR to merge Raiyan's work #321

Open
wants to merge 15 commits into
base: 320_generalized_acdc_pf
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/rst_source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,8 @@ Linear optimization
Run a linear optimization and verify with power flow
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Often ties, you want to dispatch the generation using a linear
optimization, to then *veryfy* the results using the power exact power
Often times, you want to dispatch the generation using a linear
optimization, to then *verify* the results using the power exact power
flow. With GridCal, to do so is as easy as passing the results of the
OPF into the PowerFlowDriver:

Expand Down
2 changes: 1 addition & 1 deletion requirements_nose.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ipython>=7.16
ipython-genutils==0.2.0
jdcal==1.4.1
jedi==0.18.0
Jinja2==3.1.3
Jinja2==3.1.4
joblib==1.2.0
jupyter-client==6.1.11
jupyter-core==4.11.2
Expand Down
62 changes: 32 additions & 30 deletions src/GridCal/Gui/Main/SubClasses/Settings/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,48 @@ def config_data_to_struct(data_: Dict[str, Union[Dict[str, Any], str, Any]],
:param struct_: result of self.get_config_structure()
"""
for key, object_to_set in struct_.items():
try:
# get the value in data_ that corresponds to the object to be set
corresponding_data = data_.get(key, None)

# get the value in data_ that corresponds to the object to be set
corresponding_data = data_.get(key, None)
if corresponding_data is not None:

if corresponding_data is not None:
# print("config debug:", key, corresponding_data)

# print("config debug:", key, corresponding_data)
if isinstance(object_to_set, dict):
config_data_to_struct(corresponding_data, object_to_set)

if isinstance(object_to_set, dict):
config_data_to_struct(corresponding_data, object_to_set)
elif isinstance(object_to_set, QtWidgets.QComboBox):
index = object_to_set.findText(corresponding_data)
if -1 < index < object_to_set.count():
object_to_set.setCurrentIndex(index)

elif isinstance(object_to_set, QtWidgets.QComboBox):
index = object_to_set.findText(corresponding_data)
if -1 < index < object_to_set.count():
object_to_set.setCurrentIndex(index)
elif isinstance(object_to_set, QtWidgets.QDoubleSpinBox):
object_to_set.setValue(float(corresponding_data))

elif isinstance(object_to_set, QtWidgets.QDoubleSpinBox):
object_to_set.setValue(float(corresponding_data))
elif isinstance(object_to_set, QtWidgets.QSpinBox):
object_to_set.setValue(int(corresponding_data))

elif isinstance(object_to_set, QtWidgets.QSpinBox):
object_to_set.setValue(int(corresponding_data))
elif isinstance(object_to_set, QtWidgets.QCheckBox):
object_to_set.setChecked(bool(corresponding_data))

elif isinstance(object_to_set, QtWidgets.QCheckBox):
object_to_set.setChecked(bool(corresponding_data))
elif isinstance(object_to_set, QtWidgets.QRadioButton):
object_to_set.setChecked(bool(corresponding_data))

elif isinstance(object_to_set, QtWidgets.QRadioButton):
object_to_set.setChecked(bool(corresponding_data))

elif isinstance(object_to_set, str):
pass
elif isinstance(object_to_set, float):
pass
elif isinstance(object_to_set, int):
pass
elif isinstance(object_to_set, bool):
pass
elif isinstance(object_to_set, str):
pass
elif isinstance(object_to_set, float):
pass
elif isinstance(object_to_set, int):
pass
elif isinstance(object_to_set, bool):
pass
else:
raise Exception('unknown structure')
else:
raise Exception('unknown structure')
else:
print(f"{key} has no entry in config")
print(f"{key} has no entry in config")
except Exception as e:
continue


class ConfigurationMain(ResultsMain):
Expand Down
1 change: 1 addition & 0 deletions src/GridCal/Gui/Main/SubClasses/simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ def modify_ui_options_according_to_the_engine(self) -> None:
self.solvers_dict[SolverType.GAUSS.value] = SolverType.GAUSS
self.solvers_dict[SolverType.LACPF.value] = SolverType.LACPF
self.solvers_dict[SolverType.DC.value] = SolverType.DC
self.solvers_dict[SolverType.GENERALISED.value] = SolverType.GENERALISED

self.ui.solver_comboBox.setModel(gf.get_list_model(list(self.solvers_dict.keys())))
self.ui.solver_comboBox.setCurrentIndex(0)
Expand Down
Loading