Skip to content

Legal entity rates loader #1516

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

Merged
merged 4 commits into from
May 24, 2017
Merged

Conversation

yukiiwashita
Copy link
Contributor

  • Implemented LegalEntityRatesCurvesCsvLoader.
  • Reuse the existing csv formats except the curve group. An example is legal-entity-groups.csv.
  • Resulting object is LegalEntityCurveGroup from which the rates provider is created via LegalEntityDiscountingMarketDataLookup.
  • Move RepoGroup and LegalEntityGroup.


import static org.testng.Assert.assertEquals;

import org.testng.annotations.Test;

import com.opengamma.strata.market.curve.RepoGroup;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test needs to move package too

@@ -3,12 +3,14 @@
*
* Please see distribution for license.
*/
package com.opengamma.strata.pricer.bond;
package com.opengamma.strata.market.curve;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test needs to move package too

@@ -75,10 +77,12 @@
* The standard calculation functions.
*/
private static final CalculationFunctions STANDARD = CalculationFunctions.of(
new BondFutureTradeCalculationFunction(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadoc also needs to be updated within the class.

@@ -3,7 +3,7 @@
*
* Please see distribution for license.
*/
package com.opengamma.strata.pricer.bond;
package com.opengamma.strata.market.curve;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is rather unfortunate that this class is moved a second time!

CurveGroupName groupName = repoEntry.getKey();
Map<Pair<RepoGroup, Currency>, Curve> repoCurves = MapStream.of(repoEntry.getValue())
.mapValues(name -> curves.get(name))
.peek(e -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

peek() not generally a good thing to use, is there an alternative?

})
.mapValues(
name -> {
Curve curve = curves.get(name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to avoid blocks by creating extra methods. So, this would be `name -> queryCurve(name, curves, "Repo")

(this extra method can be used for both of these cases)

@yukiiwashita yukiiwashita merged commit 5e48c25 into master May 24, 2017
@yukiiwashita yukiiwashita deleted the topic/legal-entity-rates-loader branch May 24, 2017 10:24
@jodastephen jodastephen modified the milestone: v1.4 Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants