Skip to content

Commit 56f5733

Browse files
Copilotpetesramek
andauthored
docs: remove misleading 'epoch' terminology from SetBaseline/GetBaseline XML comments
Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/14462e5e-f3ab-4b1a-aabf-b61049ff1191 Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
1 parent c1f5efd commit 56f5733

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

src/PolylineAlgorithm/Abstraction/IPolylineFormatter.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ public interface IPolylineFormatter<TCoordinate, TPolyline> {
2929
int Width { get; }
3030

3131
/// <summary>
32-
/// Returns the baseline (epoch) for the column at <paramref name="index"/>, or <c>0</c> if none is configured.
33-
/// The encoder subtracts this value from the first item's scaled column value to keep the initial delta small.
32+
/// Returns the baseline for the column at <paramref name="index"/>, or <c>0</c> if none is configured.
33+
/// The encoder uses this as the starting point for the first item's delta computation: the initial
34+
/// delta for the column is <c>scaled_first_value − baseline</c> rather than <c>scaled_first_value</c>.
3435
/// </summary>
3536
/// <param name="index">The zero-based column index. Must be in the range <c>[0, <see cref="Width"/>)</c>.</param>
3637
/// <returns>The baseline value, or <c>0</c> when no baseline has been defined for the column.</returns>

src/PolylineAlgorithm/FormatterBuilder.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace PolylineAlgorithm;
1717
/// <remarks>
1818
/// <para>
1919
/// Use <see cref="Create"/> to obtain an instance, call <see cref="AddValue"/> once per column,
20-
/// optionally chain <see cref="SetBaseline"/> to specify an epoch for the most-recently added column,
20+
/// optionally chain <see cref="SetBaseline"/> to set a reference baseline for the most-recently added column,
2121
/// optionally chain <see cref="WithCreate"/> to register a factory for the decoding direction,
2222
/// call <see cref="ForPolyline"/> to supply the polyline surface delegates (required), then call
2323
/// <see cref="Build"/> to produce the immutable <see cref="PolylineFormatter{TCoordinate, TPolyline}"/>.
@@ -87,11 +87,17 @@ public FormatterBuilder<TCoordinate, TPolyline> AddValue(string name, Func<TCoor
8787
}
8888

8989
/// <summary>
90-
/// Sets a baseline (epoch) on the most-recently added column.
91-
/// During encoding the baseline is subtracted from the first item's scaled column value,
92-
/// keeping the initial delta small when the absolute first value is large.
90+
/// Sets a reference value (baseline) on the most-recently added column.
91+
/// During encoding, the baseline is subtracted from the first item's scaled column value so that
92+
/// the initial delta is <c>scaled_first_value − baseline</c> rather than <c>scaled_first_value</c>.
93+
/// Use this when the absolute scaled value of the first data point for a column would otherwise
94+
/// produce a very large initial encoded delta.
9395
/// </summary>
94-
/// <param name="baseline">The baseline value to apply to the first item's column value.</param>
96+
/// <param name="baseline">
97+
/// The reference value to subtract from the first item's scaled column value during encoding.
98+
/// The decoder automatically adds this value back, so the reconstructed item matches the
99+
/// original input.
100+
/// </param>
95101
/// <returns>The current builder instance for method chaining.</returns>
96102
/// <exception cref="InvalidOperationException">
97103
/// Thrown when no rules have been added yet. Call <see cref="AddValue"/> before

src/PolylineAlgorithm/Internal/FormatterRule.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ internal FormatterRule(string name, long factor, Func<T, double> select, long? b
4040
internal long Factor { get; }
4141

4242
/// <summary>
43-
/// Gets the optional baseline (epoch). When set, the encoder subtracts this value from the
44-
/// first point's scaled column value to keep the initial delta small.
43+
/// Gets the optional reference value used as the baseline for the first encoded point.
44+
/// When set, the encoder subtracts this value from the first item's scaled column value so that
45+
/// the initial delta is <c>scaled_first_value − baseline</c> rather than <c>scaled_first_value</c>.
4546
/// </summary>
4647
internal long? Baseline { get; }
4748

0 commit comments

Comments
 (0)