-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
DX enhancements #110
base: master
Are you sure you want to change the base?
DX enhancements #110
Conversation
- added section to silence Deprecation warning spam from numpy/numba.
- Began Refactoring of Enums b/c to improve intellisense, editor autocomplete for end-user. Numba seems to support this: https://numba.pydata.org/numba-doc/dev/reference/pysupported.html#enum - Also started refactoring named_tuple function-based creation with class-based creation, because it provides better intellisense, autocomplete. Would like to do more in this regard if @polakowo approves of this.
Codecov Report
@@ Coverage Diff @@
## master #110 +/- ##
==========================================
+ Coverage 90.41% 90.45% +0.03%
==========================================
Files 60 60
Lines 9006 9027 +21
Branches 2040 2041 +1
==========================================
+ Hits 8143 8165 +22
Misses 421 421
+ Partials 442 441 -1
Continue to review full report at Codecov.
|
Good start, native enum classes are indeed much more intuitive than named tuples, just make sure to adapt https://github.com/polakowo/vectorbt/blob/master/vectorbt/utils/enum.py, also |
awesome, will try to continue with this and your suggestions when I have free time. |
@polakowo One issue is that using asterisk arg expand like Without the since NameTuples don't have the ability to inherit fields when created as a class, and
Current Options seem to be:
TLDR: It seems to me that refactoring into NameTuples utilizing composition (nametuple embedding) would be ideal solution but would probably require the most work since I'm guessing it would probably need updating where many parts of the codebase expect values. I might be overlooking something where that's not even possible though. Wondering which of these options you think I should pursue?(if any) |
@RileyMShea hmm interesting observation, I just tried to come up with some hack but was unable to find any. Your composition approach makes a lot of sense given that all simulation functions follow a clear hierarchy: But be aware that usage of contexts is poorly tested, so making mistakes would still probably give you green light in pytest. If you decide to pursue all these changes, I could then follow up with writing unit tests. And I really appreciate your time and effort. It's time to diversify this codebase for the good :) I'm going to release 0.17 in a couple of days with refactored and better-documented indicator factory and some cross-validation functions, but you're safe to continue working on the current master, I won't touch anything related to enums and portfolio. |
@polakowo Okay awesome, I will try to work towards those changes u mention. I am excited for 0.17! |
@polakowo The hours at my main job have increased to where I currently don't have time to allot to this PR. I would still like to complete it, but it may be a while before I can find time to work on it. |
@RileyMShea it's fine, you can jump in anytime, we're not in any hurry :) Wish you a stress-free holiday! |
Made some minor changes towards enhancing dx and intellisense/autocomplete for end-user.