Repository navigation
Closed as duplicate
Labels
featureNew feature or requestNew feature or requestwontfixThis will not be worked onThis will not be worked on
Description
Describe the feature request
Currently, the experimental feature is an option to the calculations:
- C API:
- to enable experimental features, the
PGM_set_experimental_features()function needs to be called on aPGM_Optionsobject.
- to enable experimental features, the
- Python API:
- it currently requires using the protected
_calculate_*functions instead of the publiccalculate_*ones. - to prevent linter errors, it is possible to use an inheritance pattern, e.g.
py class PowerGridModelWithExperimentalFeatures(PowerGridModel): def calculate_power_flow_with_experimental_features(self, *args, **kwargs): return super()._calculate_power_flow(*args, **kwargs)
- it currently requires using the protected
This approach enables experimental features in the calculation itself, but it has no effect on other features that do not immediately run within in calculations, like data creation. That would require a global experimental feature setting.
Such a global experimental feature flag could be added to the handle (C API)
- A good example of a feature that could have benefited from a global experimental feature flag was columnar dataset creation.
Design
- C API:
- to the
PGM_Handle, add anexperimental_featuresmember variable - for
PGM_set_experimental_features:
* [ ] move tobasics.h(this is a backwards compatible change)
* [ ] ifhandleis notnullptr[new feature]
* [ ] sethandle->experimental_featuresto the value ofexperimental_features[new feature]
* [ ] ifoptionsis notnullptr[new feature]
* [ ] setoptions->experimental_featuresto the value ofexperimental_features[existing feature] - after this change,
* [ ] the calculations may depend onoptions->experimental_features || handle->experimental_featuresor one of the two (decide on a case-by-case basis)
* [ ] other things may depend onhandle->experimental_features
- to the
- Python API (TBD):
- add a global function
set_experimental_features
* [ ] this in turn callsPGM_set_experimental_features(handle, nullptr, _ExperimentalFeatures.enabled) - setting the
experimental_featuresflag on the_calculate_*functions:- setting it to
enabledcallsPGM_set_experimental_features(handle, options, enabled) - setting it to
disabledimpliesset_experimental_features(handle, options, disabled) - setting it to
None(default) only sets the defaultOptionstodisabled:set_experimental_features(None, options, disabled)
- setting it to
- add a global function
NOTE: the Python API behavior is still TBD
TBD
- The C++ wrapper for the C API uses a handle for every created object. We need to make a decision on how to approach this.
- The Python API uses one handle and multiple
Options. Calling thePGM_set_experimental_featuresfor everyOptionsobject would repeatedly enable/disable/enable/disable the settings on the handle. This is not desirable, as it may result in unexpected behavior.
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or requestwontfixThis will not be worked onThis will not be worked on
Type
Projects
- StatusShow more project fieldsNo status
Activity
mgovers commentedon Oct 9, 2024
This issue is mainly there for future reference. The TBD's are quite difficult to resolve. Closing this issue as
wont fixfor nowmgovers commentedon Jun 11, 2026
Since we are once again encountering the necessity for this (see also #1334), should we revisit the decision to not plan this?
Some points for the rationale:
PGM_set_experimental_features(handle, options, disabled)results in the same behavior. It's a non-issue.with experimental_features_enabled(): ...could do the trickAny objections to re-opening this?
mgovers commentedon Jun 11, 2026
Closing in favor of #934