Skip to content

Commit 66c0750

Browse files
committed
Use warnings.warn() instead of print()
1 parent 2a7248d commit 66c0750

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

hls4ml/backends/catapult/catapult_backend.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import sys
3+
from warnings import warn
34

45
import numpy as np
56

@@ -154,7 +155,7 @@ def _register_flows(self):
154155

155156
if len(extras) > 0:
156157
for opt in extras:
157-
print(f'WARNING: Optimizer "{opt}" is not part of any flow and will not be executed.')
158+
warn(f'WARNING: Optimizer "{opt}" is not part of any flow and will not be executed.')
158159

159160
ip_flow_requirements = [
160161
'optimize',

hls4ml/backends/quartus/quartus_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _register_flows(self):
104104

105105
if len(extras) > 0:
106106
for opt in extras:
107-
print(f'WARNING: Optimizer "{opt}" is not part of any flow and will not be executed.')
107+
warn(f'WARNING: Optimizer "{opt}" is not part of any flow and will not be executed.')
108108

109109
ip_flow_requirements = [
110110
'optimize',

hls4ml/backends/vivado/vivado_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def _register_flows(self):
148148

149149
if len(extras) > 0:
150150
for opt in extras:
151-
print(f'WARNING: Optimizer "{opt}" is not part of any flow and will not be executed.')
151+
warn(f'WARNING: Optimizer "{opt}" is not part of any flow and will not be executed.')
152152

153153
ip_flow_requirements = [
154154
'optimize',

0 commit comments

Comments
 (0)