GMLC-1-4-2 / battery_interface

Implemenation of Device Models and their Battery Equivalent Interface
MIT License
5 stars 0 forks source link

HVAC robustness to current time and start time inputs #116

Open Hayden-Reeve opened 5 years ago

Hayden-Reeve commented 5 years ago

@ORNLJD (cc: @hlngo , @emayhorn )

Jin, I have updated the unit test file to provide sim_step to the fleet factory (PR #115 ). This allowed me to rerun the HVAC unit test. The results show that HVAC is very brittle to how current and start time is provided. For example, test.py works when a time such as start_time = parser.parse('2017-08-01 00:00:00') is provided.

However, when unit test provides start_time = datetime.utcnow() it crashes as at the line below because the execution can not handle fractional seconds.

https://github.com/GMLC-1-4-2/battery_interface/blob/344f76d1f84e07068dccb0baccdf4ff3c042a3c9/src/fleets/HVAC_fleet/HVAC_fleet.py#L993-L994

This command does not make sense to me as it takes a date parameter, turns it into a string and then turns that string back into a date parameter. When I replace the line with dt = ds it seems to address the problem but a bunch of deprecation issues come up, so it may not be a good fix.

I don't think this is a high-priority for now as the code appears to run with given services, but in the future it is something that should be addressed.