Birdbh / Engicoders

COSC 310 Project
0 stars 0 forks source link

Upgrading Cleanser class to include new cleansing functions based on the changes to sensor object. Specially, the changes from dict values to list values need to be updated to pass tests. #130

Closed Jcp149 closed 7 months ago

Jcp149 commented 7 months ago

fix the cleanser to get the dictionary from the sensor, change it to a list, edit the list, change it back to a dictionary and replace the dictionary in the sensor.

add: remove max and remove min to cleanser

make sure to test the functionality as well

Example code, at the end of the class after setting data = list(self.sensor.get_value().values()):

-data is changed-

for key, new_value in zip(self.sensor.value.keys(), data): self.sensor.value[key] = new_value

a return type isnt necessary as the self.sensor.value is not modified at the end after data is changed

Birdbh commented 7 months ago

This may need to be removed, as discussed in class we may need to also update the sensor get and set methods for the keys and values of the object. Have like date_range and values as two separate fields which are just lists instead of this dictionary