Open AnkurArohi opened 1 year ago
Hello, you can do it like that
net.update_generators(id=net.get_generators().index, voltage_regulator_on=[True]*len(net.get_generators().index))
Hello, you can do it like that
net.update_generators(id=net.get_generators().index, voltage_regulator_on=[True]*len(net.get_generators().index))
Thanks for your reply, Yes but I find this not user friendly, thats why i mentioned that this is not a bug, but this is according to me not an elegant way of doing it
Do you want to request a feature or report a bug?
What is the current behavior? Trying to set a boolean value for all rows in generator df is difficult/leads to error
powsybl_net is powsybl network
a = powsybl_net.get_generators() a.voltage_regulator_on = True powsybl_net.update_generators(a)
Error
Traceback (most recent call last):
, line 2103, in _update_elements _pp.update_network_elements_with_series(self._handle, c_df, element_type) pypowsybl._pypowsybl.PyPowsyblError: Series 'name' is not modifiable.
Although
a.name==powsybl_net.get_generators().name
Is True for all rows
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
What is the expected behavior? It should be easy to update column values for each row in df
something like this
powsybl_net.get_generators().loc[:,"voltage_regulator_on"] = True
User friendliness
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, spectrum, etc)
(if a question doesn't apply, you can delete it)