From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GPa3IGywqmT4ywAASxT56A (envelope-from ) for ; Sun, 09 Jul 2023 15:04:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KJeAH2ywqmTOpAAAG6o9tA (envelope-from ) for ; Sun, 09 Jul 2023 15:04:44 +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 20C7414A55 for ; Sun, 9 Jul 2023 15:04:44 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qITob-0001NU-5n; Sun, 09 Jul 2023 08:47:01 -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 1qIToZ-0001NK-Fe for emacs-orgmode@gnu.org; Sun, 09 Jul 2023 08:46:59 -0400 Received: from smtpcmd0995.aruba.it ([62.149.156.95]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIToW-0006Ku-F0 for emacs-orgmode@gnu.org; Sun, 09 Jul 2023 08:46:59 -0400 Received: from fedeli.eu ([10.10.10.167]) by Aruba Outgoing Smtp with ESMTPA id IToRqXF3nD50MIToRqZR1A; Sun, 09 Jul 2023 14:46:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1688906811; bh=cOzHBKPdZDhgQFdvMLy2GlrPwKszsvx8xlhvFK3qfLA=; h=Date:Subject:MIME-Version:Content-Type:From:To; b=kX3KndQ+CDkryplrSESLAkYw9KhawJxpBlyGMmdFiw+JSjiAR3S5QR9MIYiJgCOf9 WWVeJO/wou2jVgWwWcs8OGnNBbriN7YHLnJgZupfKCYidjz0gbFDtlUIp16MFwIKRi 2z1+lrS7QpPytq+cpiVA/c+Dx/ARRMYwYGOP2T3y+/WDQ/fbuJGD754xW/J43ILzl7 gxTBx5oEZNA7S80ElhB6mIN4My52mgUJ7rAWp5U522w5/g7CAf9ya1lBJL4NhTSuiz be8m3zkO3dYli8Qwjxa/l6U2dpdYHevFoEegRPEwf1TQAqkzO4JOxPZkLN+mBa/u0T MVp3T4sE8uN3w== Date: Sun, 9 Jul 2023 14:46:51 +0200 Message-Id: Subject: [BUG] Error in data input and output format for org-columns--summary-estimate MIME-Version: 1.0 X-Sensitivity: 3 Content-Type: multipart/alternative; boundary="_=__=_XaM3_.1688906811.2A.163717.42.13710.52.42.007.1457734623" From: andrea@fedeli.eu To: emacs-orgmode@gnu.org X-XaM3-API-Version: 4.2.87.1 X-TipoRicevuta: completa X-type: 0 X-SenderIP: 188.12.198.247 X-CMAE-Envelope: MS4xfCY3CoIp4rD1VCP7+Hn6GgqzGIf+PSyp5a4yZqjscbGow1MoVx6Nyz3krdXadW+qZPkLC/9Mu9hMnGSU/4X56/9F0f1Altz66G3pAE8Gp0q5Bp/8ToJg Bl+66IOLx8PY/1EyVeYUG5oggS2QmvLBdToZPD7J4aFWE2IuFDSprU97aSZcxLUdxqWapQqhGh6t/g== Received-SPF: pass client-ip=62.149.156.95; envelope-from=andrea@fedeli.eu; helo=smtpcmd0995.aruba.it X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-To: andrea@fedeli.eu 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1688907884; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=aUownJ2vND0JIOV2InnAn4CASwenFbUYzZTla3cc5LI=; b=uFZ7kj9LiHUiVkan9pAHHINzh9eDpjXQjqphpweY4RictEw1iSzp5z/CExDO/jgmhn9F/k 9mkYK/2FOWdy23DsylCar82VvqH1alCvkwP/B1UzzCEZEZSiaQxQ02z4kTCej1x9yLUDtR 3mXZMIqBdz1EIM6wyzaPJ9+kbPK6jnmtQx+iDXIkhC+koEQpjEO8sVVcZOJh8iRXOYDttj Rd3Nrs4AQfusCLP7YN5my5BaKb8VrJ6SqZBSoB20zaFd3RiXGuH+eIdndIt5SmjKofwX07 3L5tHXtyE57wOMsb0l2SUuzEluGqJN8hX+ywog9E3PMgO+01pzrSLrf9Gw5yFQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=aruba.it header.s=a1 header.b=kX3KndQ+; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1688907884; a=rsa-sha256; cv=none; b=BrJchWfJbrqLxnZeMCxyuUHF2gcw989Ha8C/r2LxsLTw046NsEI7DZWL72jBMn1M+1GMbK Spw4cMJ1Bprw6vJ24sRP69vN7SoHxMJoycc4god764oS+SH5IRABpIah7uTUdEG5VgBy67 s9aA8/k8QRCLGSllrRYU6YjSnCKakxouWf4NB3ieTTiCzL41+ME1sTcExQzCmlp10sMMMG wY2wMT2VBQJLCAwM+GTblAH1aJWYHlJEq8p/AJlbd973daT845LHr25umSzUBCqZJp8MzR fXKk6FPIHIJJU2kv7BIK/tVQWK9ixh7Hpuib2yXGx+MMNqES42qJinK9PwKWoA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -5.67 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=aruba.it header.s=a1 header.b=kX3KndQ+; dmarc=none; 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" X-Migadu-Queue-Id: 20C7414A55 X-Spam-Score: -5.67 X-TUID: koyxhCKcNMqA --_=__=_XaM3_.1688906811.2A.163717.42.13710.52.42.007.1457734623 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =0A Howdy!=0A=0A This has been tested to happen with org 9.5.5, a few= of the=0A=0A following, and on the HEAD version on git (9.6.7+); it's = a source=0A=0A matter, afflicting org independently of the running plat= form (GNU/Linux,=0A=0A Windows, etc.)=0A=0A The matter is related to = the fact that org-columns--summary-estimate, from org-colview.el, uses fu= nction string-to-number to take value on ranges; acting this way=0A=0A = the unit is removed making impossible to distinguish between 1y and 1min = . Similarly, on output, the two margins are produced a (format "%.0f" ), which --again-- is generally wrong as it does not tell anything ab= out the utilized time unit.=0A=0A Both issues can be very simply addres= sed by adoption of org-duration-to-minutes as=0A=0A input adapted and o= rg-duration-from-minutes as output adapter.=0A A similar concern affect= s also the simpler case of a single value instead of a range (second pcas= e branch)=0A=0A Here is the patched code with the wrong code lines comm= ented out.=0A=0A (defun org-columns--summary-estimate (estimates _)=0A=0A= "Combine a list of estimates, using mean and variance.=0A=0A The m= ean and variance of the result will be the sum of the means=0A=0A and v= ariances (respectively) of the individual estimates."=0A=0A (let ((me= an 0)=0A=0A (var 0))=0A=0A (dolist (e estimates)=0A=0A = ;; (pcase (mapcar #'string-to-number (split-string e "-"))=0A=0A = (pcase (mapcar #'org-duration-to-minutes (split-string e "-"))=0A=0A= (`(,low ,high)=0A=0A (let ((m (/ (+ low high) 2.0))= )=0A=0A (cl-incf mean m)=0A=0A (cl-incf var (- = (/ (+ (* low low) (* high high)) 2.0) (* m m)))))=0A=0A ;; (`(,v= alue) (cl-incf mean value))))=0A=0A (`(,value) (cl-incf mean (o= rg-duration-to-minutes value)))))=0A=0A (let ((sd (sqrt var)))=0A=0A= (format "%s-%s"=0A=0A ;; (format "%.0f" (- mean s= d))=0A=0A ;; (format "%.0f" (+ mean sd))))))=0A=0A = (org-duration-from-minutes (- mean sd))=0A=0A (o= rg-duration-from-minutes (+ mean sd))))))=0A=0A Cheers!=0A Andrea F= edeli.=0A --_=__=_XaM3_.1688906811.2A.163717.42.13710.52.42.007.1457734623 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Howdy!

This has been tested t= o happen with org 9.5.5, a few of the
following, and on the HEA= D version on git (9.6.7+); it's a source
matter, afflicting org= independently of the running platform (GNU/Linux,
Windows, etc= .)

The matter is related to the fact that org-columns--summary-estimate, from org-colview.el,=C2=A0uses function string-to-n= umber to take value on ranges; acting this way
the unit is remo= ved making impossible to distinguish between 1y and 1min . Similarly, on = output, the two margins are produced a (format "%.0f" <value= >), which --again-- is generally wrong as it does not tell anything ab= out the utilized time unit.

Both issues can be= very simply addressed by adoption of org-duration-to-minutes as
input adapted and org-duration-from-minutes as output adapter.
A similar concern affects also the simpler case of a single value inst= ead of a range (second pcase branch)

Here is t= he patched code with the wrong code lines commented out.

=
(defun org-columns--summary-estimat= e (estimates _)
=C2=A0 "= Combine a list of estimates, using mean and variance.
The mean and variance of the result will be the = sum of the means
and variance= s (respectively) of the individual estimates."
=C2=A0 (let ((mean 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (var 0))
=C2=A0 =C2=A0 (dolist (e estimates)
;;=C2=A0 =C2=A0 =C2=A0 (pcase (mapcar #'stri= ng-to-number (split-string e "-"))
=C2=A0 =C2=A0 =C2=A0 (pcase (mapcar #'org-duration-to-minut= es (split-string e "-"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (`(,low ,high)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((m (/ (+ low = high) 2.0)))
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(cl-incf mean m)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cl-incf var (- (/ (= + (* low low) (* high high)) 2.0) (* m m)))))
;;=C2=A0 =C2=A0 =C2=A0 =C2=A0 (`(,value) (cl-incf mean v= alue))))
=C2=A0 =C2=A0 =C2=A0= =C2=A0 (`(,value) (cl-incf mean (org-duration-to-minutes value)))))
=C2=A0 =C2=A0 (let ((sd (sqrt var= )))
=C2=A0 =C2=A0 =C2=A0 (for= mat "%s-%s"
;;=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "%.0f" (- me= an sd))
;;=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "%.0f" (+ mean sd))))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (org-duration-from-minutes (- mean sd))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (org-duration-from-minutes (+ mean sd))))))

Ch= eers!

=C2=A0 Andrea Fedeli.
--_=__=_XaM3_.1688906811.2A.163717.42.13710.52.42.007.1457734623--