Handling leap years

Open
#494 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by tracing the baseline-year projection and the capacity conversion mentioned in the issue, then identify where sampling maps activity across calendar years. Resolve which leap-day policy the project wants before making changes. Done means the selected policy is implemented and the leap-year and non-leap-year cases are covered by tests.

Written by the indexing model from the issue text.

Description

Currently, we take a baseline year and project it forwards.

We do not currently handle leap years. Using a baseline of 2023/24 would include activity for 29th Feb 2024. If we project forward to a non-leap year then we will be including 1 extra day of activity.

Likewise, if we start with a baseline year that isn't a leap year but project to a leap year we will be short 1 day of activity.

There are a couple of approaches to this that spring to mind:

  1. ignore it as a small issue that wouldn't have enough of an impact to worry about
  2. we could add a correction factor based on the start/end years to sampling by $1\pm \tfrac{1}{365}$
  3. we could assume a year of 365 days by dropping 29th Feb and make this a clear assumption (e.g. with capacity conversion to always have a year with 365 days)
Dominant language
Python
Stars
18
Forks
3
Avg merge
21h 39m
Merged PRs (30d)
10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from The-Strategy-Unit/nhp_model

All issues in The-Strategy-Unit/nhp_model

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.