-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use latest PMAT release (0.49.1) #491
Conversation
WalkthroughThe pull request introduces changes primarily in two files: Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
prediction_market_agent/agents/think_thoroughly_agent/think_thoroughly_agent.py (1)
290-292
: Approve the change and suggest a minor improvementThe replacement of
add_utc_timezone_validator
withconvert_to_utc_datetime
for handling thecreated_time
is consistent with the previous change and aligns with the PR objective.Consider improving readability by extracting the calculation into a separate variable:
- n_market_open_days = ( - (utcnow() - convert_to_utc_datetime(created_time)).days - if created_time - else "Unknown" - ) + n_market_open_days = "Unknown" + if created_time: + utc_created_time = convert_to_utc_datetime(created_time) + n_market_open_days = (utcnow() - utc_created_time).daysThis change would make the code easier to read and maintain, especially if the calculation becomes more complex in the future.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (2)
poetry.lock
is excluded by!**/*.lock
,!**/*.lock
pyproject.toml
is excluded by!**/*.toml
📒 Files selected for processing (2)
- prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py (3 hunks)
- prediction_market_agent/agents/think_thoroughly_agent/think_thoroughly_agent.py (2 hunks)
🔇 Additional comments (4)
prediction_market_agent/agents/think_thoroughly_agent/think_thoroughly_agent.py (1)
287-292
: Summary of changes ingenerate_final_decision
methodThe changes in this file are focused on updating the datetime conversion function from
add_utc_timezone_validator
toconvert_to_utc_datetime
. This update is applied consistently to both theevent_date
andcreated_time
calculations. These modifications align with the PR objective of using the latest PMAT release (0.49.1).The changes appear to be straightforward and don't introduce any new logic or alter the overall functionality of the method. However, it's important to ensure that the new
convert_to_utc_datetime
function behaves identically to the previousadd_utc_timezone_validator
function in all scenarios to avoid any potential regressions.To ensure the changes don't introduce any unintended side effects, please consider the following:
- Verify that the
convert_to_utc_datetime
function handles all edge cases thatadd_utc_timezone_validator
did.- Run the existing test suite to confirm that no regressions have been introduced.
- If possible, add new unit tests specifically for the
generate_final_decision
method to cover various scenarios ofevent_date
andcreated_time
inputs.prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py (3)
23-23
: Updated import statement to reflect renamed constantThe constant
OMEN_DEFAULT_MARKET_FEE
has been renamed toOMEN_DEFAULT_MARKET_FEE_PERC
, and the import statement has been updated accordingly.
Line range hint
162-173
: Updated function call to use 'fee_perc' parameterThe
omen_create_market_tx
function call now uses thefee_perc
parameter instead offee
, which aligns with the updated function signature.
174-176
: Verify the correct attribute access for 'market_address'Ensure that
created_market.market_event.fixedProductMarketMaker
correctly accesses the market address. Confirm thatfixedProductMarketMaker
is the appropriate attribute withinmarket_event
to retrieve the market address.Run the following script to verify the attribute access:
prediction_market_agent/agents/think_thoroughly_agent/think_thoroughly_agent.py
Show resolved
Hide resolved
prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py
Outdated
Show resolved
Hide resolved
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py (1)
23-23
: Approve constant renaming with a minor suggestion.The renaming of
OMEN_DEFAULT_MARKET_FEE
toOMEN_DEFAULT_MARKET_FEE_PERC
improves clarity by explicitly indicating it's a percentage. This change aligns well with the function parameter update mentioned in the AI-generated summary.Consider adding a comment above the constant to specify the unit (e.g., basis points or percentage) for even better clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py (3 hunks)
🔇 Additional comments (1)
prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py (1)
Line range hint
162-176
: Approve changes in market creation and address retrieval.The updates to the
omen_create_market_tx
function call and the new method of obtaining themarket_address
are improvements:
- The
fee
parameter has been renamed tofee_perc
, which aligns with the constant renaming and improves clarity.- The
market_address
is now directly derived from thecreated_market
object, addressing the past review comment and providing a more straightforward approach.To ensure the changes are consistent throughout the codebase, please run the following script:
✅ Verification successful
Please find the updated verification scripts below to ensure proper analysis:
[/run_scripts]
Verified: Changes to market creation and address retrieval are correct.
- No instances of
OMEN_DEFAULT_MARKET_FEE
remain.- All calls to
omen_create_market_tx
utilizefee_perc
as intended.- The usage of
ChecksumAddress
in the reviewed lines has been correctly updated.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of OMEN_DEFAULT_MARKET_FEE_PERC and fee_perc parameter # Test 1: Check for any remaining instances of OMEN_DEFAULT_MARKET_FEE echo "Checking for any remaining instances of OMEN_DEFAULT_MARKET_FEE:" rg "OMEN_DEFAULT_MARKET_FEE[^_]" --type python # Test 2: Verify that all calls to omen_create_market_tx use fee_perc echo "Verifying calls to omen_create_market_tx use fee_perc:" rg "omen_create_market_tx\s*\([^)]*fee(_perc)?\s*=" --type python # Test 3: Check for any remaining uses of ChecksumAddress constructor echo "Checking for any remaining uses of ChecksumAddress constructor:" rg "ChecksumAddress\s*\(" --type pythonLength of output: 646
Script:
#!/bin/bash # Description: Verify the usage of OMEN_DEFAULT_MARKET_FEE_PERC and fee_perc parameter # Test 1: Check for any remaining instances of OMEN_DEFAULT_MARKET_FEE echo "Checking for any remaining instances of OMEN_DEFAULT_MARKET_FEE:" rg "OMEN_DEFAULT_MARKET_FEE[^_]" --type py # Test 2: Verify that all calls to omen_create_market_tx use fee_perc echo "Verifying calls to omen_create_market_tx use fee_perc:" rg "omen_create_market_tx\s*\([^)]*fee(_perc)?\s*=" --type py # Test 3: Check for any remaining uses of ChecksumAddress constructor echo "Checking for any remaining uses of ChecksumAddress constructor:" rg "ChecksumAddress\s*\(" --type pyLength of output: 807
No description provided.