Skip to content
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

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

kr0bfb
Copy link

@kr0bfb kr0bfb commented Feb 2, 2024

Pull Request Checklist

  • Changes follow the style guide
  • Tests pass
  • [. ] Raised the PR against the develop branch
  • [ .] Notebook outputs do not contain any priviledged data

Description 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.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -0,0 +1,916 @@
{
Copy link
Contributor

@jyaffe jyaffe Feb 2, 2024

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

Copy link
Author

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

recipe_code: str
rebalance_configuration_scope: str
rebalance_configuration_code: str
# rebalance_configuration_user_id: str
Copy link
Contributor

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,
Copy link
Contributor

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):
Copy link
Contributor

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)

Copy link
Author

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:

image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants