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
Should return value e.g. the created account string (which could be put also inside a dictionary) or the matches as Python List:
Could be similar to the following example for returning a python List of dictionaries:
// Convert MarketOutput to Python List of Dict representing matches
let pyMatches = PyList::new(py,
matches.matches.into_iter().map(|mtch| {
let dict = PyDict::new(py);
dict.set_item("time", mtch.energy_kwh);
dict.set_item("bid_id", mtch.bid_id);
dict.set_item("ask_id", mtch.ask_id);
dict.set_item("bid_actor", "");
dict.set_item("ask_actor", "");
dict.set_item("bid_cluster", 0);
dict.set_item("ask_cluster", 0);
dict.set_item("energy", mtch.energy_kwh);
dict.set_item("price", mtch.price_euro_per_kwh);
dict.set_item("included_grid_fee", 0);
dict
})
);
As both types are different the account string or the match list could be it self returned within a dictionary with a specific key, i.e. {"account": account_string} or {"matches": pyMatches}
Also Errors should be forwarded, in that turn also commands need to preferably return Error rather than to panic! as these cannot be handled well, e.g. olisystems/BEST-Energy#53
Should return value e.g. the created
account
string (which could be put also inside a dictionary) or the matches as Python List:Could be similar to the following example for returning a python List of dictionaries:
As both types are different the account string or the match list could be it self returned within a dictionary with a specific key, i.e. {"account": account_string} or {"matches": pyMatches}
Originally posted by @j-ti in #3 (comment)
The text was updated successfully, but these errors were encountered: