-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My/pay as bid #3
Conversation
Solves olisystems/BEST-Energy#40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works
Requested changes
- mostly update of comments
- adding return values e.g. in python dict type
trusted_worker_port: String, | ||
command_name: String, | ||
params: Vec<String>, | ||
) -> PyResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should return value e.g. the created account
string (which could be put also inside a dictionary) or the matches as Python Dict/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}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the adapted algorithm, I might add some information to the matches returned by simplyr-lib both for pay as bid as well as the cluster-based matching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue #5 can be changed in subsequent PR
This reverts commit 5376d55.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I propose to merge Make Readme more readable #4 first
- https://github.com/BESTenergytrade/integritee-cli-py/pull/3/files#r1302951203 can be changed in subsequent PR
trusted_worker_port: String, | ||
command_name: String, | ||
params: Vec<String>, | ||
) -> PyResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue #5 can be changed in subsequent PR
Make Readme more readable
This will add CLI commands to call the Rust CLI.