The warnings.warn function should be called with the stacklevel parameter to provide more accurate information about the source of the warning. Also, the message should be passed directly instead of using format. This will allow tools to filter based on warning type instead of message.
Consider the following updates to the read_header method:
if header["analysis end"] - header["analysis start"] != 0:
warnings.warn(
"There appears to be some information in the ANALYSIS segment of file "
"{0}. However, it might not be read correctly.".format(self.path),
stacklevel=2,
)
should be changed to:
if header["analysis end"] - header["analysis start"] != 0:
warnings.warn(
"There appears to be some information in the ANALYSIS segment of file {0}. However, it might not be read correctly.".format(self.path),
stacklevel=2,
)
This issue exists elsewhere in the code, such as in FCSParser._extract_text_dict and should be updated consistently.
The
warnings.warnfunction should be called with thestacklevelparameter to provide more accurate information about the source of the warning. Also, the message should be passed directly instead of using format. This will allow tools to filter based on warning type instead of message.Consider the following updates to the
read_headermethod:should be changed to:
This issue exists elsewhere in the code, such as in
FCSParser._extract_text_dictand should be updated consistently.