clima
clima copied to clipboard
Code sanitisation
This is the issue that our team has discussed with you in one of the previous pull request. I want to create this to formalise the task.
I noticed that the code contained repetition of raw string such as df['hour'], df['minute']. These repetitions can cause run-time errors(i.e. errors that are not caught during "compile" time, but only when the user interact with the UI) if someone accidentally mispell a string (e.g. "hours" instead of "hour").
A solution I learned at the workplace is putting these raw strings into variables. hour = "hour", minute ="minute". Putting these variable in classes if necessary. This will avoid repeting raw string, as well as allowing IDE suggestions