Generate a warning instead of printing

This commit is contained in:
Jan Petykiewicz 2020-04-18 01:37:53 -07:00
parent f4eeb50a6f
commit bb9ebfc8f9

View File

@ -8,6 +8,7 @@ from enum import Enum
import math import math
import struct import struct
import io import io
import warnings
try: try:
import numpy import numpy
@ -1038,8 +1039,7 @@ class GridRepetition:
if self.b_count < 2: if self.b_count < 2:
self.b_count = None self.b_count = None
self.b_vector = None self.b_vector = None
print('Warning: removed b_count and b_vector since b_count == 1') warnings.warn('Removed b_count and b_vector since b_count == 1')
# TODO: warn here
if self.a_count < 2: if self.a_count < 2:
raise InvalidDataError('Repetition has too-small x-count: ' raise InvalidDataError('Repetition has too-small x-count: '