Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbefc491

Browse files
committed
chore: fixed typos, renamed Length to Count
1 parent1f14c5f commitbefc491

File tree

13 files changed

+128
-157
lines changed

13 files changed

+128
-157
lines changed

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
##[Unreleased]
2+
3+
###Breaking Changes
4+
5+
- The`[Length]` function has been renamed to`[Count]`.
6+
- The`xsize` property of collections has been renamed to`count`.
7+
- The`xcontains()` method of collections has been renamed to`contains()`.
8+
19
##0.30.2_2025-07-15_
210

311
###Breaking Changes

‎debug-filter.js‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎src/compute-engine/boxed-expression/abstract-boxed-expression.ts‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -733,15 +733,17 @@ export abstract class _BoxedExpression implements BoxedExpression {
733733
}):((...args:any[])=>any)&{isCompiled?:boolean}{
734734
try{
735735
consttarget=options?.to??'javascript';
736-
736+
737737
// eslint-disable-next-line @typescript-eslint/no-this-alias
738738
constexpr=thisasBoxedExpression;
739-
739+
740740
// For now, only JavaScript is implemented
741741
if(target!=='javascript'){
742-
thrownewError(`Compilation target "${target}" is not yet implemented. Available targets: javascript`);
742+
thrownewError(
743+
`Compilation target "${target}" is not yet implemented. Available targets: javascript`
744+
);
743745
}
744-
746+
745747
constjsTarget=newJavaScriptTarget();
746748
returnjsTarget.compileToExecutable(expr,{
747749
functions:options?.functions,
@@ -768,28 +770,28 @@ export abstract class _BoxedExpression implements BoxedExpression {
768770
returnfalse;
769771
}
770772

771-
xcontains(_rhs:BoxedExpression):boolean|undefined{
773+
contains(_rhs:BoxedExpression):boolean|undefined{
772774
returnundefined;
773775
}
774776

775777
subsetOf(_target:BoxedExpression,_strict:boolean):boolean|undefined{
776778
returnundefined;
777779
}
778780

779-
getxsize():number|undefined{
781+
getcount():number|undefined{
780782
returnundefined;
781783
}
782784

783785
getisEmptyCollection():boolean|undefined{
784786
if(!this.isCollection)returnundefined;
785-
constcount=this.xsize;
787+
constcount=this.count;
786788
if(count===undefined)returnundefined;
787789
returncount===0;
788790
}
789791

790792
getisFiniteCollection():boolean|undefined{
791793
if(!this.isCollection)returnundefined;
792-
constcount=this.xsize;
794+
constcount=this.count;
793795
if(count===undefined)returnundefined;
794796
returnNumber.isFinite(count);
795797
}

‎src/compute-engine/boxed-expression/boxed-dictionary.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ export class BoxedDictionary
4242
if(keyValuesinstanceof_BoxedExpression){
4343
this._initFromExpression(keyValues,options);
4444
}else{
45-
this._initFromRecord(keyValuesasRecord<string,SemiBoxedExpression>,options);
45+
this._initFromRecord(
46+
keyValuesasRecord<string,SemiBoxedExpression>,
47+
options
48+
);
4649
}
4750
}
4851

@@ -179,11 +182,11 @@ export class BoxedDictionary
179182
returnfalse;
180183
}
181184

182-
xcontains(_rhs:BoxedExpression):boolean|undefined{
185+
contains(_rhs:BoxedExpression):boolean|undefined{
183186
returnundefined;
184187
}
185188

186-
getxsize():number|undefined{
189+
getcount():number|undefined{
187190
returnObject.keys(this._keyValues).length;
188191
}
189192

‎src/compute-engine/boxed-expression/boxed-function.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,11 +919,11 @@ export class BoxedFunction extends _BoxedExpression {
919919
returndef?.isLazy?.(this)??false;
920920
}
921921

922-
xcontains(rhs:BoxedExpression):boolean|undefined{
922+
contains(rhs:BoxedExpression):boolean|undefined{
923923
returnthis.baseDefinition?.collection?.contains?.(this,rhs);
924924
}
925925

926-
getxsize():number|undefined{
926+
getcount():number|undefined{
927927
returnthis.operatorDefinition?.collection?.count?.(this);
928928
}
929929

@@ -1348,7 +1348,7 @@ function materialize(
13481348
if(i>headSize)break;
13491349
}
13501350

1351-
constcount=expr.xsize;
1351+
constcount=expr.count;
13521352
if(count===undefined||count<=headSize){
13531353
// If the collection is smaller than the head, we don't need to evaluate the tail
13541354
if(count===undefined||xs.length<count)

‎src/compute-engine/boxed-expression/boxed-symbol.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -704,32 +704,32 @@ export class BoxedSymbol extends _BoxedExpression {
704704
);
705705
}
706706

707-
xcontains(rhs:BoxedExpression):boolean|undefined{
707+
contains(rhs:BoxedExpression):boolean|undefined{
708708
return(
709709
this._asCollection?.contains?.(this._value??this,rhs)??
710-
this._value?.xcontains?.(rhs)
710+
this._value?.contains?.(rhs)
711711
);
712712
}
713713

714-
getxsize():number{
714+
getcount():number{
715715
return(
716-
this._asCollection?.count(this._value??this)??this._value?.xsize??0
716+
this._asCollection?.count(this._value??this)??this._value?.count??0
717717
);
718718
}
719719

720720
getisEmptyCollection():boolean{
721721
return(
722722
this._asCollection?.isEmpty?.(this._value??this)??
723723
this._value?.isEmptyCollection??
724-
this.xsize===0
724+
this.count===0
725725
);
726726
}
727727

728728
getisFiniteCollection():boolean|undefined{
729729
return(
730730
this._asCollection?.isFinite?.(this._value??this)??
731731
this._value?.isFiniteCollection??
732-
isFinite(this.xsize)
732+
isFinite(this.count)
733733
);
734734
}
735735

‎src/compute-engine/boxed-expression/boxed-tensor.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export class BoxedTensor<T extends TensorDataType> extends _BoxedExpression {
247247
returntrue;
248248
}
249249

250-
xcontains(other:BoxedExpression):boolean|undefined{
250+
contains(other:BoxedExpression):boolean|undefined{
251251
if(['float64','float32','int32','uint8'].includes(this.tensor.dtype)){
252252
typeElementType<TextendsTensor<any>>=T['dtype'];
253253
typeDataType=DataTypeMap[ElementType<typeofthis.tensor>];
@@ -261,7 +261,7 @@ export class BoxedTensor<T extends TensorDataType> extends _BoxedExpression {
261261
);
262262
}
263263

264-
getxsize():number{
264+
getcount():number{
265265
returnthis.tensor.shape.reduce((a,b)=>a*b,1);
266266
}
267267

‎src/compute-engine/collection-utils.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function zip(
8787

8888
// Get the length of the shortest collection
8989
constshortest=Math.min(
90-
...items.map((x)=>(x.isCollection ?(x.xsize??1) :Infinity))
90+
...items.map((x)=>(x.isCollection ?(x.count??1) :Infinity))
9191
);
9292

9393
// If the shortest collection is empty, return an empty iterator
@@ -126,14 +126,14 @@ function collectionSubset(
126126
returnundefined;
127127

128128
// All elements of a must be in b
129-
for(constxofa.each())if(b.xcontains(x)!==true)returnfalse;
129+
for(constxofa.each())if(b.contains(x)!==true)returnfalse;
130130

131131
// A strict subset (a ⊂ b) must have at least one element that is not in b
132132
if(strict){
133133
// a must not be equal to b, therefore their size must be different
134-
constaSize=a.xsize;
134+
constaSize=a.count;
135135
if(aSize===undefined)returnfalse;
136-
constbSize=b.xsize;
136+
constbSize=b.count;
137137
if(bSize===undefined)returnfalse;
138138
if(aSize===bSize)returnfalse;
139139
}

‎src/compute-engine/global-types.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,7 @@ export interface BoxedExpression {
17371737
* Return `undefined` if the membership cannot be determined without
17381738
* iterating over the collection.
17391739
*/
1740-
xcontains(rhs:BoxedExpression):boolean|undefined;
1740+
contains(rhs:BoxedExpression):boolean|undefined;
17411741

17421742
/**
17431743
* Check if this collection is a subset of another collection.
@@ -1757,7 +1757,7 @@ export interface BoxedExpression {
17571757
* be determined without iterating over the collection.
17581758
*
17591759
*/
1760-
getxsize():number|undefined;
1760+
getcount():number|undefined;
17611761

17621762
/** If this is a finite collection, return true. */
17631763
isFiniteCollection:boolean|undefined;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp