beyarkay / eskom-calendar

Get your loadshedding schedule in your calendar and never be left in the dark! Open-source, up-to-date, and developer friendly.
https://eskomcalendar.co.za
GNU General Public License v3.0
190 stars 35 forks source link

Add Mangaung & NMB areas #454

Open IamC8 opened 1 year ago

IamC8 commented 1 year ago

Ok, I have started over again. Understand GitHub better now. These are the proposed changes

beyarkay commented 1 year ago

Hi there, I need to know the source of your information for the changed areas as previously mentioned. I see you said this URL was for mangaung:

But please also provide a URL for NMB.

IamC8 commented 1 year ago

NMB: https://www.nelsonmandelabay.gov.za/page/loadshedding https://www.nelsonmandelabay.gov.za/documentslist?searchtext=&categoryid=58 https://www.nelsonmandelabay.gov.za/DataRepository/Documents/loadshedding-res-industr-5june23-3sept23_oM4s3.pdf

beyarkay commented 10 months ago

Hi there, apologies for the long delay, I had to focus on some personal things for a while.

For the Mangaung changes, all looks good. I'm happy to merge them in, although there are some issues with the NMB schedules (see below). If you open up a new PR with just the Mangaung changes then I'll merge that PR. Thanks!

The NMB schedules are no longer up-to-date because NMB has updated their schedules (the latest one looks like it covers 4 September 2023 - 3 December 2023).

It's not feasible for me to re-calculate the schedules every couple of months, so a NMB schedule would have to be resilient to this sort of change. The main codebase supports a different format for the CSVs which could help with this. Instead of specifying the date of the month, you can specify a periodic schedule that has an arbitrary start and arbitrary repetition frequency.

For example, to specify a schedule that repeats every 19 days and started on the 15th September 2023:

nelson-mandela-bay-group-1.csv

day_of_cycle, period_of_cycle, start_of_cycle, start_time, finsh_time, stage
           1,              19, 2023-09-15    , 00:00     , 02:30     ,     1
           1,              19, 2023-09-15    , 00:00     , 02:30     ,     2
           1,              19, 2023-09-15    , 00:00     , 02:30     ,     3
           1,              19, 2023-09-15    , 18:00     , 20:30     ,     3
           1,              19, 2023-09-15    , 00:00     , 02:30     ,     4
           1,              19, 2023-09-15    , 08:00     , 10:30     ,     4
           1,              19, 2023-09-15    , 18:00     , 20:30     ,     4

(whitespace added for clarity)

As per the updated schedule for NMB:

Screenshot 2023-09-21 at 12 12 01

If the NMB schedules are specified in this way, I think they won't need to be updated every 3 months because the new schedules announced by NMB would match the ones predicted by the periodic schedule.