Skip to content

Commit f03934f

Browse files
committed
Rename IRow to Row, and IStatefulRow to StatefulRow.
1 parent 3a805fa commit f03934f

File tree

109 files changed

+418
-418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+418
-418
lines changed

src/Microsoft.ML.Api/CustomMappingTransformer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public Mapper(CustomMappingTransformer<TSrc, TDst> parent, Schema inputSchema)
111111
_typedSrc = TypedCursorable<TSrc>.Create(_host, emptyDataView, false, _parent.InputSchemaDefinition);
112112
}
113113

114-
public Delegate[] CreateGetters(IRow input, Func<int, bool> activeOutput, out Action disposer)
114+
public Delegate[] CreateGetters(Row input, Func<int, bool> activeOutput, out Action disposer)
115115
{
116116
disposer = null;
117117
// If no outputs are active, we short-circuit to empty array of getters.
@@ -147,7 +147,7 @@ public Delegate[] CreateGetters(IRow input, Func<int, bool> activeOutput, out Ac
147147
return result;
148148
}
149149

150-
private Delegate GetDstGetter<T>(IRow input, int colIndex, Action refreshAction)
150+
private Delegate GetDstGetter<T>(Row input, int colIndex, Action refreshAction)
151151
{
152152
var getter = input.GetGetter<T>(colIndex);
153153
ValueGetter<T> combinedGetter = (ref T dst) =>

src/Microsoft.ML.Api/DataViewConstructionUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ protected override TRow GetCurrentRowObject()
125125
}
126126

127127
/// <summary>
128-
/// A row that consumes items of type <typeparamref name="TRow"/>, and provides an <see cref="IRow"/>. This
128+
/// A row that consumes items of type <typeparamref name="TRow"/>, and provides an <see cref="Row"/>. This
129129
/// is in contrast to <see cref="IRowReadableAs{TRow}"/> which consumes a data view row and publishes them as the output type.
130130
/// </summary>
131131
/// <typeparam name="TRow">The input data type.</typeparam>
132-
public abstract class InputRowBase<TRow> : IRow
132+
public abstract class InputRowBase<TRow> : Row
133133
where TRow : class
134134
{
135135
private readonly int _colCount;

src/Microsoft.ML.Api/StatefulFilterTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private sealed class Cursor : RootCursorBase
150150

151151
private readonly RowCursor<TSrc> _input;
152152
// This is used to serve getters for the columns we produce.
153-
private readonly IRow _appendedRow;
153+
private readonly Row _appendedRow;
154154

155155
private readonly TSrc _src;
156156
private readonly TDst _dst;

src/Microsoft.ML.Api/TypedCursor.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace Microsoft.ML.Runtime.Api
1414
{
1515
/// <summary>
16-
/// This interface is an <see cref="IRow"/> with 'strongly typed' binding.
16+
/// This interface is an <see cref="Row"/> with 'strongly typed' binding.
1717
/// It can populate the user-supplied object's fields with the values of the current row.
1818
/// </summary>
1919
/// <typeparam name="TRow">The user-defined type that is being populated while cursoring.</typeparam>
@@ -29,7 +29,7 @@ internal interface IRowReadableAs<TRow>
2929
}
3030

3131
/// <summary>
32-
/// This interface is an <see cref="IRow"/> with 'strongly typed' binding.
32+
/// This interface is an <see cref="Row"/> with 'strongly typed' binding.
3333
/// It can accept values of type <typeparamref name="TRow"/> and present the value as a row.
3434
/// </summary>
3535
/// <typeparam name="TRow">The user-defined type that provides the values while cursoring.</typeparam>
@@ -179,7 +179,7 @@ public RowCursor<TRow> GetRandomizedCursor(int randomSeed)
179179
return GetCursor(x => false, randomSeed);
180180
}
181181

182-
public IRowReadableAs<TRow> GetRow(IRow input)
182+
public IRowReadableAs<TRow> GetRow(Row input)
183183
{
184184
return new RowImplementation(new TypedRow(this, input));
185185
}
@@ -256,7 +256,7 @@ public static TypedCursorable<TRow> Create(IHostEnvironment env, IDataView data,
256256
private abstract class TypedRowBase
257257
{
258258
protected readonly IChannel Ch;
259-
private readonly IRow _input;
259+
private readonly Row _input;
260260
private readonly Action<TRow>[] _setters;
261261

262262
public long Batch => _input.Batch;
@@ -265,7 +265,7 @@ private abstract class TypedRowBase
265265

266266
public Schema Schema => _input.Schema;
267267

268-
public TypedRowBase(TypedCursorable<TRow> parent, IRow input, string channelMessage)
268+
public TypedRowBase(TypedCursorable<TRow> parent, Row input, string channelMessage)
269269
{
270270
Contracts.AssertValue(parent);
271271
Contracts.AssertValue(parent._host);
@@ -284,12 +284,12 @@ public TypedRowBase(TypedCursorable<TRow> parent, IRow input, string channelMess
284284

285285
public ValueGetter<UInt128> GetIdGetter() => _input.GetIdGetter();
286286

287-
private Action<TRow> GenerateSetter(IRow input, int index, InternalSchemaDefinition.Column column, Delegate poke, Delegate peek)
287+
private Action<TRow> GenerateSetter(Row input, int index, InternalSchemaDefinition.Column column, Delegate poke, Delegate peek)
288288
{
289289
var colType = input.Schema.GetColumnType(index);
290290
var fieldType = column.OutputType;
291291
var genericType = fieldType;
292-
Func<IRow, int, Delegate, Delegate, Action<TRow>> del;
292+
Func<Row, int, Delegate, Delegate, Action<TRow>> del;
293293
if (fieldType.IsArray)
294294
{
295295
Ch.Assert(colType.IsVector);
@@ -348,7 +348,7 @@ private Action<TRow> GenerateSetter(IRow input, int index, InternalSchemaDefinit
348348
// REVIEW: The converting getter invokes a type conversion delegate on every call, so it's inherently slower
349349
// than the 'direct' getter. We don't have good indication of this to the user, and the selection
350350
// of affected types is pretty arbitrary (signed integers and bools, but not uints and floats).
351-
private Action<TRow> CreateConvertingVBufferSetter<TSrc, TDst>(IRow input, int col, Delegate poke, Delegate peek, Func<TSrc, TDst> convert)
351+
private Action<TRow> CreateConvertingVBufferSetter<TSrc, TDst>(Row input, int col, Delegate poke, Delegate peek, Func<TSrc, TDst> convert)
352352
{
353353
var getter = input.GetGetter<VBuffer<TSrc>>(col);
354354
var typedPoke = poke as Poke<TRow, TDst[]>;
@@ -370,7 +370,7 @@ private Action<TRow> CreateConvertingVBufferSetter<TSrc, TDst>(IRow input, int c
370370
};
371371
}
372372

373-
private Action<TRow> CreateDirectVBufferSetter<TDst>(IRow input, int col, Delegate poke, Delegate peek)
373+
private Action<TRow> CreateDirectVBufferSetter<TDst>(Row input, int col, Delegate poke, Delegate peek)
374374
{
375375
var getter = input.GetGetter<VBuffer<TDst>>(col);
376376
var typedPoke = poke as Poke<TRow, TDst[]>;
@@ -408,7 +408,7 @@ private Action<TRow> CreateDirectVBufferSetter<TDst>(IRow input, int col, Delega
408408
};
409409
}
410410

411-
private static Action<TRow> CreateConvertingActionSetter<TSrc, TDst>(IRow input, int col, Delegate poke, Func<TSrc, TDst> convert)
411+
private static Action<TRow> CreateConvertingActionSetter<TSrc, TDst>(Row input, int col, Delegate poke, Func<TSrc, TDst> convert)
412412
{
413413
var getter = input.GetGetter<TSrc>(col);
414414
var typedPoke = poke as Poke<TRow, TDst>;
@@ -422,7 +422,7 @@ private static Action<TRow> CreateConvertingActionSetter<TSrc, TDst>(IRow input,
422422
};
423423
}
424424

425-
private static Action<TRow> CreateDirectSetter<TDst>(IRow input, int col, Delegate poke, Delegate peek)
425+
private static Action<TRow> CreateDirectSetter<TDst>(Row input, int col, Delegate poke, Delegate peek)
426426
{
427427
// Awkward to have a parameter that's always null, but slightly more convenient for generalizing the setter.
428428
Contracts.Assert(peek == null);
@@ -437,7 +437,7 @@ private static Action<TRow> CreateDirectSetter<TDst>(IRow input, int col, Delega
437437
};
438438
}
439439

440-
private Action<TRow> CreateVBufferToVBufferSetter<TDst>(IRow input, int col, Delegate poke, Delegate peek)
440+
private Action<TRow> CreateVBufferToVBufferSetter<TDst>(Row input, int col, Delegate poke, Delegate peek)
441441
{
442442
var getter = input.GetGetter<VBuffer<TDst>>(col);
443443
var typedPoke = poke as Poke<TRow, VBuffer<TDst>>;
@@ -472,7 +472,7 @@ public ValueGetter<TValue> GetGetter<TValue>(int col)
472472

473473
private sealed class TypedRow : TypedRowBase
474474
{
475-
public TypedRow(TypedCursorable<TRow> parent, IRow input)
475+
public TypedRow(TypedCursorable<TRow> parent, Row input)
476476
: base(parent, input, "Row")
477477
{
478478
}

src/Microsoft.ML.Core/Data/IDataView.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public interface IDataView
102102
/// should return the "same" row as would have been returned through the regular serial cursor,
103103
/// but all rows should be returned by exactly one of the cursors returned from this cursor.
104104
/// The cursors can have their values reconciled downstream through the use of the
105-
/// <see cref="IRow.Batch"/> property.
105+
/// <see cref="Row.Batch"/> property.
106106
/// </summary>
107107
/// <param name="consolidator">This is an object that can be used to reconcile the
108108
/// returned array of cursors. When the array of cursors is of length 1, it is legal,
@@ -142,7 +142,7 @@ public interface IRowCursorConsolidator
142142
/// A logical row. May be a row of an <see cref="IDataView"/> or a stand-alone row. If/when its contents
143143
/// change, its <see cref="Position"/> value is changed.
144144
/// </summary>
145-
public abstract class IRow
145+
public abstract class Row
146146
{
147147
/// <summary>
148148
/// This is incremented when the underlying contents changes, giving clients a way to detect change.
@@ -169,7 +169,7 @@ public abstract class IRow
169169
public abstract long Batch { get; }
170170

171171
/// <summary>
172-
/// A getter for a 128-bit ID value. It is common for objects to serve multiple <see cref="IRow"/>
172+
/// A getter for a 128-bit ID value. It is common for objects to serve multiple <see cref="Row"/>
173173
/// instances to iterate over what is supposed to be the same data, for example, in a <see cref="IDataView"/>
174174
/// a cursor set will produce the same data as a serial cursor, just partitioned, and a shuffled cursor
175175
/// will produce the same data as a serial cursor or any other shuffled cursor, only shuffled. The ID
@@ -216,12 +216,12 @@ public enum CursorState
216216

217217
/// <summary>
218218
/// The basic cursor base class to cursor through rows of an <see cref="IDataView"/>. Note that
219-
/// this is also an <see cref="IRow"/>. The <see cref="IRow.Position"/> is incremented by <see cref="MoveNext"/>
219+
/// this is also an <see cref="Row"/>. The <see cref="Row.Position"/> is incremented by <see cref="MoveNext"/>
220220
/// and <see cref="MoveMany"/>. When the cursor state is <see cref="CursorState.NotStarted"/> or
221-
/// <see cref="CursorState.Done"/>, <see cref="IRow.Position"/> is <c>-1</c>. Otherwise,
222-
/// <see cref="IRow.Position"/> >= 0.
221+
/// <see cref="CursorState.Done"/>, <see cref="Row.Position"/> is <c>-1</c>. Otherwise,
222+
/// <see cref="Row.Position"/> >= 0.
223223
/// </summary>
224-
public abstract class RowCursor : IRow, IDisposable
224+
public abstract class RowCursor : Row, IDisposable
225225
{
226226
/// <summary>
227227
/// Returns the state of the cursor. Before the first call to <see cref="MoveNext"/> or
@@ -245,11 +245,11 @@ public abstract class RowCursor : IRow, IDisposable
245245
public abstract bool MoveMany(long count);
246246

247247
/// <summary>
248-
/// Returns a cursor that can be used for invoking <see cref="IRow.Position"/>, <see cref="State"/>,
248+
/// Returns a cursor that can be used for invoking <see cref="Row.Position"/>, <see cref="State"/>,
249249
/// <see cref="MoveNext"/>, and <see cref="MoveMany"/>, with results identical to calling those
250250
/// on this cursor. Generally, if the root cursor is not the same as this cursor, using the
251251
/// root cursor will be faster. As an aside, note that this is not necessarily the case of
252-
/// values from <see cref="IRow.GetIdGetter"/>.
252+
/// values from <see cref="Row.GetIdGetter"/>.
253253
/// </summary>
254254
public abstract RowCursor GetRootCursor();
255255
public abstract void Dispose();

src/Microsoft.ML.Core/Data/ISchemaBindableMapper.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public interface ISchemaBoundRowMapper : ISchemaBoundMapper, IRowToRowMapper
6666
}
6767

6868
/// <summary>
69-
/// This interface maps an input <see cref="IRow"/> to an output <see cref="IRow"/>. Typically, the output contains
69+
/// This interface maps an input <see cref="Row"/> to an output <see cref="Row"/>. Typically, the output contains
7070
/// both the input columns and new columns added by the implementing class, although some implementations may
7171
/// return a subset of the input columns.
7272
/// This interface is similar to <see cref="ISchemaBoundRowMapper"/>, except it does not have any input role mappings,
@@ -93,26 +93,26 @@ public interface IRowToRowMapper
9393
Func<int, bool> GetDependencies(Func<int, bool> predicate);
9494

9595
/// <summary>
96-
/// Get an <see cref="IRow"/> with the indicated active columns, based on the input <paramref name="input"/>.
96+
/// Get an <see cref="Row"/> with the indicated active columns, based on the input <paramref name="input"/>.
9797
/// The active columns are those for which <paramref name="active"/> returns true. Getting values on inactive
9898
/// columns of the returned row will throw. Null predicates are disallowed.
9999
///
100-
/// The <see cref="IRow.Schema"/> of <paramref name="input"/> should be the same object as
100+
/// The <see cref="Row.Schema"/> of <paramref name="input"/> should be the same object as
101101
/// <see cref="InputSchema"/>. Implementors of this method should throw if that is not the case. Conversely,
102102
/// the returned value must have the same schema as <see cref="OutputSchema"/>.
103103
///
104-
/// This method creates a live connection between the input <see cref="IRow"/> and the output <see
105-
/// cref="IRow"/>. In particular, when the getters of the output <see cref="IRow"/> are invoked, they invoke the
106-
/// getters of the input row and base the output values on the current values of the input <see cref="IRow"/>.
107-
/// The output <see cref="IRow"/> values are re-computed when requested through the getters.
104+
/// This method creates a live connection between the input <see cref="Row"/> and the output <see
105+
/// cref="Row"/>. In particular, when the getters of the output <see cref="Row"/> are invoked, they invoke the
106+
/// getters of the input row and base the output values on the current values of the input <see cref="Row"/>.
107+
/// The output <see cref="Row"/> values are re-computed when requested through the getters.
108108
///
109109
/// The optional <paramref name="disposer"/> should be invoked by any user of this row mapping, once it no
110-
/// longer needs the <see cref="IRow"/>. If no action is needed when the cursor is Disposed, the implementation
110+
/// longer needs the <see cref="Row"/>. If no action is needed when the cursor is Disposed, the implementation
111111
/// should set <paramref name="disposer"/> to <c>null</c>, otherwise it should be set to a delegate to be
112112
/// invoked by the code calling this object. (For example, a wrapping cursor's <see cref="IDisposable.Dispose"/>
113113
/// method. It's best for this action to be idempotent - calling it multiple times should be equivalent to
114114
/// calling it once.
115115
/// </summary>
116-
IRow GetRow(IRow input, Func<int, bool> active, out Action disposer);
116+
Row GetRow(Row input, Func<int, bool> active, out Action disposer);
117117
}
118118
}

src/Microsoft.ML.Core/Data/MetadataUtils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ public static bool TryGetCategoricalFeatureIndices(Schema schema, int colIndex,
495495
return cols;
496496
}
497497

498-
private sealed class MetadataRow : IRow
498+
private sealed class MetadataRow : Row
499499
{
500500
private readonly Schema.Metadata _metadata;
501501

@@ -514,11 +514,11 @@ public MetadataRow(Schema.Metadata metadata)
514514
}
515515

516516
/// <summary>
517-
/// Presents a <see cref="Schema.Metadata"/> as a an <see cref="IRow"/>.
517+
/// Presents a <see cref="Schema.Metadata"/> as a an <see cref="Row"/>.
518518
/// </summary>
519519
/// <param name="metadata">The metadata to wrap.</param>
520520
/// <returns>A row that wraps an input metadata.</returns>
521-
public static IRow MetadataAsRow(Schema.Metadata metadata)
521+
public static Row MetadataAsRow(Schema.Metadata metadata)
522522
{
523523
Contracts.CheckValue(metadata, nameof(metadata));
524524
return new MetadataRow(metadata);

src/Microsoft.ML.Core/Data/Schema.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace Microsoft.ML.Data
1515
{
1616
/// <summary>
17-
/// This class represents the <see cref="Schema"/> of an object like, for interstance, an <see cref="IDataView"/> or an <see cref="IRow"/>.
17+
/// This class represents the <see cref="Schema"/> of an object like, for interstance, an <see cref="IDataView"/> or an <see cref="Row"/>.
1818
/// On the high level, the schema is a collection of 'columns'. Each column has the following properties:
1919
/// - Column name.
2020
/// - Column type.

src/Microsoft.ML.Data/Data/DataViewUtils.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ private RowCursor[] SplitCore(out IRowCursorConsolidator consolidator, IChannelP
644644
/// <summary>
645645
/// An in pipe creator intended to be used from the splitter only.
646646
/// </summary>
647-
private InPipe CreateInPipe<T>(IRow input, int col)
647+
private InPipe CreateInPipe<T>(Row input, int col)
648648
{
649649
Contracts.AssertValue(input);
650650
Contracts.Assert(0 <= col && col < _schema.ColumnCount);
@@ -654,7 +654,7 @@ private InPipe CreateInPipe<T>(IRow input, int col)
654654
/// <summary>
655655
/// An in pipe creator intended to be used from the splitter only.
656656
/// </summary>
657-
private InPipe CreateIdInPipe(IRow input)
657+
private InPipe CreateIdInPipe(Row input)
658658
{
659659
Contracts.AssertValue(input);
660660
return CreateInPipeCore(_schema.ColumnCount + (int)ExtraIndex.Id, input.GetIdGetter());
@@ -849,7 +849,7 @@ public void SetAll(OutPipe[] pipes)
849849

850850
/// <summary>
851851
/// This helps a cursor present the results of a <see cref="BatchColumn"/>. Practically its role
852-
/// really is to just provide a stable delegate for the <see cref="IRow.GetGetter{T}(int)"/>.
852+
/// really is to just provide a stable delegate for the <see cref="Row.GetGetter{T}(int)"/>.
853853
/// There is one of these created per column, per output cursor, i.e., in splitting
854854
/// there are <c>n</c> of these created per column, and when consolidating only one of these
855855
/// is created per column.
@@ -1332,7 +1332,7 @@ public static ValueGetter<ReadOnlyMemory<char>>[] PopulateGetterArray(RowCursor
13321332
return getters;
13331333
}
13341334

1335-
public static ValueGetter<ReadOnlyMemory<char>> GetSingleValueGetter<T>(IRow cursor, int i, ColumnType colType)
1335+
public static ValueGetter<ReadOnlyMemory<char>> GetSingleValueGetter<T>(Row cursor, int i, ColumnType colType)
13361336
{
13371337
var floatGetter = cursor.GetGetter<T>(i);
13381338
T v = default(T);
@@ -1362,7 +1362,7 @@ public static ValueGetter<ReadOnlyMemory<char>> GetSingleValueGetter<T>(IRow cur
13621362
return getter;
13631363
}
13641364

1365-
public static ValueGetter<ReadOnlyMemory<char>> GetVectorFlatteningGetter<T>(IRow cursor, int colIndex, ColumnType colType)
1365+
public static ValueGetter<ReadOnlyMemory<char>> GetVectorFlatteningGetter<T>(Row cursor, int colIndex, ColumnType colType)
13661366
{
13671367
var vecGetter = cursor.GetGetter<VBuffer<T>>(colIndex);
13681368
var vbuf = default(VBuffer<T>);

src/Microsoft.ML.Data/Data/IRowSeekable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public interface IRowSeekable
2424
/// For <see cref="RowSeeker"/>, when the state is valid (that is when <see cref="MoveTo(long)"/>
2525
/// returns <see langword="true"/>), it returns the current row index. Otherwise it's -1.
2626
/// </summary>
27-
public abstract class RowSeeker : IRow, IDisposable
27+
public abstract class RowSeeker : Row, IDisposable
2828
{
2929
public abstract void Dispose();
3030

0 commit comments

Comments
 (0)