pushing rebalance mappings for review#769
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.
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
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Show resolved
Hide resolved
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Show resolved
Hide resolved
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Show resolved
Hide resolved
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
Show resolved
Hide resolved
...use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_example.ipynb
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.
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.
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.
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.
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.
...les/use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_module.py
Outdated
Show resolved
Hide resolved
...les/use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_module.py
Outdated
Show resolved
Hide resolved
...les/use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_module.py
Outdated
Show resolved
Hide resolved
...les/use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_module.py
Outdated
Show resolved
Hide resolved
...les/use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_module.py
Outdated
Show resolved
Hide resolved
...les/use-cases/rebalance-mapping/rebalance-mapping-configuration/rebalance_mappings_module.py
Outdated
Show resolved
Hide resolved
|
/LGTM |
3 similar comments
|
/LGTM |
|
/LGTM |
|
/LGTM |
Pull Request Checklist
developbranchDescription 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.