6 kyu

Data Analysis Following Migration

14 of 101anter69
Description
Loading description...
Date Time
Algorithms
Data Science
View
AllIssues4Questions1SuggestionsShow Resolved
  • Please sign in or sign up to leave a comment.
  • dfhwze Avatar
    • Sample tests don't include a = b edge cases, only a < b.
    • Random tests immediately have large amounts of dates, I would add a bunch of smaller cases for helping users debug their first random tests
    • Description for uncertain is not complete, you should add that cases where there is no valid configuration possible, should also be included here
    • anter69 Avatar
      • added a timestamp to sample tests where a = b
      • updated random tests, so the sample size is slowly getting bigger: random(5-10-15-20-...)
      • updated description of uncertain, although I think invalid configurations are never generated
      Issue marked resolved by anter69 2 years ago
  • RealKenshiro Avatar

    Very clever and interesting Kata. Thanks.

    Small suggestion : replace non-negative duration by start_date <= end_date

  • ejini战神 Avatar

    One of Codewars best timestamp katas no doubt !!! ^^ ~~

  • user9644768 Avatar

    Ruby 3.0 should be enabled, see this to learn how to do it

    Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)

    describe "<This message should describe the categories of test groups inside this block>" do
      it "<A short message describing this test group>" do
        expect(...).to eq(...) #Assertions
        #Or Test.assert_equals(user_response, reference_response)
      end
    end
    
  • Blind4Basics Avatar

    python version does not follow the same requirements than the ruby version (compare my ruby solution and my python one: I forgot to filter some results in python but still passed all the tests)

    • Blind4Basics Avatar

      Note: filtering the results in python, my solution fails all the random tests but not the fixed tests (meaning your fixed tests are not enough ;)

    • anter69 Avatar

      Could you add more details? Your solution passes the random tests... I'm probably not getting something :-/

    • Blind4Basics Avatar

      This comment has been hidden.

    • Blind4Basics Avatar

      see upper, plz

    • Blind4Basics Avatar

      ok, I just tried both your python and ruby code and the python one is faulty:

      Using this input:

      [["2008-05-20", "2008-07-05"],    correct
       ["2014-11-10", "2014-12-13"],    unsure
       ["1999-09-09", "1999-10-16"],    correct
       ["2002-09-28", "2002-10-09"],    correct
       ["2017-05-06", "2017-05-06"],    unsure
       ["2013-06-06", "2013-06-26"],    correct
       ["2017-08-24", "2017-10-05"],    correct
       ["2005-07-23", "2005-08-17"]]    correct     
      

      In ruby, your code expects [6,0,2] while it outputs [4,0,4] in python. The problems are about those two dates: "1999-09-09" and "2013-06-06" (at least that's where the differences in my aglos showed up)

    • anter69 Avatar

      This comment has been hidden.

      Issue marked resolved by anter69 6 years ago
  • Blind4Basics Avatar

    ok, now that I saw the tests...

    • you really need to clarify your meaning about the "wrong/uncertain" thing
    • you need to put more SHORT fixed tests (especially when there are only 2 fixed tests, one of them being an empty array... meaning you actually have only 1 single fixed test. That's a pretty bad design for a kata, imo). Nobody want's to debug an unclear logic with arrays of 40-60 pairs of dates... :/
    • Voile Avatar

      +1 ;-)

    • Blind4Basics Avatar

      btw, you didn't tell if starting date == finishind date should be considered valid or not.

    • Voile Avatar

      Judging from my result vs the expected result it seems that it is considered valid when starting date <= finished date.

    • Blind4Basics Avatar

      that would look reasonnable, yes.

    • anter69 Avatar

      you didn't tell if starting date == finishind date should be considered valid or not.

      The description explicitly says:

      the original records always defined a non-negative duration.

    • anter69 Avatar

      Unpublished temporarily for review. Thanks for the feedback so far.

    • anter69 Avatar
      • issue #1: still only 1 fixed test (taken from the example), but random tests now generate shorter tests (at least the first few), that should be easy enough to debug. If you feel more is needed, complain here ;-)
      • issue #2: start date <= finish date, as highlighted in the description.
      Issue marked resolved by anter69 6 years ago
  • Blind4Basics Avatar
    ["2002-02-07", "2002-12-10"]  -->  uncertain   # both dates are ambiguous, and there are
                                                   # multiple possible valid original versions
    ["2009-08-01", "2009-04-06"]  -->  wrong       # wrong and cannot be corrected, because
                                                   # there are multiple possible valid versions
    

    the distinction between those two seems at least very unclear to me, if not wrong:

    1) 02/07 or 07/02 and 12/10 or 10/12.
       All combinations are valid, so uncretain, perfect.
    
    2) 01/08 or 08/01 and 06/04 or 04/06.
       Any combination with 08/01 (as mm/dd) is incorrect, but the 2 combinations with 01/08 are possible.
       So why should it be considered wrong instead of uncertain??
    
    • anter69 Avatar

      Because in it's current form it's wrong, and as there are multiple valid combinations, there is no way to fix it.

      Maybe I should add those to the "uncertain" lot? I'm a bit uncertain ;-)

    • anter69 Avatar

      Simplified the choices to "correct", "recoverable", "uncertain". Also added more details about these categories.

      Question marked resolved by anter69 6 years ago
    • Blind4Basics Avatar

      I didn't see this message, one month ago, sorry. Your last changes seems good to me.

    • anter69 Avatar

      The message is from today, so you couldn't see it a month ago :-)

    • Blind4Basics Avatar

      na, not your last one, the one just above. ;)

  • Blind4Basics Avatar

    python version on its way? x)