Update add/modify/remove sim methods to use safe version
PR #95 adds in new safe methods for adding/modifying/removing hive entities from the simulation state. Now, we need to go through and update the usage of the old methods to use these new safe methods internally.
For example, in https://github.com/NREL/hive/blob/19f07ead124fa1cc518ef3c04ca9314ccfd1e41c/hive/state/vehicle_state/dispatch_trip.py#L78 we could update this to use the safe method modify_request_safe().
i'd like to couple with this a performance benchmark, to make sure the overhead of switching to ResultE is insignificant.
edit: and yes i would also like this!
i'd like to couple with this a performance benchmark, to make sure the overhead of switching to ResultE is insignificant.
yes, that's a great point; this would be great to have but not if it comes at a high performance cost.
I just did a quick test of this, comparing a method that returns the old ErrorOr type to a function that returns the ResultE type (and unwraps the result). The performance cost for this is ~1 microsecond. This seems like an okay tradeoff in performance relative to what we gain in ergonomics.