Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

pushing rebalance mappings for review#769

Open
kr0bfb wants to merge 11 commits intofinbourne:developfrom
kr0bfb:rebalance_mappings_example
Open

pushing rebalance mappings for review#769
kr0bfb wants to merge 11 commits intofinbourne:developfrom
kr0bfb:rebalance_mappings_example

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.

@review-notebook-app
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.

@adamMQM
Copy link
Contributor

adamMQM commented May 21, 2024

/LGTM

3 similar comments
@adamMQM
Copy link
Contributor

adamMQM commented May 21, 2024

/LGTM

@adamMQM
Copy link
Contributor

adamMQM commented May 22, 2024

/LGTM

@adamMQM
Copy link
Contributor

adamMQM commented May 22, 2024

/LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments