emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-columns--summary-mean-time [BUG]
@ 2023-10-14 18:44 Sławomir Grochowski
  2023-10-14 18:51 ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Sławomir Grochowski @ 2023-10-14 18:44 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 383 bytes --]

Dear All,

I'm not sure if this is a bug or I need to change something?

(org-columns--summary-mean-time '("17:00" "18:00") nil) ;=> "17:30" ; ok
(org-columns--summary-mean-time '("22:00" "02:00") nil) ;=> "12:00" ;
should be 00:00
(org-columns--summary-mean-time '("22:00" "03:00") nil) ;=> "12:30" ;
should be 00:30

What do you think?

Regards,
Sławomir Grochowski

[-- Attachment #2: Type: text/html, Size: 632 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-columns--summary-mean-time [BUG]
  2023-10-14 18:44 org-columns--summary-mean-time [BUG] Sławomir Grochowski
@ 2023-10-14 18:51 ` Ihor Radchenko
  2023-10-14 19:07   ` Sławomir Grochowski
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2023-10-14 18:51 UTC (permalink / raw)
  To: Sławomir Grochowski; +Cc: emacs-orgmode

Sławomir Grochowski <slawomir.grochowski@gmail.com> writes:

> I'm not sure if this is a bug or I need to change something?
>
> (org-columns--summary-mean-time '("17:00" "18:00") nil) ;=> "17:30" ; ok
> (org-columns--summary-mean-time '("22:00" "02:00") nil) ;=> "12:00" ;
> should be 00:00
> (org-columns--summary-mean-time '("22:00" "03:00") nil) ;=> "12:30" ;
> should be 00:30

The function computes mean duration. I see nothing wrong.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-columns--summary-mean-time [BUG]
  2023-10-14 18:51 ` Ihor Radchenko
@ 2023-10-14 19:07   ` Sławomir Grochowski
  2023-10-14 19:21     ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Sławomir Grochowski @ 2023-10-14 19:07 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

In ex. I want to have an average time when I go to bed.
So on Monday I went to bed at 22:00 and on Tuesday at 02:00.
So the average time would be midnight 00:00.
But it returns 12:00 which is noon.





On Sat, Oct 14, 2023 at 8:50 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Sławomir Grochowski <slawomir.grochowski@gmail.com> writes:
>
> > I'm not sure if this is a bug or I need to change something?
> >
> > (org-columns--summary-mean-time '("17:00" "18:00") nil) ;=> "17:30" ; ok
> > (org-columns--summary-mean-time '("22:00" "02:00") nil) ;=> "12:00" ;
> > should be 00:00
> > (org-columns--summary-mean-time '("22:00" "03:00") nil) ;=> "12:30" ;
> > should be 00:30
>
> The function computes mean duration. I see nothing wrong.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 1856 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-columns--summary-mean-time [BUG]
  2023-10-14 19:07   ` Sławomir Grochowski
@ 2023-10-14 19:21     ` Ihor Radchenko
  2023-10-14 19:29       ` Sławomir Grochowski
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2023-10-14 19:21 UTC (permalink / raw)
  To: Sławomir Grochowski; +Cc: emacs-orgmode

Sławomir Grochowski <slawomir.grochowski@gmail.com> writes:

> In ex. I want to have an average time when I go to bed.
> So on Monday I went to bed at 22:00 and on Tuesday at 02:00.
> So the average time would be midnight 00:00.
> But it returns 12:00 which is noon.

As I said, it is because it does not calculate an average time of the
day, but an average duration:

     ‘@mean’    Arithmetic mean of ages (in days/hours/mins/seconds).

You can customize `org-columns-summary-types' to have a column summary
you need for your purposes.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-columns--summary-mean-time [BUG]
  2023-10-14 19:21     ` Ihor Radchenko
@ 2023-10-14 19:29       ` Sławomir Grochowski
  2023-10-14 19:40         ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Sławomir Grochowski @ 2023-10-14 19:29 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

But I'm talking about:
(":mean" . org-columns--summary-mean-time)
not  ("@mean" . org-columns--summary-mean-age).

So this is the right function (":mean" . org-columns--summary-mean-time)?
Or do I need to write a new one?

On Sat, Oct 14, 2023 at 9:19 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Sławomir Grochowski <slawomir.grochowski@gmail.com> writes:
>
> > In ex. I want to have an average time when I go to bed.
> > So on Monday I went to bed at 22:00 and on Tuesday at 02:00.
> > So the average time would be midnight 00:00.
> > But it returns 12:00 which is noon.
>
> As I said, it is because it does not calculate an average time of the
> day, but an average duration:
>
>      ‘@mean’    Arithmetic mean of ages (in days/hours/mins/seconds).
>
> You can customize `org-columns-summary-types' to have a column summary
> you need for your purposes.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 1885 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-columns--summary-mean-time [BUG]
  2023-10-14 19:29       ` Sławomir Grochowski
@ 2023-10-14 19:40         ` Ihor Radchenko
  2023-10-14 20:05           ` Sławomir Grochowski
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2023-10-14 19:40 UTC (permalink / raw)
  To: Sławomir Grochowski; +Cc: emacs-orgmode

Sławomir Grochowski <slawomir.grochowski@gmail.com> writes:

> But I'm talking about:
> (":mean" . org-columns--summary-mean-time)
> not  ("@mean" . org-columns--summary-mean-age).
>
> So this is the right function (":mean" . org-columns--summary-mean-time)?
> Or do I need to write a new one?

I think you still need to write a new one.

@mean works on (1) timestamps; (2) durations, while :mean works only on
durations.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-columns--summary-mean-time [BUG]
  2023-10-14 19:40         ` Ihor Radchenko
@ 2023-10-14 20:05           ` Sławomir Grochowski
  0 siblings, 0 replies; 7+ messages in thread
From: Sławomir Grochowski @ 2023-10-14 20:05 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

Now I get it. Thank you for explanation.


On Sat, Oct 14, 2023 at 9:39 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Sławomir Grochowski <slawomir.grochowski@gmail.com> writes:
>
> > But I'm talking about:
> > (":mean" . org-columns--summary-mean-time)
> > not  ("@mean" . org-columns--summary-mean-age).
> >
> > So this is the right function (":mean" . org-columns--summary-mean-time)?
> > Or do I need to write a new one?
>
> I think you still need to write a new one.
>
> @mean works on (1) timestamps; (2) durations, while :mean works only on
> durations.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 1543 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-10-14 20:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-14 18:44 org-columns--summary-mean-time [BUG] Sławomir Grochowski
2023-10-14 18:51 ` Ihor Radchenko
2023-10-14 19:07   ` Sławomir Grochowski
2023-10-14 19:21     ` Ihor Radchenko
2023-10-14 19:29       ` Sławomir Grochowski
2023-10-14 19:40         ` Ihor Radchenko
2023-10-14 20:05           ` Sławomir Grochowski

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).