emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Effort entry and confusing effort estimates
@ 2013-05-21  0:32 Ken Mankoff
  2013-05-21  3:22 ` Ken Mankoff
  0 siblings, 1 reply; 7+ messages in thread
From: Ken Mankoff @ 2013-05-21  0:32 UTC (permalink / raw)
  To: Org-mode

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

Hi,

I'm looking into effort and time tracking and have a few questions about
efforts,

1) What is the difference between C-c C-x C-e and C-c C-x e?

When I set an effort while clocked in, C-c C-x C-e asks for an effort and
formats it in a format I understand such as 00:30 or 1d. When not clocked
in, I have to use C-c C-x e (no CTRL for the last one) and it doesn't seem
to parse my entry for a timestamp or convert from 8h to 1d. For example, I
can enter an effort of "aoeu" and it accepts that.

2) When clocked in and using C-c C-x C-e, the conversion seems buggy:

I enter -> converted to
1d -> 08:00
2d -> 16:00
3d -> 1d 00:00
4d -> 1d 08:00
7d -> 2d 08:00
1w -> 1d 16:00

I get that 1 day is 8 hours, and 2d 8h == 1d 16h, but I'm still confused
why 2d is 16h and 3d is 1d.

Thanks,

   -k.

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

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

* Re: Effort entry and confusing effort estimates
  2013-05-21  0:32 Effort entry and confusing effort estimates Ken Mankoff
@ 2013-05-21  3:22 ` Ken Mankoff
  2013-05-21 10:39   ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Ken Mankoff @ 2013-05-21  3:22 UTC (permalink / raw)
  To: Org-mode

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

Doh. I get the math now. 3d is 3*8h = 1d. Ok. Confusing but I get it.

But I'm still confused what 'org-set-effort' expects/interprets compared to
'org-clock-modify-effort-estimate'. Any clarification will be much
appreciated.

Thanks,

   -k.


On Mon, May 20, 2013 at 8:32 PM, Ken Mankoff <mankoff@gmail.com> wrote:

> Hi,
>
> I'm looking into effort and time tracking and have a few questions about
> efforts,
>
> 1) What is the difference between C-c C-x C-e and C-c C-x e?
>
> When I set an effort while clocked in, C-c C-x C-e asks for an effort and
> formats it in a format I understand such as 00:30 or 1d. When not clocked
> in, I have to use C-c C-x e (no CTRL for the last one) and it doesn't seem
> to parse my entry for a timestamp or convert from 8h to 1d. For example, I
> can enter an effort of "aoeu" and it accepts that.
>
> 2) When clocked in and using C-c C-x C-e, the conversion seems buggy:
>
> I enter -> converted to
> 1d -> 08:00
> 2d -> 16:00
> 3d -> 1d 00:00
> 4d -> 1d 08:00
> 7d -> 2d 08:00
> 1w -> 1d 16:00
>
> I get that 1 day is 8 hours, and 2d 8h == 1d 16h, but I'm still confused
> why 2d is 16h and 3d is 1d.
>
> Thanks,
>
>    -k.
>

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

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

* Re: Effort entry and confusing effort estimates
  2013-05-21  3:22 ` Ken Mankoff
@ 2013-05-21 10:39   ` Bastien
  2013-05-21 11:52     ` Lawrence Mitchell
  2013-05-21 13:10     ` Effort entry and confusing effort estimates Ken Mankoff
  0 siblings, 2 replies; 7+ messages in thread
From: Bastien @ 2013-05-21 10:39 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: Org-mode

Hi Ken,

Ken Mankoff <mankoff@gmail.com> writes:

> But I'm still confused what 'org-set-effort' expects/interprets
> compared to 'org-clock-modify-effort-estimate'. Any clarification
> will be much appreciated.

`org-set-effort' allows you to _set_ the effort value.

`org-clock-modify-effort-estimate' allows you to either set the effort
value (e.g. if you enter 1:30, the old value will be replaced by this
one) or to increment/decrement the effort value by using +mm or
+n[hdwmy] -- e.g. entering +1d will increment the current value by 1
day.  "1 day" is interpreted depending on `org-effort-durations',
which see.

Hope this clarifies,

-- 
 Bastien

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

* Re: Effort entry and confusing effort estimates
  2013-05-21 10:39   ` Bastien
@ 2013-05-21 11:52     ` Lawrence Mitchell
  2013-05-21 12:22       ` Bastien
  2013-05-21 13:10     ` Effort entry and confusing effort estimates Ken Mankoff
  1 sibling, 1 reply; 7+ messages in thread
From: Lawrence Mitchell @ 2013-05-21 11:52 UTC (permalink / raw)
  To: emacs-orgmode

Bastien wrote:
> Hi Ken,

> Ken Mankoff <mankoff@gmail.com> writes:

>> But I'm still confused what 'org-set-effort' expects/interprets
>> compared to 'org-clock-modify-effort-estimate'. Any clarification
>> will be much appreciated.

> `org-set-effort' allows you to _set_ the effort value.

> `org-clock-modify-effort-estimate' allows you to either set the effort
> value (e.g. if you enter 1:30, the old value will be replaced by this
> one) or to increment/decrement the effort value by using +mm or
> +n[hdwmy] -- e.g. entering +1d will increment the current value by 1
> day.  "1 day" is interpreted depending on `org-effort-durations',
> which see.

I think the problem is slightly more complicated.

org-set-effort does:

read some effort duration

(org-entry-put nil "Effort" duration-we-just-read)

org-clock-modify-effort-estimate does:

read some effort duration
(org-duration-string-to-minutes value)
convert this duration in minutes back to a string
(org-minutes-to-clocksum-string minutes-corresponding-to-value)
(org-entry-put nil "Effort" duration-we-just-calculated)

So org-set-effort doesn't do any conversion of the effort string
we enter.

org-clock-modify-effort-estimate does do conversion.  However, it
does it badly.

org-duration-string-to-minutes always uses org-effort-durations
to convert the input string to minutes.  However,
org-minutes-to-clocksum-string /only/ uses org-effort-durations
if org-time-clocksum-use-effort-durations is non-nil (not the
default).

The problem boils down to:

(let ((org-time-clocksum-use-effort-durations nil))
  (= (org-duration-string-to-minutes "3d 2h") ;; what the user entered
     (org-duration-string-to-minutes          ;; what gets inserted
       (org-minutes-to-clocksum-string
         (org-duration-string-to-minutes "3d 2h")))))

=> nil

(let ((org-time-clocksum-use-effort-durations t))
  (= (org-duration-string-to-minutes "3d 2h") ;; what the user entered
     (org-duration-string-to-minutes          ;; what gets inserted
       (org-minutes-to-clocksum-string
         (org-duration-string-to-minutes "3d 2h")))))

=> t

I would argue that

(org-duration-string-to-minutes
  (org-minutes-to-clocksum-string
    (org-duration-string-to-minutes some-value)))

Should be a no-op.  But that is only the case if
org-time-clocksum-use-effort-durations is t.


Lawrence

-- 
Lawrence Mitchell <wence@gmx.li>

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

* Re: Effort entry and confusing effort estimates
  2013-05-21 11:52     ` Lawrence Mitchell
@ 2013-05-21 12:22       ` Bastien
  2013-05-28 11:13         ` [PATCH] Remove org-time-clocksum-use-effort-durations Lawrence Mitchell
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2013-05-21 12:22 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: emacs-orgmode

Hi Lawrence,

Lawrence Mitchell <wence@gmx.li> writes:

> I would argue that
>
> (org-duration-string-to-minutes
>   (org-minutes-to-clocksum-string
>     (org-duration-string-to-minutes some-value)))
>
> Should be a no-op.  But that is only the case if
> org-time-clocksum-use-effort-durations is t.

Agreed.  Thanks for the clear explanations.  Can you provide a patch
to get the correct behavior?  At the time, I could not closely watch
the side-effect of introducing `org-time-clocksum-use-effort-durations'
and this is clearly one of them.

Thanks in advance!

-- 
 Bastien

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

* Re: Effort entry and confusing effort estimates
  2013-05-21 10:39   ` Bastien
  2013-05-21 11:52     ` Lawrence Mitchell
@ 2013-05-21 13:10     ` Ken Mankoff
  1 sibling, 0 replies; 7+ messages in thread
From: Ken Mankoff @ 2013-05-21 13:10 UTC (permalink / raw)
  To: Bastien; +Cc: Org-mode

Hi Bastien,

On Tue, 21 May 2013, Bastien wrote:

> Ken Mankoff <mankoff@gmail.com> writes:
>
>> But I'm still confused what 'org-set-effort' expects/interprets 
>> compared to 'org-clock-modify-effort-estimate'. Any clarification 
>> will be much appreciated.
>
> `org-set-effort' allows you to _set_ the effort value.
>
> `org-clock-modify-effort-estimate' allows you to either set the 
> effort value (e.g. if you enter 1:30, the old value will be 
> replaced by this one) or to increment/decrement the effort value 
> by using +mm or +n[hdwmy] -- e.g. entering +1d will increment the 
> current value by 1 day.  "1 day" is interpreted depending on 
> `org-effort-durations', which see.

Thanks for the explanation. I guess I'm confused why one 
formats/converts/checks the input and the other does not. I guess 
this doesn't imply that org-set-effort does anything different, it 
really is just a pure subset of org-clock-modify-effort-estimate.

Thanks,

   -k.

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

* [PATCH] Remove org-time-clocksum-use-effort-durations
  2013-05-21 12:22       ` Bastien
@ 2013-05-28 11:13         ` Lawrence Mitchell
  0 siblings, 0 replies; 7+ messages in thread
From: Lawrence Mitchell @ 2013-05-28 11:13 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Carsten Dominik

* lisp/org.el (org-time-clocksum-use-effort-durations): Remove
variable.
(org-minutes-to-clocksum-string): Remove references.
* lisp/org-clock.el (org-clocktable-write-default): Remove
references.

We would like the following identity to hold:

    (= (org-duration-string-to-minutes "3d 2h")
       (org-duration-string-to-minutes
         (org-minutes-to-clocksum-string
           (org-duration-string-to-minutes "3d 2h")))))

Previously, this was only true if org-time-clocksum-use-effort-durations
was non-nil (not the default), since org-duration-string-to-minutes
unconditionally looks at org-effort-durations, whereas
org-minutes-to-clocksum-string only considers it if
org-time-clocksum-use-effort-durations is non-nil.  To remove
confusion, since org uses org-effort-durations unconditionally
everywhere else when interpreting duration strings, just remove this
customisation option and use org-effort-durations in
org-minutes-to-clocksum-string as well.
---
 lisp/org-clock.el |  2 --
 lisp/org.el       | 32 ++++++--------------------------
 2 files changed, 6 insertions(+), 28 deletions(-)

Bastien wrote:
> Hi Lawrence,

> Lawrence Mitchell <wence@gmx.li> writes:

>> I would argue that

>> (org-duration-string-to-minutes
>>   (org-minutes-to-clocksum-string
>>     (org-duration-string-to-minutes some-value)))

>> Should be a no-op.  But that is only the case if
>> org-time-clocksum-use-effort-durations is t.

> Agreed.  Thanks for the clear explanations.  Can you provide a patch
> to get the correct behavior?  At the time, I could not closely watch
> the side-effect of introducing `org-time-clocksum-use-effort-durations'
> and this is clearly one of them.

Here we go.  I think the right thing to do is just remove
org-time-clocksum-use-effort-durations completely.  If this is
wanted, I can add the appropriate entry to ORG-NEWS as well.

Lawrence

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 8ac215e..cc6b9c1 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2337,8 +2337,6 @@ from the dynamic block definition."
 	 (maxlevel (or (plist-get params :maxlevel) 3))
 	 (emph (plist-get params :emphasize))
 	 (level-p (plist-get params :level))
-	 (org-time-clocksum-use-effort-durations
-	  (plist-get params :effort-durations))
 	 (timestamp (plist-get params :timestamp))
 	 (properties (plist-get params :properties))
 	 (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
diff --git a/lisp/org.el b/lisp/org.el
index adb5fb1..581536d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2978,20 +2978,6 @@ See `org-time-clocksum-format' for more on time clock formats."
   :version "24.3"
   :type 'boolean)
 
-(defcustom org-time-clocksum-use-effort-durations nil
-  "When non-nil, \\[org-clock-display] uses effort durations.
-E.g. by default, one day is considered to be a 8 hours effort,
-so a task that has been clocked for 16 hours will be displayed
-as during 2 days in the clock display or in the clocktable.
-
-See `org-effort-durations' on how to set effort durations
-and `org-time-clocksum-format' for more on time clock formats."
-  :group 'org-time
-  :group 'org-clock
-  :version "24.4"
-  :package-version '(Org . "8.0")
-  :type 'boolean)
-
 (defcustom org-time-clocksum-fractional-format "%.2f"
   "The format string used when creating CLOCKSUM lines,
 or when Org mode generates a time duration, if
@@ -17521,21 +17507,15 @@ effort string \"2hours\" is equivalent to 120 minutes."
   "Format number of minutes as a clocksum string.
 The format is determined by `org-time-clocksum-format',
 `org-time-clocksum-use-fractional' and
-`org-time-clocksum-fractional-format' and
-`org-time-clocksum-use-effort-durations'."
+`org-time-clocksum-fractional-format'."
   (let ((clocksum "")
 	(m (round m)) ; Don't allow fractions of minutes
 	h d w mo y fmt n)
-    (setq h (if org-time-clocksum-use-effort-durations
-		(cdr (assoc "h" org-effort-durations)) 60)
-	  d (if org-time-clocksum-use-effort-durations
-		(/ (cdr (assoc "d" org-effort-durations)) h) 24)
-	  w (if org-time-clocksum-use-effort-durations
-		(/ (cdr (assoc "w" org-effort-durations)) (* d h)) 7)
-	  mo (if org-time-clocksum-use-effort-durations
-		 (/ (cdr (assoc "m" org-effort-durations)) (* d h)) 30)
-	  y (if org-time-clocksum-use-effort-durations
-		(/ (cdr (assoc "y" org-effort-durations)) (* d h)) 365))
+    (setq h (or (cdr (assoc "h" org-effort-durations)) 60)
+	  d (or (/ (cdr (assoc "d" org-effort-durations)) h) 24)
+	  w (or (/ (cdr (assoc "w" org-effort-durations)) (* d h)) 7)
+	  mo (or (/ (cdr (assoc "m" org-effort-durations)) (* d h)) 30)
+	  y (or (/ (cdr (assoc "y" org-effort-durations)) (* d h)) 365))
     ;; fractional format
     (if org-time-clocksum-use-fractional
 	(cond
-- 
1.8.2-rc3

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

end of thread, other threads:[~2013-05-28 11:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-21  0:32 Effort entry and confusing effort estimates Ken Mankoff
2013-05-21  3:22 ` Ken Mankoff
2013-05-21 10:39   ` Bastien
2013-05-21 11:52     ` Lawrence Mitchell
2013-05-21 12:22       ` Bastien
2013-05-28 11:13         ` [PATCH] Remove org-time-clocksum-use-effort-durations Lawrence Mitchell
2013-05-21 13:10     ` Effort entry and confusing effort estimates Ken Mankoff

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