英文:
Is there a way to return a 3D list from embedded Python back to ECL?
问题
我有一个Python中的2D数组,我想将其返回给ELC以供进一步使用。
记录集的格式如下:
布局:= RECORD
整数 RED;
整数 GREEN;
整数 BLUE;
END;
记录数大约约为640,000个,当我尝试将其返回到ELC并显示时,出现以下错误:
数据集过大,无法输出到工作单元(限制设置为10兆字节)。
是否有更改工作单元输出限制的方法?
英文:
I have a 2D array in Python which I want to return back to ELC, for further usage.
The recordset is of the following format
layout:=RECORD
INTEGER RED;
INTEGER GREEN;
INTEGER BLUE;
END;
The no. of records approximate to around 640000, which when I attempt to return to ELC and display, gives the following error:
Dataset too large to output to workunit(limit is set to 10)megabytes
Is there any method to change the output limit of a workunit?
答案1
得分: 1
RGB值通常在0-255范围内(在ECL中,这意味着UNSIGNED1 - 一个无符号的1字节整数类型),而您正在使用的INTEGER类型默认为8字节有符号整数类型。
因此,如果您将Python代码的返回类型更改为1字节无符号RGB值,您应该将总返回大小减小到先前的八分之一。由于640000个记录 * 每个3字节 = 1.92Mb总返回数据(远远小于您收到的10Mb错误消息),只需这样做应该可以解决您的问题。
希望对您有所帮助,
Richard
英文:
Shashank,
RGB values tend to each usually be in the range of 0-255 (in ECL, that means an UNSIGNED1 -- an unsigned 1-byte integer type), and the INTEGER type you're using defaults to an 8-byte signed integer type.
So, if you change your return types from your Python code to 1-byte unsigned RGB values you should reduce the total return size to an eighth of the previous. Since 640000 recs * 3 bytes each = 1.92Mb total returned data (considerably smaller than the 10Mb error message you're getting), just doing this should hopefully solve your problem.
HTH,
Richard
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论