From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OHKkKWhI5WTj6QAASxT56A (envelope-from ) for ; Wed, 23 Aug 2023 01:44:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uGHGKWhI5WTl6AAA9RJhRA (envelope-from ) for ; Wed, 23 Aug 2023 01:44:40 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 535796013B for ; Wed, 23 Aug 2023 01:44:40 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=lyXe0S+r; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692747880; a=rsa-sha256; cv=none; b=WCcxS3evjauoBMvV6gONikTXW9qYt75mck0BhLeBR8w/0Xlcv9fGTIqodwy8wF138617oI 8aJS1JacdppxzR/wmEeQG5ny3JI75dEt3dKPmGL7ksk4A2Yfs5JVzEov5KeOwJFykuDW3z fyk0VPdQBk942jbIS3+x+DKUkFMn2ZUcfp3+5krc99GU6QtE5Lm6KKPyYOdjZTqQEQYsZn Ssrg5rPS7ssPt9UFGaWDkzaapw0qQlCgpyEvR/vpL8I4KhPzucbqTkxGp5wevJdRUt35UP AQqDcuzXBvzqACkKkw8Mdhw117nKbFzyk18uVwNS0OBX/J0Wif5bRmNQvCU1+w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=lyXe0S+r; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692747880; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Z6sMdACgjFkWeK+RrY+WM+ere/V8ILiUsnd2z6WluIM=; b=Yrnxl7dTXBkBTKIhvSONcP4GUSn2aymhg1ZgsDKVuEMCo+6xcLUJMr4GRBX44dGOa7t6Qe Wh8rbGjj9nqHq6h63DHFtA+U16b5zHjJeb6Tz0JxeJGuVRWkNF6NaCdZdhHlF6PNikH3zT YEf8p9a8vdQ3gctmUa9aHmaPjUAXXDZ2zIdnYIQxuetgbhTaHLRGoI8yZ3lmO6ve44H4mL fRiOEJUWrG+YSHQti1QN0iUGdiaRGyaeR3kW8gl5WRXViC1Wgyfs3HQXO4yvqzyq/OyPcG sysbdXeHyOirRcOsVltk2I5YOex2ixFlAQaGTqnm1V9XLgDS4sHJoqLnXz+QRQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYb2i-0001Fh-61; Tue, 22 Aug 2023 19:44:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYb2g-0001FY-CI for emacs-orgmode@gnu.org; Tue, 22 Aug 2023 19:44:10 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYb2e-00005d-73 for emacs-orgmode@gnu.org; Tue, 22 Aug 2023 19:44:10 -0400 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-76da8e70ed3so155324485a.3 for ; Tue, 22 Aug 2023 16:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692747846; x=1693352646; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Z6sMdACgjFkWeK+RrY+WM+ere/V8ILiUsnd2z6WluIM=; b=lyXe0S+r4O1+MnAVQtfxwKyHhsU2PW6m+dc6ELOh5ilI7KHRpzzKnHBPLng2oUIpAO FgFGcVR7HFf4nUhcOBKxkgTtonUS+XDJw5tGI8TG+/7AWKquBDRTL7cahD6iqKBuvvtW nStHnpqnSgFTYlw2wgiwx49c/hgZmuY64Xc1J1LSpHaQDIs7USTOMD30Wb+QrocIG+/O Uc6DbfjprGr1QsQMozroiPZZpgdvgHJcHES52YPLPEk4UcRewvpM7eJDmS78Dv2DsrPf HoktU95xWXh2ZBhFMrvXjJunQI1m1iZ7oMLs+WigpyMb0/TtF8M4OEnOCHFJ7gZwaj8u qd+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692747846; x=1693352646; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z6sMdACgjFkWeK+RrY+WM+ere/V8ILiUsnd2z6WluIM=; b=UblHl+eD7x/oEXWfws/CITBo/PszRK4Hpk5TheiPY1qIBZ4W7FwwA6kg5CX16igH5d mW36KvKplRumnacDRXwFYMURpS5yct3ZsSFf+dwmgx770zAfB9pHsRhkNpVkKZHgeuGB 7QCADqd+8fajqhzJ3ZqcoocRVXJ8mVTAyzP/2/DGbtpQEAA2LdpfB16ltH9bZbCWIjzX dgRETXaMKi4upmbhYjcA1y2xTzfF6h6/5yzOaPa+OBswpmRCgbdpmISKgIHOFEQeyDA1 kDqqWKx/JwEhGLfv+mjLEiIU7E5JbwIGLB6z6wyHcrhv78XLEMhnCEyisijBtZe+NN1a ryZA== X-Gm-Message-State: AOJu0Yw23bj4wrq6nNxRwLnDYYkAnS5JoyPtFvNdcZmAHRMJboiq7uo8 rdAbYW20MpPOI1O7Yrk/ev8= X-Google-Smtp-Source: AGHT+IF4WnR96XSamnsPNGyphp8L+Xu8a+/hhHF+8LnEzeuZLKIlyxIeevr56ufi1Gjb7/ayxTwHOw== X-Received: by 2002:a05:620a:c05:b0:765:a651:a11d with SMTP id l5-20020a05620a0c0500b00765a651a11dmr10512088qki.36.1692747846360; Tue, 22 Aug 2023 16:44:06 -0700 (PDT) Received: from localhost (157-131-78-143.fiber.dynamic.sonic.net. [157.131.78.143]) by smtp.gmail.com with ESMTPSA id z137-20020a63338f000000b0055386b1415dsm2808284pgz.51.2023.08.22.16.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 16:44:05 -0700 (PDT) From: Jack Kamm To: Liu Hui Cc: emacs-orgmode@gnu.org, Ihor Radchenko Subject: Re: [PATCH] ob-python results handling for dicts, dataframes, arrays, and plots In-Reply-To: <87ttsta7lw.fsf@gmail.com> References: <87a5ur6f7w.fsf@gmail.com> <87edk0aqy5.fsf@gmail.com> <87ttsta7lw.fsf@gmail.com> Date: Tue, 22 Aug 2023 16:44:05 -0700 Message-ID: <87lee2abi2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=jackkamm@gmail.com; helo=mail-qk1-x734.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Spam-Score: -8.39 X-Migadu-Queue-Id: 535796013B X-Migadu-Spam-Score: -8.39 X-TUID: U+fg7w61HyqP Jack Kamm writes: > Liu Hui writes: > >> I think these objects need to be shown in a single column rather than >> two. Besides, if the python code becomes too complex finally, I think >> maintaining the python code outside the ob-python.el, as suggested by >> Ihor, is a good idea. > > Thanks for reporting these misbehaving examples. I think the root of the > problem is `org-babel-script-escape', which is too aggressive in > recursively converting strings to lists. We may need to rewrite our own > implementation for ob-python. > > Also, I agree that moving the python code to an external file will be > helpful in handling these more complex cases. > > I may leave these tasks for future patches. In the meantime, we may have > to recommend ":results verbatim" for these more complex cases that > ":results table" doesn't fully handle yet. Pushed the patch now, with one final change: I decided to leave dict as string by default, converting to table only when ":results table" is explicitly set. I think it's better this way for now, because of the misbehaving examples you pointed out -- table conversion is not yet fully robust for complex dict's containing complicated objects or structures.