Skip to content

Commit

Permalink
Fixing docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberosa committed Nov 27, 2024
1 parent f1a2c02 commit b55ff80
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 44 deletions.
12 changes: 6 additions & 6 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy",
"contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4",
"skill/valory/market_manager_abci/0.1.0": "bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa",
"skill/valory/decision_maker_abci/0.1.0": "bafybeia2tiuva6vy4oupqzjj4mrq52w4mrmx6omq4bxtzsyoop4u7kpmia",
"skill/valory/trader_abci/0.1.0": "bafybeihwdtmxmlpeqo6avizntt4zs3vlf6vspv2izzdt7f6ag5bd2mjmqi",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeigygiimq35kx75x343p7b7fxc3tl46jnuc5z6wtfr3gq3udl53ug4",
"skill/valory/decision_maker_abci/0.1.0": "bafybeicpxadhd2cjlrxcxchwggwfpror77fidixre7qpai64xy6ql2qywq",
"skill/valory/trader_abci/0.1.0": "bafybeigq5gglv2uaazmsde5mzaocunbmmesk5hfiukxifjpa73orj2qqcq",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiclxdsglzhxndtiocuslnwqgw5zib4b5466ralhzfr3gudyt5sp54",
"skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne",
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini",
"agent/valory/trader/0.1.0": "bafybeifyzsrof7ba2tlfl3xg3kx2h3tlsor3d3q3wxhycotarywwwlyqwa",
"service/valory/trader/0.1.0": "bafybeihycqjdnuxka2n4cwakqrfbrkaz37c6ud4q5iqxu7wye3nckt6nzq",
"service/valory/trader_pearl/0.1.0": "bafybeigtmtwarxbpamhr7zzli6sorjbhl7kfdf6xvfkoiy4yftwmca3yu4"
"agent/valory/trader/0.1.0": "bafybeig7bvt633uj7ssgocan5jhuemp6lk3be4pgmcpjqjhw44yzysj6fi",
"service/valory/trader/0.1.0": "bafybeiaoqmimy4p3cx7s3hcabevfj4tu5vp56renezgzryvbruaqmciizm",
"service/valory/trader_pearl/0.1.0": "bafybeigdqc6l63mk5h2ax6fxlplhp2u2nupebj5ap5mf4lxhxb6dt6dkyq"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
6 changes: 3 additions & 3 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ skills:
- valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba
- valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm
- valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigygiimq35kx75x343p7b7fxc3tl46jnuc5z6wtfr3gq3udl53ug4
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiclxdsglzhxndtiocuslnwqgw5zib4b5466ralhzfr3gudyt5sp54
- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa
- valory/decision_maker_abci:0.1.0:bafybeia2tiuva6vy4oupqzjj4mrq52w4mrmx6omq4bxtzsyoop4u7kpmia
- valory/trader_abci:0.1.0:bafybeihwdtmxmlpeqo6avizntt4zs3vlf6vspv2izzdt7f6ag5bd2mjmqi
- valory/decision_maker_abci:0.1.0:bafybeicpxadhd2cjlrxcxchwggwfpror77fidixre7qpai64xy6ql2qywq
- valory/trader_abci:0.1.0:bafybeigq5gglv2uaazmsde5mzaocunbmmesk5hfiukxifjpa73orj2qqcq
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini
- valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/trader/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq
fingerprint_ignore_patterns: []
agent: valory/trader:0.1.0:bafybeifyzsrof7ba2tlfl3xg3kx2h3tlsor3d3q3wxhycotarywwwlyqwa
agent: valory/trader:0.1.0:bafybeig7bvt633uj7ssgocan5jhuemp6lk3be4pgmcpjqjhw44yzysj6fi
number_of_agents: 4
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/trader_pearl/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e
fingerprint_ignore_patterns: []
agent: valory/trader:0.1.0:bafybeifyzsrof7ba2tlfl3xg3kx2h3tlsor3d3q3wxhycotarywwwlyqwa
agent: valory/trader:0.1.0:bafybeig7bvt633uj7ssgocan5jhuemp6lk3be4pgmcpjqjhw44yzysj6fi
number_of_agents: 1
deployment:
agent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def wei_to_native(wei: int) -> float:
return wei / 10**18

def get_active_sampled_bet(self) -> Bet:
"""Function to get the selected bet that is active without reseting self.bets"""
"""Function to get the selected bet that is active without reseting self.bets."""
bet_index = self.synchronized_data.sampled_bet_index
if len(self.bets) == 0:
msg = "The length of self.bets is 0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ def _update_market_liquidity(self) -> None:
self.shared_state.current_liquidity_prices = (
active_sampled_bet.outcomeTokenMarginalPrices
)
self.shared_state.liquidity_cache[
question_id
] = active_sampled_bet.scaledLiquidityMeasure
self.shared_state.liquidity_cache[question_id] = (
active_sampled_bet.scaledLiquidityMeasure
)

def _calculate_new_liquidity(self, net_bet_amount: int, vote: int) -> LiquidityInfo:
"""Calculate and return the new liquidity information."""
Expand Down Expand Up @@ -354,7 +354,7 @@ def _calculate_new_liquidity(self, net_bet_amount: int, vote: int) -> LiquidityI
def _compute_scaled_liquidity_measure(
self, token_amounts: List[int], token_prices: List[float]
) -> float:
"""Function to compute the scaled liquidity measure from token amounts and prices"""
"""Function to compute the scaled liquidity measure from token amounts and prices."""
precision = 8
token_prices = [round(x, precision) for x in token_prices]
return round(
Expand Down Expand Up @@ -387,11 +387,11 @@ def _update_liquidity_info(self, net_bet_amount: int, vote: int) -> LiquidityInf
self.context.logger.info(log_message)

# update the scaled liquidity Measure
self.shared_state.liquidity_cache[
market_id
] = self._compute_scaled_liquidity_measure(
self.shared_state.current_liquidity_amounts,
self.shared_state.current_liquidity_prices,
self.shared_state.liquidity_cache[market_id] = (
self._compute_scaled_liquidity_measure(
self.shared_state.current_liquidity_amounts,
self.shared_state.current_liquidity_prices,
)
)

return liquidity_info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def setup(self) -> None:
self.context.logger.info(msg)

def initialize_bet_id_row_manager(self) -> Dict[str, List[int]]:
"""Initialization of the dictionary used to traverse mocked tool responses"""
"""Initialization of the dictionary used to traverse mocked tool responses."""
bets_mapping: Dict[str, List[int]] = {}
dataset_filepath = (
self.params.store_path / self.benchmarking_mode.dataset_filename
Expand Down
26 changes: 13 additions & 13 deletions packages/valory/skills/decision_maker_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,17 @@ def _initialize_simulated_now_timestamps(
self.simulated_days = timestamps

def increase_one_day_simulation(self) -> None:
"""Increased the index used for the current simulated day"""
"""Increased the index used for the current simulated day."""
self.simulated_days_idx += 1

def check_benchmarking_finished(self) -> bool:
"""Checks if we simulated already all days"""
"""Checks if we simulated already all days."""
return self.simulated_days_idx >= len(self.simulated_days)

def get_simulated_now_timestamp(
self, bets: List[Bet], safe_voting_range: int
) -> int:
"""Gets the current simulated day timestamp"""
"""Gets the current simulated day timestamp."""
if len(self.simulated_days) == 0:
self._initialize_simulated_now_timestamps(bets, safe_voting_range)

Expand Down Expand Up @@ -455,11 +455,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"tool_punishment_multiplier", kwargs, int
)
self.contract_timeout: float = self._ensure("contract_timeout", kwargs, float)
self.file_hash_to_strategies: Dict[
str, List[str]
] = nested_list_todict_workaround(
kwargs,
"file_hash_to_strategies_json",
self.file_hash_to_strategies: Dict[str, List[str]] = (
nested_list_todict_workaround(
kwargs,
"file_hash_to_strategies_json",
)
)
self.strategies_kwargs: Dict[str, List[Any]] = nested_list_todict_workaround(
kwargs, "strategies_kwargs"
Expand All @@ -471,11 +471,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
)
self.use_nevermined = self._ensure("use_nevermined", kwargs, bool)
self.rpc_sleep_time: int = self._ensure("rpc_sleep_time", kwargs, int)
self.mech_to_subscription_params: Dict[
str, Any
] = nested_list_todict_workaround(
kwargs,
"mech_to_subscription_params",
self.mech_to_subscription_params: Dict[str, Any] = (
nested_list_todict_workaround(
kwargs,
"mech_to_subscription_params",
)
)
self.service_endpoint = self._ensure("service_endpoint", kwargs, str)
self.safe_voting_range = self._ensure("safe_voting_range", kwargs, int)
Expand Down
1 change: 0 additions & 1 deletion packages/valory/skills/decision_maker_abci/rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ class DecisionMakerAbciApp(AbciApp[Event]):
- no majority: 8.
- tie: 9.
- unprofitable: 9.
- benchmarking finished: 21.
- round timeout: 8.
9. BlacklistingRound
- done: 16.
Expand Down
10 changes: 5 additions & 5 deletions packages/valory/skills/decision_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ fingerprint:
README.md: bafybeia367zzdwndvlhw27rvnwodytjo3ms7gbc3q7mhrrjqjgfasnk47i
__init__.py: bafybeih563ujnigeci2ldzh7hakbau6a222vsed7leg3b7lq32vcn3nm4a
behaviours/__init__.py: bafybeih6ddz2ocvm6x6ytvlbcz6oi4snb5ee5xh5h65nq4w2qf7fd7zfky
behaviours/base.py: bafybeiasmuhl5kabt6s6g7dqk6htd4xuoe76sh6hala6dymctpaj6pf3pi
behaviours/base.py: bafybeifjgxzhwzxiky3okgtv4ojumm7fj7bom6qe3ysdvs3cpu32w446g4
behaviours/bet_placement.py: bafybeihmia64t2payxfqcnfdqg675ui2yp3hnyfwb2xhj2hn7wl237b4re
behaviours/blacklisting.py: bafybeifitqx2omj5qdwokizhqjkxvybtsyxo22dxkucbtxaocafzgbseku
behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci
behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e
behaviours/decision_receive.py: bafybeigolpyy4c757faqaltirmh7fn55ue3mnu5f5iamaazbcyyqplh3wq
behaviours/decision_request.py: bafybeid2kelmtdkg2miiqiwmzs4sr7ynopotp3brwuy2rfl42uhlm4zzci
behaviours/decision_receive.py: bafybeifsihork5hdy3klcdz472vefvfnp42yzb7xe6vngl2yd43qxiw4xe
behaviours/decision_request.py: bafybeia22omb7tvocyfe3z2ucn5au5mcas7dg37ha42u7znefzrewjpk7y
behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm
behaviours/order_subscription.py: bafybeicrmdvhci5prfldvuf3bclbbqi6j7lpv6hmphw3qwgmkmwat3od44
behaviours/randomness.py: bafybeiaoj3awyyg2onhpsdsn3dyczs23gr4smuzqcbw3e5ocljwxswjkce
Expand All @@ -32,11 +32,11 @@ fingerprint:
handlers.py: bafybeigod6gbjrxy4mbmulbzsbokeaoycoqys64vqtxnumishfukzf73za
io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq
io_/loader.py: bafybeih3sdsx5dhe4kzhtoafexjgkutsujwqy3zcdrlrkhtdks45bc7exa
models.py: bafybeid5x2ur72wlwsp6uemwcha33d2lqnjxfb3wfghqzi5mjicv7h6uce
models.py: bafybeicina3bk45aeecohj7e3zbtxdvkiomstjf37j64kp3uvzkr7bcfnm
payloads.py: bafybeihzwxhdc6a6ek2lvsyzkex4ypsl7fnahszal3dxtr7ce6wp7nmgmm
policy.py: bafybeihlzs4o5e7yfmfzcvvrzkf4bhxfsg5gxnzsrpepwgfugh45gafye4
redeem_info.py: bafybeifiiix4gihfo4avraxt34sfw35v6dqq45do2drrssei2shbps63mm
rounds.py: bafybeiavzqvft4jvletdu3gnjkx7ugmcolabcw6ovblmu6oye2j4tucaba
rounds.py: bafybeiarrr5ha2upif67zcittotc5lq4t6aodzy77h5birpms7mek3nqpy
states/__init__.py: bafybeid23llnyp6j257dluxmrnztugo5llsrog7kua53hllyktz4dqhqoy
states/base.py: bafybeigrki577lymnkjupahtcswomltcyrwecd632b4tihd2zq6zqk3w2m
states/bet_placement.py: bafybeibalhxhp2c4oljmiwqi6ds3g36fgtabmf42mb5sgq6z22znrcbhda
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/trader_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ skills:
- valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae
- valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm
- valory/market_manager_abci:0.1.0:bafybeicztk62pslofv6ui3aw3giw2tnvlfwfmatqbyvvzv4ampneu6isqa
- valory/decision_maker_abci:0.1.0:bafybeia2tiuva6vy4oupqzjj4mrq52w4mrmx6omq4bxtzsyoop4u7kpmia
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigygiimq35kx75x343p7b7fxc3tl46jnuc5z6wtfr3gq3udl53ug4
- valory/decision_maker_abci:0.1.0:bafybeicpxadhd2cjlrxcxchwggwfpror77fidixre7qpai64xy6ql2qywq
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiclxdsglzhxndtiocuslnwqgw5zib4b5466ralhzfr3gudyt5sp54
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini
- valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protocols:
- valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni
skills:
- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u
- valory/decision_maker_abci:0.1.0:bafybeia2tiuva6vy4oupqzjj4mrq52w4mrmx6omq4bxtzsyoop4u7kpmia
- valory/decision_maker_abci:0.1.0:bafybeicpxadhd2cjlrxcxchwggwfpror77fidixre7qpai64xy6ql2qywq
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm
behaviours:
Expand Down

0 comments on commit b55ff80

Please sign in to comment.