Print UserWarning only if fit_proportional is False.
@@ -577,8 +577,9 @@ class VectorFitting:
logging.info('\n### Vector fitting finished in {} seconds.\n'.format(self.wall_clock_time))
- # raise a warning if the fitted Network is passive but the fit is not:
- if self.network.is_passive() and not self.is_passive():
+ # raise a warning if the fitted Network is passive but the fit is not (only without proportional_coeff):
+ if self.network.is_passive() and not fit_proportional:
+ if not self.is_passive():
warnings.warn('The fitted network is passive, but the vector fit is not passive. Consider running '
'`passivity_enforce()` to enforce passivity before using this model.',
UserWarning, stacklevel=2)
