Coding Conventions
Scaling of quantities and logging rules that code in DPsim has to follow.
Conventions that apply across the codebase. For the process of getting a change merged, see contributing.
This is a summary of general guidelines for the development of DPsim.
Scaling of Voltages and Currents
Voltage quantities are expressed either as phase-to-phase RMS values (denominated as RMS3PH) or as phase-to-ground peak values (denominated as PEAK1PH):
- Initialisation quantities (e.g.
initialSingleVoltageofSimPowerComp) asRMS3PHvalues - Simulation quantities in the
SPandDP::Ph1domains (e.g.mIntfVoltageofDP::Ph1::PiLine) asRMS3PHvalues - Simulation quantities in the
DP::Ph3andEMTdomains (e.g.mIntfVoltageofDP::Ph3::PiLineorEMT::Ph3::Transformer) asPEAK1PHvalues
Current quantities are expressed either as RMS or as PEAK values:
- Simulation quantities in the
SPandDP::Ph1domains (e.g.mIntfCurrentofDP::Ph1::PiLine) asRMSvalues - Simulation quantities in the
DP::Ph3andEMTdomains (e.g.mIntfCurrentofDP::Ph3::PiLineorEMT::Ph3::Transformer) asPEAKvalues
Logging
Debug or trace should be the default log level for information that might be nice to have but not necessary for every simulation case.
Calls to the logger that might occur during simulation must use spdlog macros, like SPDLOG_LOGGER_INFO.
Last modified 25.08.2026: test(notebooks): skip slow notebook tests in CI (aae182c)