Skip to content
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

Asset API not working #1481

Open
maurerle opened this issue Jul 21, 2022 · 2 comments
Open

Asset API not working #1481

maurerle opened this issue Jul 21, 2022 · 2 comments
Assignees
Labels

Comments

@maurerle
Copy link
Contributor

What I did:

# already running redis on localhost
git clone [email protected]:gridsingularity/gsy-e.git
git clone [email protected]:gridsingularity/gsy-e-sdk.git
conda create -n gsy-e python=3.9
cd gsy-e
pip install -e .
cd ../gsy-e-sdk
pip install -e .

gsy-e -l INFO run -t 15s -s 15m --setup api_setup.default_community --slot-length-realtime 5 --start-date 2021-07-01 --enable-external-connection --paused

# in another terminal
gsy-e-sdk run --setup asset_api_scripts.redis_basic_strategies --run-on-redis

The Asset registers successfully, but when the simulation starts, the market ids are unknown and create a KeyError.

Could you please help me with this error?

@maurerle
Copy link
Contributor Author

I get the following stacktrace in the client-sdk

    self.executor.submit(execute_function_util, function=lambda: self.on_tick(message),
  File "/home/maurer/fh-gitlab/bc4p/gsy/gsy-e-sdk/gsy_e_sdk/setups/asset_api_scripts/redis_basic_strategies.py", line 40, in on_tick
    self.post_bid_offer(rate_index)
  File "/home/maurer/fh-gitlab/bc4p/gsy/gsy-e-sdk/gsy_e_sdk/setups/asset_api_scripts/redis_basic_strategies.py", line 134, in post_bid_offer
    rate = self.asset_strategy[area_uuid]["buy_rates"][rate_index]
KeyError: '35d50a03-214b-432d-a098-21c85afde1b7'

@fievelk
Copy link
Contributor

fievelk commented Jul 21, 2022

Hi @maurerle, thanks a lot for reporting the issue. This is related to the new on_market_slot() alias: since this is not triggered correctly after receiving the corresponding redis event, the self.asset_strategy dictionary is not being populated. I fixed this in gridsingularity/gsy-e-sdk#231, currently in review.

Thanks again for reporting!

@fievelk fievelk added the bug label Jul 21, 2022
@fievelk fievelk self-assigned this Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants