-
Notifications
You must be signed in to change notification settings - Fork 26
Update vigowalker 0.1.9 #33
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughUpdates .gitignore to include .venv. Refactors Python imports in pocketoption async/sync modules to use relative paths. Modifies Rust Asset defaults and validation to use a union of allowed and default candle durations. Adds a new async streaming test script for candle data. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Test as tests/test-get-data.py
participant POA as PocketOptionAsync
participant Stream as Timed Candle Stream
User->>Test: Provide ssid
Test->>POA: init(ssid)
Test->>POA: subscribe_symbol_timed("EURUSD_otc", 5s)
POA-->>Test: Stream iterator
loop For each candle
Stream-->>POA: Candle data
POA-->>Test: Candle (dict)
Test->>Test: print(candle)
end
sequenceDiagram
autonumber
participant Caller
participant Asset
note over Asset: validate(time)
Caller->>Asset: validate(time)
rect rgba(200,230,255,0.3)
Asset->>Asset: allowed = allowed_candles()
Asset->>Asset: all = sort_dedup(allowed ∪ DEFAULT_CANDLE_LENGTHS)
end
alt time ∈ all
Asset-->>Caller: Ok(())
else time ∉ all
Asset-->>Caller: Err(InvalidAsset{ available: all })
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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.
Pull Request Overview
This PR updates vigowalker to version 0.1.9, expanding candle duration support and fixing import paths in the Python modules.
- Expands the default candle durations from 9 to 15 options with additional time intervals
- Improves error reporting by combining and deduplicating available candle durations
- Fixes relative import paths in Python modules to use proper relative imports
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test-get-data.py | Adds a new test file demonstrating async subscription to symbol data |
| crates/binary_options_tools/src/pocketoption/types.rs | Expands candle durations and improves error message formatting |
| BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py | Updates imports to use relative imports |
| BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py | Updates imports to use relative imports |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -1,6 +1,6 @@ | |||
| from .asyncronous import PocketOptionAsync | |||
Copilot
AI
Aug 29, 2025
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.
The filename 'asyncronous.py' contains a spelling error. It should be 'asynchronous.py'. Update the import to match the correct spelling: from .asynchronous import PocketOptionAsync
| from .asyncronous import PocketOptionAsync | |
| from .asynchronous import PocketOptionAsync |
| from ..validator import Validator | ||
| from ..config import Config | ||
| from .. import RawPocketOption, Logger |
Copilot
AI
Aug 29, 2025
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.
The filename 'asyncronous.py' contains a spelling error. It should be 'asynchronous.py' to correctly spell 'asynchronous'.
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.
@Rick-29 will fix this later
| from ..validator import Validator | ||
| from ..config import Config | ||
| from .. import RawPocketOption, Logger |
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.
@Rick-29 will fix this later
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.
la verdad no me cambia que uses el 60 * ...
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py (2)
232-264: Typo in public API: timout → timeout (breaking).Rename the method to the correct spelling and keep a backward-compat alias if this is already published.
- def create_raw_order_with_timout(self, message: str, validator: Validator, timeout: timedelta) -> str: + # Back-compat alias; consider deprecating in a future minor. + def create_raw_order_with_timout(self, message: str, validator: Validator, timeout: timedelta) -> str: + return self.create_raw_order_with_timeout(message, validator, timeout) + + def create_raw_order_with_timeout(self, message: str, validator: Validator, timeout: timedelta) -> str: """ - Similar to create_raw_order but with a timeout. + Similar to create_raw_order but with a timeout. @@ - return self.loop.run_until_complete(self._client.create_raw_order_with_timeout(message, validator, timeout)) + return self.loop.run_until_complete(self._client.create_raw_order_with_timeout(message, validator, timeout))
192-205: Implement or disable send_raw_message wrapper
The syncsend_raw_messagedelegates toPocketOptionAsync.send_raw_message, which currently always raisesNotImplementedError(seepocketoption/asyncronous.py:386–396), so this call will crash at runtime. Either implement the async method or remove/disable the sync API until it’s functional.BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py (1)
67-87: Bug: wrong variable passed to RawPocketOption.When config is dict/str, you build self.config but pass the original config variable, breaking type expectations.
- self.client = RawPocketOption(ssid, config) + self.client = RawPocketOption(ssid, self.config)
🧹 Nitpick comments (7)
.gitignore (1)
5-6: Scope ignores more precisely (optional).Consider scoping to the repo root and using trailing slashes to avoid accidental matches in nested folders.
-/target -.venv +/target/ +/.venv/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py (1)
283-301: Doc/example uses raw_validator but API accepts Validator.Align examples with the actual type you pass downstream (Validator vs validator.raw_validator) once async methods are implemented to avoid confusion.
crates/binary_options_tools/src/pocketoption/types.rs (1)
378-389: Better error context by union of durations: nice improvement.Minor micro-opt: use sort_unstable() for primitive sorting.
- all_available.sort(); + all_available.sort_unstable(); all_available.dedup();BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py (1)
60-66: Docnote contradicts code (Config support).The class does parse and store Config; update the note to reflect reality.
- Warning: This class is designed for asynchronous operations and should be used within an async context. - This version doesn't support the `Config` class. + Warning: This class is designed for asynchronous operations and should be used within an async context. + This version supports the `Config` class (Config|dict|JSON) and locks it after first use.tests/test-get-data.py (3)
1-3: Import may fail unless re-exported.Either export PocketOptionAsync from BinaryOptionsToolsV2/pocketoption/init.py or import the module path directly.
-from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync +from BinaryOptionsToolsV2.pocketoption.asyncronous import PocketOptionAsync
18-21: Avoid echoing credentials; use getpass.Prevent SSID from showing on screen.
-if __name__ == '__main__': - ssid = input('Please enter your ssid: ') - asyncio.run(main(ssid)) +if __name__ == '__main__': + import getpass + ssid = getpass.getpass('Please enter your ssid: ') + asyncio.run(main(ssid))
14-16: Non-terminating stream under tests/.Since this runs indefinitely, consider moving to examples/ or marking clearly as a manual smoke test to avoid confusion with automated test suites.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
.gitignore(1 hunks)BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py(1 hunks)BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py(1 hunks)crates/binary_options_tools/src/pocketoption/types.rs(2 hunks)tests/test-get-data.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py (3)
BinaryOptionsToolsV2/BinaryOptionsToolsV2/validator.py (1)
Validator(3-272)BinaryOptionsToolsV2/BinaryOptionsToolsV2/config.py (1)
Config(62-193)BinaryOptionsToolsV2/BinaryOptionsToolsV2/tracing.py (1)
Logger(48-92)
tests/test-get-data.py (2)
BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py (1)
subscribe_symbol_timed(344-363)BinaryOptionsToolsV2/BinaryOptionsToolsV2/tracing.py (1)
start_logs(25-45)
BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py (2)
BinaryOptionsToolsV2/BinaryOptionsToolsV2/config.py (1)
Config(62-193)BinaryOptionsToolsV2/BinaryOptionsToolsV2/validator.py (1)
Validator(3-272)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
- GitHub Check: stable - aarch64-unknown-linux-musl - node@20
- GitHub Check: stable - i686-pc-windows-msvc - node@20
- GitHub Check: stable - aarch64-pc-windows-msvc - node@20
- GitHub Check: stable - riscv64gc-unknown-linux-gnu - node@20
- GitHub Check: stable - armv7-linux-androideabi - node@20
- GitHub Check: stable - aarch64-unknown-linux-gnu - node@20
- GitHub Check: stable - armv7-unknown-linux-musleabihf - node@20
- GitHub Check: stable - armv7-unknown-linux-gnueabihf - node@20
- GitHub Check: stable - x86_64-pc-windows-msvc - node@20
- GitHub Check: stable - x86_64-unknown-linux-gnu - node@20
- GitHub Check: Build FreeBSD
- GitHub Check: macos (macos-13, x86_64)
- GitHub Check: macos (macos-14, aarch64)
- GitHub Check: windows (windows-latest, x64)
- GitHub Check: windows (windows-latest, x86)
🔇 Additional comments (4)
BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py (1)
2-3: Relative imports: good change.crates/binary_options_tools/src/pocketoption/types.rs (1)
337-353: Expanded default candle lengths: LGTM.Broader coverage is helpful and non-breaking.
BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py (2)
1-3: Relative imports: good change.
386-488: Delegate raw WebSocket and order methods to client, defer iterator
- Replace the
NotImplementedErrorinsend_raw_message,create_raw_order,create_raw_order_with_timeout, andcreate_raw_order_with_timeout_and_retrywith direct calls toawait self.client.<method>(…).- Keep
create_raw_iteratorraisingNotImplementedError(the Rust binding insrc/pocketoption.rsstill returnsNotAllowed) and adjust the sync wrapper to reflect that it’s unavailable until the Rust API implements it.
Summary by CodeRabbit