void () { runPythonTest(new PyDebuggerTask("/debug", "test_large_numpy_arrays.py") { @NotNull @Override public Set<String> getTags() { return Collections.singleton("pandas"); } @Override public void before() { toggleBreakpoint(getFilePath(getScriptName()), 9); } @Override public void testing() throws Exception { waitForPause(); List<PyDebugValue> frameVariables = loadFrame(); int collectionLength = 1000; // NumPy array PyDebugValue nd = findDebugValueByName(frameVariables, "nd"); XValueChildrenList children = loadVariable(nd); assertEquals("min", children.getName(0)); assertEquals("max", children.getName(1)); assertEquals("shape", children.getName(2)); assertEquals("dtype", children.getName(3)); assertEquals("size", children.getName(4)); assertEquals("array", children.getName(5)); PyDebugValue array = (PyDebugValue)children.getValue(5); children = loadVariable(array); assertEquals(MAX_ITEMS_TO_HANDLE + 1, children.size()); for (int i = 0; i < MAX_ITEMS_TO_HANDLE; i++) { assertTrue(hasChildWithName(children, formatStr(i, collectionLength))); } array.setOffset(950); children = loadVariable(array); assertEquals(51, children.size()); for (int i = 950; i < collectionLength; i++) { assertTrue(hasChildWithName(children, formatStr(i, collectionLength))); } // Pandas series PyDebugValue s = findDebugValueByName(frameVariables, "s"); children = loadVariable(s); PyDebugValue values = (PyDebugValue)children.getValue(children.size() - 1); children = loadVariable(values); array = (PyDebugValue)children.getValue(children.size() - 1); children = loadVariable(array); assertEquals(MAX_ITEMS_TO_HANDLE + 1, children.size()); for (int i = 0; i < MAX_ITEMS_TO_HANDLE; i++) { assertTrue(hasChildWithName(children, formatStr(i, collectionLength))); } array.setOffset(950); children = loadVariable(array); assertEquals(51, children.size()); for (int i = 950; i < collectionLength; i++) { assertTrue(hasChildWithName(children, formatStr(i, collectionLength))); } // Pandas data frame PyDebugValue df = findDebugValueByName(frameVariables, "df"); children = loadVariable(df); values = (PyDebugValue)children.getValue(children.size() - 1); children = loadVariable(values); array = (PyDebugValue)children.getValue(children.size() - 1); children = loadVariable(array); assertEquals(MAX_ITEMS_TO_HANDLE + 1, children.size()); for (int i = 0; i < MAX_ITEMS_TO_HANDLE; i++) { assertTrue(hasChildWithName(children, formatStr(i, collectionLength))); } array.setOffset(950); children = loadVariable(array); assertEquals(51, children.size()); for (int i = 950; i < collectionLength; i++) { assertTrue(hasChildWithName(children, formatStr(i, collectionLength))); } } }); }