fix : minor edit in MATPLOTLIB_VERSION_WARNING

pull/71/head
sepandhaghighi 2021-11-04 11:01:20 +03:30
rodzic 10e86ae6b7
commit 33e32220ef
3 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -40,7 +40,7 @@ class GenerativeImage:
if data is not None:
self.data1, self.data2, matplotlib_version = load_data(data)
if matplotlib_version != matplotlib.__version__:
warn(MATPLOTLIB_VERSION_WARNING, RuntimeWarning)
warn(MATPLOTLIB_VERSION_WARNING.format(matplotlib.__version__), RuntimeWarning)
self.function1 = function1
self.function2 = function2
self.fig = None

Wyświetl plik

@ -33,7 +33,7 @@ DATA_PARSING_ERROR = "Provided data format is wrong. It should be in JSON format
NO_FUNCTION_ERROR = "At least one of the given functions are None."
JUST_DATA_WARNING = "Just data is provided, generate method is not available in this mode."
NOTHING_PROVIDED_WARNING = "Neither function nor data is provided."
MATPLOTLIB_VERSION_WARNING = "Source matplotlib version is different from yours, plots may be different."
MATPLOTLIB_VERSION_WARNING = "Source matplotlib version({0}) is different from yours, plots may be different."
class Projection(Enum):

Wyświetl plik

@ -17,7 +17,7 @@ True
True
>>> with open('data.json', 'w') as fp:
... json.dump({'data1': [0], 'data2': [0], 'matplotlib_version': '0'}, fp)
>>> with warns(RuntimeWarning, match="Source matplotlib version is different from yours, plots may be different."):
>>> with warns(RuntimeWarning, match="Source matplotlib version(0) is different from yours, plots may be different."):
... g = GenerativeImage(lambda x,y: 0, lambda x,y: 0, data=open('data.json', 'r'))
>>> os.remove('data.json')
"""