From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mAknKHj/32QfQgEASxT56A (envelope-from ) for ; Sat, 19 Aug 2023 01:32:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0PhKKHj/32QjcwEA9RJhRA (envelope-from ) for ; Sat, 19 Aug 2023 01:32:08 +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 6619A44078 for ; Sat, 19 Aug 2023 01:32:08 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=Juc6IXt1; 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=1692401528; 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=J2wnp9kgA8k4E3QJfEm1CpsyZrVk/jGsK66d6Y0z0vI=; b=YudNckb4/Aa8F0xtRlq9QucafrmYf7t6ZVH7nForbFZ8mL5EDAYlfVTzfeMtcG5Wu4AGUC iM7B/5yqyJkX+UxHV2x+M3NP768fAoRUtugqma5fJl5LoTP3VqqXml/oqhRKUaoL0SdV0B sz7o+eNYph9EbYNJw0HDLpFRPgwy0+bMuvKonB+I9W7/TstCiWRsOZdjfa6C1fMyVEE3H3 aDYxXVB+6nQd5xTJeZ7knnz5G4152UBKkjSKo+nmkiBq8oeAHrb1XbgpBSupFXhMY3ol7E oXGQHoP1vu5L/OP/rC4zj2u0gz8uuiR+8WbuEPgadcTB4xLMFQHTu6GzdfwqJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=Juc6IXt1; 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=1692401528; a=rsa-sha256; cv=none; b=OJ+5rnDWt1UerUcj47zzwpe91O4Ty1sBZ4Ei7TNuXr3g7PchyQ9k2Q/5hFo9pkC+LQ9FaB W31jNmXwvkn0Ea+Ha7nprCnarXEqUYJ6dVhVY5MZny0vXNasHkbuOvmp41WIXCzxVP5eg/ 1Y6zh/sqLfMHvpcF9g5jxsKCH3IB7Gi1QhDDO/ByyLU3WJmrqy4LesopWLDB5Zung8rkpA mQib7BoU/ALQNMszzTpRCkLyE3aHCSIeV8xVClXR2s0uYeTxor64AbOquRNOgUKLoHfOXR Bh1q0djvXfuhNDTiKT2GTKO7elrtYH++PfIZ5K74YLsJgL/OIPx2vHWRuJWo7A== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qX8w1-0003mM-L8; Fri, 18 Aug 2023 19:31:18 -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 1qX8vk-0003lt-N3; Fri, 18 Aug 2023 19:31:02 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qX8vg-0000zP-VM; Fri, 18 Aug 2023 19:31:00 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6889350bc2bso1359598b3a.0; Fri, 18 Aug 2023 16:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692401453; x=1693006253; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=J2wnp9kgA8k4E3QJfEm1CpsyZrVk/jGsK66d6Y0z0vI=; b=Juc6IXt1MgC80uKrRFvb4C+hfaH59KtSDaZjHjmrhbkmKem/26dhofUVHIe9MRMd3F BThnHhexmaDSQKFDtWvT+F8riuamZRN8WF6Hn5K+KVOqixZlL4Hrh5uykCGhE4JEWaG2 ebwgAj47jDQRcP8ynlgDL78KZT/nbQ1KVWqLveA1O03U69xLXAXafDfyPifkc0UuYv+J JgwrqdsZFvXECdgxmaXaVo3UXy2zt9DeYa0cQkuhqjrFnI/amuiMZVmmN/cfLLDVPLtA 3IbLAtYVNqLG5oBLkC1toMO2NuSJvqWCKUizoiWgRhZk7wEI4wvES5H5h+qPJWCyE1gn 8Ftg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692401453; x=1693006253; 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=J2wnp9kgA8k4E3QJfEm1CpsyZrVk/jGsK66d6Y0z0vI=; b=Dv1Z1rHBes3c2ThbhKLKAfuZK/eR+TCr0/xdau8AMhBL/SSoZB90+sQwS0RkPuAuD8 CpR/N+a2luCcr9ykB3v5pekwW9Nm4uDBuOWMoPV1GvyXKX3cf+WOmqRr3KKUaGBp8wcr vk7iLKxQCRf0hwdNANSUj+uR4dUpesey7mBLmUmcVm8ZderdZdS4WggN0HX4SzCNtoDX jDBhhi4uPbDCLa9K2s3uX4OKnKJCfOTFLt/p5nDaHoXxI4NJoouJI6DT/XhxwMsG02LO ZplaXfJ7WQsaBwQd7rxbLdjVzCcAmJnC3QISXH5bLcPI/1hq9DtjA57CMhUTcrQKiwUW My/Q== X-Gm-Message-State: AOJu0YxKeQR+eg87EdL6OuAWjmKIoc8uoAoFe3MT+DsqMVyrBQpBwkXT DXwIG5slSQEs3YgT9jDuntA= X-Google-Smtp-Source: AGHT+IEHX1b63DUSU8xB21fLG10a8lwKSHshoLP/y0yQe+HSouJd9K32ChsLj9eKa4Q22ilXjimfbg== X-Received: by 2002:a05:6a20:ce93:b0:133:6816:c889 with SMTP id if19-20020a056a20ce9300b001336816c889mr673570pzb.40.1692401453280; Fri, 18 Aug 2023 16:30:53 -0700 (PDT) Received: from localhost (157-131-78-143.fiber.dynamic.sonic.net. [157.131.78.143]) by smtp.gmail.com with ESMTPSA id s75-20020a63774e000000b0056416526a5csm2064197pgc.59.2023.08.18.16.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 16:30:52 -0700 (PDT) From: Jack Kamm To: gerard.vermeulen@posteo.net Cc: Ihor Radchenko , emacs-orgmode@gnu.org, Liu Hui , emacs-orgmode-bounces+gerard.vermeulen=posteo.net@gnu.org Subject: Re: [PATCH] ob-python results handling for dicts, dataframes, arrays, and plots In-Reply-To: <9948eae293cae8766808778d6390eb64@posteo.net> References: <87a5ur6f7w.fsf@gmail.com> <871qg3pc2o.fsf@localhost> <87350i9uwv.fsf@gmail.com> <9948eae293cae8766808778d6390eb64@posteo.net> Date: Fri, 18 Aug 2023 16:30:51 -0700 Message-ID: <878ra8apxw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=jackkamm@gmail.com; helo=mail-pf1-x435.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: -9.13 X-Spam-Score: -9.13 X-Migadu-Queue-Id: 6619A44078 X-TUID: cKnapsFfISAr gerard.vermeulen@posteo.net writes: > I do not know how much this "abuse" of defconst is frowned > upon (elisp manual says defconst is advisory), but maybe it > can be advertised as a feature. org-babel-python--def-format-value is a "private" variable (it has double dash "--" in its name). Therefore it's not generally recommended to modify it. Of course, elisp doesn't have true private variables or functions, and you are free to change things as you wish -- this is one of the perks of Emacs :) But you've been warned, since this is a private variable, we make no guarantees, and may break things in backward-incompatible ways in the future. As to the broader point, I agree there are many more features that would be nice to add ob-python results handling. But making ob-python too complex will be difficult to maintain, especially since the Python code is all in quoted strings without proper linting. So I am thinking now about how we could make this more extensible in future. One idea is to create a Python package for interfacing with Org Babel, and release it on PyPi. If we detect the package is installed, then we can delegate to it for results formatting. And the community could contribute results handling for all sorts of Python objects to that package. That is just one idea for improving extensibility -- I'm not sure it's the best, and am open to other suggestions as well.