habito icon indicating copy to clipboard operation
habito copied to clipboard

Different types of habits

Open Ben-Baert opened this issue 8 years ago • 2 comments

Currently, the only type of habit is a quantified one that has a certain target that is met if it is either reached or surpassed. There are, however, other possibilities:

  • a target where you want to be as low as possible. For instance, if my goal is to wake up at 6 a.m., waking up at 5.30 a.m. is okay, but waking up at 6.30 a.m. is not.
  • some goals may just require a boolean value, that is, either you did them or you didn't. (Silly) examples include: take the bike rather than the car to work, take off shoes inside,... You can't really quantify these; either you took the bike today or you didn't; either you took off your shoes or you didn't.

This is definitely a non-exhaustive list, and only meant to start a discussion.

Ben-Baert avatar May 23 '16 01:05 Ben-Baert

Good discussion :)

Here's one more:

  • # of meetings/week. It is very difficult to quantify this on a daily basis for tracking.

On Mon, May 23, 2016 at 6:56 AM, Ben Baert [email protected] wrote:

Currently, the only type of habit is a quantified one that has a certain target that is met if it is either reached or surpassed. There are, however, other possibilities:

  • a target where you want to be as low as possible. For instance, if my goal is to wake up at 6 a.m., waking up at 5.30 a.m. is okay, but waking up at 6.30 a.m. is not.
  • some goals may just require a boolean value, that is, either you did them or you didn't. (Silly) examples include: take the bike rather than the car to work, take off shoes inside,... You can't really quantify these; either you took the bike today or you didn't; either you took off your shoes or you didn't.

This is definitely a non-exhaustive list, and only meant to start a discussion.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/codito/habito/issues/9

codito avatar May 23 '16 15:05 codito

Regarding your last point, I think we can generalise it to having more custom frequencies. Examples:

  • every day (probably most common and a sensible default)
  • every week at the end of the week (nr of meetings)
  • every saturday (play tennis on Saturday)
  • every two days (go for a run)
  • every two weeks (go for a long hike)
  • ...

You get the idea

For the habits, we could have the following model:

  • name (str, required)
  • start_date (date, required, default: today)
  • finish_date (date, optional: leave empty for lasting habit, default: None)
  • constant_target (bool, optional, default: True)
  • start_target (float, leave empty for constant target, default: None) This can potentially be set even if there is a constant target to indicate the desired direction, for example with the waking up example, the start_target could be set to 7 a.m. and the finish_target to 6.am. Even if the target is constant, the system can derive that you want to be as low as possible by seeing that the finish_target is lower than the start_target.
  • finish_target (int: leave empty for boolean target, default: None)
  • units (str, leave empty for boolean target, default: None)
  • update target (str: required, default: 'every') Frequency string, see log frequency. This is how often the target is updated, either automatically if update_target_automatically is set to True, or is asked to update if update_target_automatically is set to False.
  • update_target_automatically (bool, optional, default:True)
  • log frequency (tuple, required, default: ('every', 'day', None))
    • tuple:
      • first element: frequency (e.g. 'every', 'every.two')
      • second element: unit (e.g. 'hour', 'day', 'week', 'month')
      • third element (not sure): at (specific time or range) (e.g. '7 p.m.' '7p.m. - 11 p.m.); empty means anytime, range means expect log within that time range

Not entirely related, but also useful would be a config file with date and time format (12h vs. 24h, MM/DD vs DD/MM, etc) and begin and end time of a day (e.g. if you work until after midnight, habits are added to the previous day by default).

Ben-Baert avatar May 23 '16 17:05 Ben-Baert