From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4OWPLKk7/2OtNAAAbAwnHQ (envelope-from ) for ; Wed, 01 Mar 2023 12:48:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EKExLKk7/2OIpwAAauVa8A (envelope-from ) for ; Wed, 01 Mar 2023 12:48:57 +0100 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 601062246F for ; Wed, 1 Mar 2023 12:48:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXKwu-0001QM-Lb; Wed, 01 Mar 2023 06:48:44 -0500 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 1pXKwr-0001Q5-Vw for emacs-orgmode@gnu.org; Wed, 01 Mar 2023 06:48:42 -0500 Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXKwp-0000BR-Sw for emacs-orgmode@gnu.org; Wed, 01 Mar 2023 06:48:41 -0500 Received: from [IPV6:2a01:e0a:48b:f340:6ca7:9f85:a585:9198] (unknown [IPv6:2a01:e0a:48b:f340:6ca7:9f85:a585:9198]) (Authenticated sender: tbanelwebmin@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id CEB7B780313; Wed, 1 Mar 2023 12:48:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1677671316; bh=X06UHFCuTlFulGzxGCuAhtbRsqh/RCMsMSZkmorh+ZM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=tBcq37Usm8ccpMfJYvXz+UjXjI5PxSEdru1XpzjX+6tIc7eLSwwoBLUP3fY1aug4M dx7o8S8YjKMZF7trZhwwKSiq5vzmssIldo2R2pfKncsko8kP/LNfa2QzDeAV9mSbVT EjpmnCPTG6J8A12t0hii5NACELWAK2NuJgdpl/1X0tGNalXItRMMAzxWKOibeuvC+k +oLJO8TdbwAw3j5LbOdR9TbmcwyoDfZEuDAvQtUXMlV0Nw0YkHJjEVIjCFsSg4caTU Xvwmx/Pf0Z8X3Oy88CIpYqO9Z1pSSlUaxEnhyv3xZFd+fI1WdV4da6De7iizeBncr/ AcdW1NIK0qpdQ== Message-ID: <744eaf03-9f80-d9b6-e173-54ad20ce22ac@free.fr> Date: Wed, 1 Mar 2023 12:48:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [ANN] orgtbl-fit Content-Language: fr, en-US To: Ihor Radchenko Cc: emacs-orgmode@gnu.org References: <116c3126-32cc-44d0-9e95-e802161e1e84@app.fastmail.com> <87zgb90win.fsf@localhost> <87tu0qdc4k.fsf@localhost> <304d062e-c760-53ad-e442-ca646f2c892d@free.fr> <87a627ogg3.fsf@localhost> <073b5e6e-8c81-66c6-6a5e-19c5e10f0176@free.fr> <871qnhwpld.fsf@localhost> <840f139e-d62f-a6ac-8691-b63afb4cd1d6@free.fr> <87zg98ehkw.fsf@localhost> From: tbanelwebmin In-Reply-To: <87zg98ehkw.fsf@localhost> Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a01:e0c:1:1599::15; envelope-from=tbanelwebmin@free.fr; helo=smtp6-g21.free.fr 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, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.1, NICE_REPLY_A=-0.092, 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677671337; a=rsa-sha256; cv=none; b=gxLyaNP4bAhYcXk0r0e+mOiFOAYsT0zwRvnKc49uWSPkcPuCgnNjkRP9l1EcqW/kY0rIMZ mzqSNWRz0AODUXh1uIOtgQbZv1czsa/mONnW+j9Z6vlncX6BtcnnicHIuCwxZguKlijUYZ +dBvmDc4sqjxVg+qQvQ6GhoxnG5nWLsYtPOuS99CLyg/KSNTssfPuIfi0xi1PmusV/XmLW eMrf4SRmLCAsCpy8c7hVGPrfEl2kIKwpe9W52d33USmVVYE1rP3dxaVR9bERA1DFZ5tYIY u96uuG3Cx7d7/2eBOrz3puWLoYNv9KwcFV1kFvG5MkhVDrGoXaejO6U55aakjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=tBcq37Us; 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=free.fr ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677671337; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Z1kuADj5hbmC4PwFa2LVMrTI74vg5t9y2o92rRBFEnE=; b=Taqx9dwnWj2x9VWIy0k0p0s5A34p+hJN0VQinc6VdcCI4FzInUgWWRs6S7AKOdZAGowttr rmbJSHpf5J+ik+qXn+dZbkEZsSadw8Ef/y5V7fSbaxxHx5WaWbNWQ8VbRomizf0yE9CVtn QjS+jpdAqjXpa22oLjQXdqTT89yPiNgdHAv1jwuDiDxPpgoKe2TrC6f5BbFHGkAr1DSBXA NJhdjSx3JmY/C5LL4LStlq4JkgCGgXYICSDCQ7r88uwjAcWV6B7FXHUQXJKpbhcUvt1ntc IQmvvgfL6jJ1LWoWcZ0db5r/xZHZbCJA9I4hkqlfV75JezGQhOsLFC2jkzG5uA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.67 X-Spam-Score: -4.67 X-Migadu-Queue-Id: 601062246F Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=tBcq37Us; 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=free.fr X-TUID: BXdQDuDZQt7W

On 2/20/23 11:50, Ihor Radchenko wrote:
tbanelwebmin <tbanelwebmin@free.fr> writes:

Examples & documentation can be read here:
https://github.com/tbanel/orgtblfit/blob/main/README.org
Interesting.
Could it be somehow integrated with TBLFM formulas?
I imagine something like

? +?*year +?*passengers +?*(year-2016)*passengers

, when set as a column value in table formula, to be auto-updated with
actual coefficients upon re-calculating the table.
...
We need to specify the target column ("consumption" in this example). 
Therefore, the formula could be something like that:

$4 = fit (consumption = ? +?*year +?*passengers +?*(year-2016)*passengers)
It would benefit from other spreadsheet features, like constants and 
remote references.
Makes sense.

On the development side, the TBLFM handling is already quite a big chunk 
of code. We must take care that such an additional feature do not add 
complexity and maintenance burden.
>From point of view of org-table.el, adding fitting functionality is
mostly delegating the work to GNU Calc. Org side is just parsing the
formula and transforming it to appropriate Calc function call.

Absolutely.

From Org table to Calc and back to Org table is what the orgtbl-fit package does. Currently it is around 400 lines of Elisp and 700 lines of unit tests.


So, given that the parsing is extended cleanly, I do not think that
maintenance burden will increase all that much. It may even benefit from
someone taking a fresh look and possibly refactoring org-table TBLFM
parser.

Most likely.


Orgtbl-fit as-is
----------------

It is also possible to include orgtbl-fit as-is into Org Mode core. It 
would sit side-by-side with the core without changing anything in its 
code and its unit-tests.
IMHO, it is not sufficiently integrated with org-table.el facilities in
its current state. I'm afraid that we will have code duplication if
include orgtbl-fit as is.

Yes. One of the benefits from a fresh look you were talking about, would be avoiding code duplication.


BTW, the dollar replacement is something org-table can benefit from---a
number of people are confused because "$" is treated specially by Calc.

I'm not sure what you mean. The dollar in spreadsheet formulas? Like:
#+TBLFM: $6=$5+1


Data-analysis toolkit
---------------------

 From a higher perspective, we could give a consistent data-analysis 
toolkit to Org Mode (and call it org-data-analysis.el).

It would start with fitting, clustering & aggregation. Then, new 
algorithms would be added upon user requests.

Of course, there should be an interest among Org Mode users for such a 
toolkit.
We can, but it should be first and foremost added to GNU Calc. On Org
side, we just need appropriate integration. Maintaining generic data
analysis code in Org is out of Org's scope.

Absolutely

Although the latest Calc release seams to be 2.02f, dating back in January 1992. Has it reached perfection 31 years ago?


Contributing to GNU Calc will also benefit GNU Calc users who don't use
Org mode.