//-------------------------------------------------------------------------
        public virtual void test_loadSeasonalityDefinition()
        {
            IDictionary <CurveName, SeasonalityDefinition> defns = SeasonalityDefinitionCsvLoader.loadSeasonalityDefinitions(ResourceLocator.of(GROUPS_1));

            assertEquals(defns.Count, 1);
            SeasonalityDefinition defn = defns[CurveName.of("USD-CPI")];

            assertEquals(defn.AdjustmentType, ShiftType.SCALED);
            assertEquals(defn.SeasonalityMonthOnMonth.size(), 12);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parses one or more CSV format curve calibration files with seasonality.
        /// <para>
        /// If the files contain a duplicate entry an exception will be thrown.
        ///
        /// </para>
        /// </summary>
        /// <param name="groupsCharSource">  the curve groups CSV character source </param>
        /// <param name="settingsCharSource">  the curve settings CSV character source </param>
        /// <param name="seasonalityResource">  the seasonality CSV character source </param>
        /// <param name="curveNodeCharSources">  the CSV character sources for curve nodes </param>
        /// <returns> the group definitions, mapped by name </returns>
        /// <exception cref="IllegalArgumentException"> if the files contain a duplicate entry </exception>
        public static ImmutableMap <CurveGroupName, RatesCurveGroupDefinition> parseWithSeasonality(CharSource groupsCharSource, CharSource settingsCharSource, CharSource seasonalityResource, ICollection <CharSource> curveNodeCharSources)
        {
            IDictionary <CurveName, SeasonalityDefinition> seasonality = SeasonalityDefinitionCsvLoader.parseSeasonalityDefinitions(seasonalityResource);

            return(parse0(groupsCharSource, settingsCharSource, seasonality, curveNodeCharSources));
        }