From 5d845e66fbb5be900f61edc65e30a22c81054a79 Mon Sep 17 00:00:00 2001 From: Iglesia Dolci Date: Tue, 21 May 2024 15:33:13 +0100 Subject: [PATCH] move logging warning to user warnings --- pyadjoint/control.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyadjoint/control.py b/pyadjoint/control.py index f8e626be..877babcd 100644 --- a/pyadjoint/control.py +++ b/pyadjoint/control.py @@ -1,5 +1,5 @@ from .overloaded_type import OverloadedType, create_overloaded_object -import logging +import warnings class Control(object): @@ -47,13 +47,13 @@ def tape_value(self): def get_derivative(self, options={}): if self.block_variable.adj_value is None: - logging.warning("Adjoint value is None, is the functional independent of the control variable?") + warnings.warn("Adjoint value is None, is the functional independent of the control variable?") return self.control._ad_convert_type(0., options=options) return self.control._ad_convert_type(self.block_variable.adj_value, options=options) def get_hessian(self, options={}): if self.block_variable.adj_value is None: - logging.warning("Hessian value is None, is the functional independent of the control variable?") + warnings.warn("Hessian value is None, is the functional independent of the control variable?") return self.control._ad_convert_type(0., options=options) return self.control._ad_convert_type(self.block_variable.hessian_value, options=options)