Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hledger-smooth runtime issues #1171

Closed
bbarker opened this issue Jan 8, 2020 · 1 comment
Closed

hledger-smooth runtime issues #1171

bbarker opened this issue Jan 8, 2020 · 1 comment
Labels

Comments

@bbarker
Copy link

@bbarker bbarker commented Jan 8, 2020

Hello,

Having a few issues with hledger-smooth (using LTS 14.20):

$ ./hledger-smooth.hs -f timekeeping.journal Misc                                
2020/01/05 Looking into Promise interfaces slightly.                                                                          
    Metajelo           0.5 h                                                                                                  
    Billed            -0.5 h                                                                                                  
                                                                                                                              
2020/01/05                                                                                                                    
    Dairy Streaming           0.2 h                                                                                           
    Billed                   -0.2 h                                                                                           
                                                                                                                              
2020/01/06 Hallway discussions. Weekly Consultants' meeting.                                                                  
    Unbilled          -1.5 h                                                                                                  
                                                                                                                              
2020/01/06 Timekeeping (using new timekeeping system).                                                                        
hledger-smooth.hs: Data.Text.Internal.Fusion.Common.head: Empty stream                                                        
CallStack (from HasCallStack):                                                                                                
  error, called at libraries/text/Data/Text/Internal/Fusion/Common.hs:943:24 in text-1.2.3.1:Data.Text.Internal.Fusion.Common
                                  

Also:

$ ./hledger-smooth.hs -f timekeeping.journal Billed                              
2020/01/05 Looking into Promise interfaces slightly.                                                                          
hledger-smooth.hs: splitPosting got wrong date, should not happen   
  • a minimal reproducible example
; journal created 2020-01-06 by hledger

2020/01/06 Hallway discussions. Weekly Consultants' meeting.
    Misc               1.5 h
    Unbilled          -1.5 h


2020/01/06 Timekeeping (using new timekeeping system).
    Misc               1.5 h
    Unbilled          -1.5 h

2020/01/06 Discussions with Pete regarding XCI containers.
    XSEDE XCI               1 h
    Billed                 -1 h

2020/01/05 Looking into Promise interfaces slightly.
    Metajelo             0.5 h
    Billed              -0.5 h

2020/01/05
    Dairy Streaming             0.2 h
    Billed                     -0.2 h

2020/01/06 Working on dev environment slightly
    Dairy Streaming               1 h
    Billed                       -1 h

2020/01/06 Working on dev environment slightly
    Metajelo               1 h
    Billed                -1 h

2020/01/07 Minor wiki edits.
    Misc                 0.5 h
    Unbilled            -0.5 h

2020/01/07
    Dairy Streaming               1 h
    Billed                       -1 h

2020/01/07
    Metajelo               2 h
    Billed                -2 h

2020/01/07 Working on environmental configuration.
    Douglas               2 h
    Billed               -2 h

2020/01/07 Luncheon with arXiv team in Collegetown. ; Meeting
    Misc                    2 h
    Unbilled               -2 h

2020/01/08 Dealing with some apt issues during system updates.
    Misc                   2
    Unbilled              -2

  • your hledger version
    0.15.2
  • how you installed it
    via nix
  • what platform you're on.
    NixOS
@simonmichael

This comment has been minimized.

Copy link
Owner

@simonmichael simonmichael commented Jan 23, 2020

I've updated this for latest hledger and fixed the first issue. The second issue goes away if I sort the entries by date (using hledger print); I've added a note and warning about this.

It seems this is just an unfinished prototype; I've added a note to clarify this. Eg, experimenting with your second example, here are the diffs between hledger print and hledger smooth Billed, which seem not yet useful:

 2020-01-05 Looking into Promise interfaces slightly.
     Metajelo           0.5 h
-    Billed            -0.5 h
 
 2020-01-05
     Dairy Streaming           0.2 h
-    Billed                   -0.2 h
+    Billed               ; date:: 2020-01-05
 
 2020-01-06 Hallway discussions. Weekly Consultants' meeting.
     Misc               1.5 h
     Unbilled          -1.5 h
 
 2020-01-06 Timekeeping (using new timekeeping system).
     Misc               1.5 h
     Unbilled          -1.5 h
 
 2020-01-06 Discussions with Pete regarding XCI containers.
     XSEDE XCI           1.0 h
-    Billed             -1.0 h
 
 2020-01-06 Working on dev environment slightly
     Dairy Streaming           1.0 h
-    Billed                   -1.0 h
 
 2020-01-06 Working on dev environment slightly
     Metajelo           1.0 h
-    Billed            -1.0 h
+    Billed        ; date:: 2020-01-06
 
 2020-01-07 Minor wiki edits.
     Misc               0.5 h
     Unbilled          -0.5 h
 
 2020-01-07
     Dairy Streaming           1.0 h
-    Billed                   -1.0 h
 
 2020-01-07
     Metajelo           2.0 h
-    Billed            -2.0 h
 
 2020-01-07 Working on environmental configuration.
     Douglas           2.0 h
-    Billed           -2.0 h
+    Billed           -0.1 h  ; date:: 2020-01-07
+    Billed           -0.1 h  ; date:: 2020-01-08
+    Billed           -0.1 h  ; date:: 2020-01-09
+    Billed           -0.1 h  ; date:: 2020-01-10
+    Billed           -0.1 h  ; date:: 2020-01-11
+    Billed           -0.1 h  ; date:: 2020-01-12
+    Billed           -0.1 h  ; date:: 2020-01-13
+    Billed           -0.1 h  ; date:: 2020-01-14
+    Billed           -0.1 h  ; date:: 2020-01-15
+    Billed           -0.1 h  ; date:: 2020-01-16
+    Billed           -0.1 h  ; date:: 2020-01-17
+    Billed           -0.1 h  ; date:: 2020-01-18
+    Billed           -0.1 h  ; date:: 2020-01-19
+    Billed           -0.1 h  ; date:: 2020-01-20
+    Billed           -0.1 h  ; date:: 2020-01-21
+    Billed       ; date:: 2020-01-22
 
 2020-01-07 Luncheon with arXiv team in Collegetown.  ; Meeting
     Misc               2.0 h
     Unbilled          -2.0 h
 
 2020-01-08 Dealing with some apt issues during system updates.
     Misc                   2
     Unbilled              -2
 

It seems to be trying to replace the most recent matched posting with daily postings up to today. Note if the display precision is low the amounts may not be equal. Also note the commodity symbol is missing in your example journal's last entry.

Thanks for looking at this. If you'd like to improve it, patches will be welcome.

simonmichael added a commit that referenced this issue Jan 23, 2020
[ci skip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.