[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ANN] orgtbl-fit

From: tbanelwebmin
Subject: Re: [ANN] orgtbl-fit
Date: Wed, 1 Mar 2023 12:48:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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

Examples & documentation can be read here:
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.


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

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 
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.


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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]