You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this Repo is still active, but there is a small issue.
When the stage is set to anything greater than 4, then the areas returned is not correct...
This is manifested in a number of functions, but the root of the issue can be attributed to
getAreaCodesByTimeSlot(stage, day, timeSlot)
I'm not sure if my fix for this is appropriate, but after some debugging I simply added the following to the function:
after this line: let areaCodeAcc = this._getAreaCodeAccumulationDayStart(stage, day) + timeSlot;
added:
if(stage > 4) {
areaCodeAcc ++
}
Technically I did not do this in Java, as my requirement was to have similar functionality in python. Instead, I created a similar set of functions in a Python file. At first I thought I made a mistake in my code, but testing the Javascript rendered the same error.
Please feel free to add it to your repo if you want to. The files are attached.
Thank you for this... Would have taken me days to create the base logic you did, and I HATED the idea of using a lookup table! loadsheddingschedule-py.zip
The text was updated successfully, but these errors were encountered:
Hey, sorry for the very late reply. I wasn't watching my own repo haha.
I see that inside _getAreaCodeAccumulationDayStart, there's also a statement checking stage 4. I can't remember what that's about (I forget old code easily) so not sure I'll get around to maintaining this repo currently (anyone is welcome to fork).
I'm quite busy I'm afraid and have moved to an area that can't use these tables - Eskom supplied 😔 .
I probably didn't test > stage 4 much as I was hoping we wouldn't need them, but wrong data is worse than no data, so I'm sorry if that cause a headache.
I'm glad you found the solution though and it's good that it can serve as a starting point in your own project at least. That's why I even bothered to put it in a repo 👍
Not sure if this Repo is still active, but there is a small issue.
When the stage is set to anything greater than 4, then the areas returned is not correct...
This is manifested in a number of functions, but the root of the issue can be attributed to
getAreaCodesByTimeSlot(stage, day, timeSlot)
I'm not sure if my fix for this is appropriate, but after some debugging I simply added the following to the function:
after this line:
let areaCodeAcc = this._getAreaCodeAccumulationDayStart(stage, day) + timeSlot;
added:
Technically I did not do this in Java, as my requirement was to have similar functionality in python. Instead, I created a similar set of functions in a Python file. At first I thought I made a mistake in my code, but testing the Javascript rendered the same error.
Please feel free to add it to your repo if you want to. The files are attached.
Thank you for this... Would have taken me days to create the base logic you did, and I HATED the idea of using a lookup table!
loadsheddingschedule-py.zip
The text was updated successfully, but these errors were encountered: