[PyCharm Tables] PY-33448 PyCharm freezes with large objects in SciView #PY-33448 Fixed

* Transposed 1-D numpy array on the Python side of the Debugger
* Applied setMaxItemsForSizeCalculation method to the myRowHeader table to minimize calculations for getRowHeight

(cherry picked from commit f88fa625f2d8673cba2c9819f2907462b3f2301d)

GitOrigin-RevId: de6f919f18caec6624b1696790a88e10659e96f0
This commit is contained in:
Natalia.Murycheva
2024-12-07 01:10:49 +01:00
committed by intellij-monorepo-bot
parent c68e31976c
commit 53d3243005
2 changed files with 6 additions and 15 deletions

View File

@@ -630,20 +630,11 @@ def array_to_meta_xml(array, name, format):
# http://stackoverflow.com/questions/16837946/numpy-a-2-rows-1-column-file-loadtxt-returns-1row-2-columns # http://stackoverflow.com/questions/16837946/numpy-a-2-rows-1-column-file-loadtxt-returns-1row-2-columns
# explanation: http://stackoverflow.com/questions/15165170/how-do-i-maintain-row-column-orientation-of-vectors-in-numpy?rq=1 # explanation: http://stackoverflow.com/questions/15165170/how-do-i-maintain-row-column-orientation-of-vectors-in-numpy?rq=1
# we use kind of a hack - get information about memory from C_CONTIGUOUS # we use kind of a hack - get information about memory from C_CONTIGUOUS
is_row = array.flags['C_CONTIGUOUS'] cols = 1
rows = len(array)
if is_row: if rows < len(array):
rows = 1 reslice = '[0:%s]' % (rows)
cols = len(array) array = array[0:rows]
if cols < len(array):
reslice = '[0:%s]' % (cols)
array = array[0:cols]
else:
cols = 1
rows = len(array)
if rows < len(array):
reslice = '[0:%s]' % (rows)
array = array[0:rows]
elif l == 2: elif l == 2:
rows = array.shape[-2] rows = array.shape[-2]
cols = array.shape[-1] cols = array.shape[-1]

View File

@@ -179,7 +179,7 @@ public class PythonDataViewerTest extends PyEnvTestCase {
runPythonTest(new PyDataFrameDebuggerTask("/debug", "test_sci_data_with_complex_numbers.py", Collections.singleton(2)) { runPythonTest(new PyDataFrameDebuggerTask("/debug", "test_sci_data_with_complex_numbers.py", Collections.singleton(2)) {
@Override @Override
public void testing() throws Exception { public void testing() throws Exception {
doTest("arr", 1, 10, chunk -> { doTest("arr", 10, 1, chunk -> {
assertEquals("(9.000000000000001e-09+1.8000000000000002e-08j)", chunk.getMax()); assertEquals("(9.000000000000001e-09+1.8000000000000002e-08j)", chunk.getMax());
assertEquals("0j", chunk.getMin()); assertEquals("0j", chunk.getMin());
}); });