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
proposal: time: add Epiweek #42002
Comments
This seems easy to write in a third party package. See https://golang.org/doc/faq#x_in_std. |
Implementation wise, it's identical to ISOWeek, and that is in the standard package. The only difference is you pivot on Wednesday instead of Thursday. Access to the private
|
Seems like an external package could use My point is that since this can be written in an external package, we need to justify adding it to the standard library. What is that justification? Ease of implementation is not a justification; new API requires building and testing and maintenance and requires people reading the package to read and understand the functionality. It's not free. Of course we should do it if it's important, but why is |
Points are well put. Epiweeks is an epidemiological week. It is often used for counting weeks and for forecasting flu outbreaks across the country. The question I would ask is, why was it considered important to add ISOWeek to the time package? If they're the same thing with a different starting day of the week, why wouldn't they be in the same package? |
Because ISO weeks are widely used. I don't know how widely used Epiweeks are. If they are only used by epidemiologists, then I'm not sure that they are widely used. For example, there is a Wikipedia entry for ISO weeks (https://en.wikipedia.org/wiki/ISO_week_date) but as far as I can tell there is not one for Epiweeks. |
I wish the US epidemiologist used ISO weeks, it would make all of our lives easier. Epiweeks are mostly used in data science work, and you see support for this variation of week counting in languages such as R and Python. https://rdrr.io/cran/lubridate/man/week.html https://epiweeks.readthedocs.io/ https://www.cdc.gov/epiinfo/user-guide/check-code/epiweekfunctions.html |
The Python example is a third party package. The same could be done for Go. |
I implemented this as a third party package. |
I'd like to propose adding epiweek to the time package.
An epiweek is almost identical to an ISO Week. The only difference is that an epiweek begins on Sunday and an ISO Week begins on Monday.
Adding this functionality should be trivial and would be beneficial for certain branches of work.
The text was updated successfully, but these errors were encountered: