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
pushing rebalance mappings for review #769
base: develop
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -0,0 +1,916 @@ | |||
{ |
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 first sentence is technically correct, but we also want to add in the business interpretation alongside it, probably before the technical details. The business side of this is that we want to set up a portfolio and a benchmark that can be used for performance tracking or rebalancing.
Reply via ReviewNB
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.
had another go at the title
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Outdated
Show resolved
Hide resolved
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Outdated
Show resolved
Hide resolved
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Outdated
Show resolved
Hide resolved
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Outdated
Show resolved
Hide resolved
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Outdated
Show resolved
Hide resolved
...les/use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_module.py
Show resolved
Hide resolved
recipe_code: str | ||
rebalance_configuration_scope: str | ||
rebalance_configuration_code: str | ||
# rebalance_configuration_user_id: str |
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.
if you don't need this line, remove it
"scope": self.configuration.rebalance_configuration_scope, | ||
"code": self.configuration.rebalance_configuration_code | ||
}, | ||
# "rebalanceConfigurationUserId": self.configuration.rebalance_configuration_user_id, |
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.
if you don't need this line, delete it
target_weights: list[RebalanceTargetWeight] | ||
|
||
@root_validator | ||
def check_weights_sum_to_100(cls, values): |
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.
is this something that we need to enforce at this point? what happens if you call the API with weights that do not sum to 100? it might error but possibly that is something we want to allow because we don't do this sort of validation elsewhere in our sdks (unless i'm mistaken)
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.
From what I can see, the sum to 100 requirement is implemented in the fe. One can upload weights which do not sum to 100, but they visually error:
So I have implemented this validator in the python client to mirror this structure and hopefully prevent issues down the line.
I will try to run an incomplete mapping programatically to see if the api complains.
Pull Request Checklist
develop
branchDescription of the PR
Describe the code changes for the reviewers, explain the solution you have provided and how it fixes the issue
FIL need a notebook that shows how to create a portfolio, create a benchmark (reference portfolio - with weighted constituents), relate the two (relationships endpoint), define a mapping - all programatically, so that it works for a user in the UI afterwards. To fulfill this, I've built an api connector in python.