From b77540096892f8c1c847f1c8be90e31384d96141 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 20 Feb 2023 14:07:27 +0100 Subject: [PATCH 1/3] Pharo 11 compatibility Fixes #301 --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 9 ++++++++- src/Math-Benchmarks-KDTree/PMKDTreeBenchmark.class.st | 4 ++-- src/Math-Numerical/PMLineSearch.class.st | 4 ++-- src/Math-Pharo11/Float32Array.class.st | 6 ++++++ src/Math-Pharo11/package.st | 1 + src/Math-Tests-KDTree/PMKDTreeTest.class.st | 4 ++-- 6 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 src/Math-Pharo11/Float32Array.class.st create mode 100644 src/Math-Pharo11/package.st diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index d327a9a9e..a7922b6d8 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -167,7 +167,14 @@ BaselineOfPolyMath >> baseline: spec [ with: #('Math-Tests-Matrix' 'Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-Random' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-KolmogorovSmirnov' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-KernelSmoothing' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Core-Distribution' 'Math-Tests-Core'); group: 'default' - with: #('Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy') ] + with: #('Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy') ]. + + spec for: #( #'pharo6.x' #'pharo7.x' #'pharo8.x' #'pharo9.x' #'pharo10.x' ) do: [ + spec + package: 'Math-Numerical' with: [ spec requires: #( 'Math-Pharo11' ) ]; + package: 'Math-Benchmarks-KDTree' with: [ spec requires: #( 'Math-Pharo11' ) ]; + package: 'Math-Tests-KDTree' with: [ spec requires: #( 'Math-Pharo11' ) ]; + package: 'Math-Pharo11' ] ] { #category : #accessing } diff --git a/src/Math-Benchmarks-KDTree/PMKDTreeBenchmark.class.st b/src/Math-Benchmarks-KDTree/PMKDTreeBenchmark.class.st index 4897462e8..a5f6df24e 100644 --- a/src/Math-Benchmarks-KDTree/PMKDTreeBenchmark.class.st +++ b/src/Math-Benchmarks-KDTree/PMKDTreeBenchmark.class.st @@ -15,7 +15,7 @@ Class { 'collType', 'm' ], - #category : 'Math-Benchmarks-KDTree' + #category : #'Math-Benchmarks-KDTree' } { #category : #defaults } @@ -109,7 +109,7 @@ PMKDTreeBenchmark >> collType: aSequencableCollectionClass [ { #category : #'initialize-release' } PMKDTreeBenchmark >> initialize [ super initialize. - collType := FloatArray. + collType := Float32Array. rand := Random new ] diff --git a/src/Math-Numerical/PMLineSearch.class.st b/src/Math-Numerical/PMLineSearch.class.st index 74eac714c..6ad44638e 100644 --- a/src/Math-Numerical/PMLineSearch.class.st +++ b/src/Math-Numerical/PMLineSearch.class.st @@ -138,9 +138,9 @@ PMLineSearch >> initialize [ failingMin := 1e-3. useCubicApproximation := false. " Values for g(0), g'(0) and g(1) " - boundaryValues := FloatArray new: 3. + boundaryValues := Float32Array new: 3. " Result: x1, g(x1), x2, g(x2) " - extendedResult := FloatArray new: 4. + extendedResult := Float32Array new: 4. ^ self ] diff --git a/src/Math-Pharo11/Float32Array.class.st b/src/Math-Pharo11/Float32Array.class.st new file mode 100644 index 000000000..a27e17087 --- /dev/null +++ b/src/Math-Pharo11/Float32Array.class.st @@ -0,0 +1,6 @@ +Class { + #name : #Float32Array, + #superclass : #FloatArray, + #type : #words, + #category : #'Math-Pharo11' +} diff --git a/src/Math-Pharo11/package.st b/src/Math-Pharo11/package.st new file mode 100644 index 000000000..8971b3a85 --- /dev/null +++ b/src/Math-Pharo11/package.st @@ -0,0 +1 @@ +Package { #name : #'Math-Pharo11' } diff --git a/src/Math-Tests-KDTree/PMKDTreeTest.class.st b/src/Math-Tests-KDTree/PMKDTreeTest.class.st index 88967082e..b0f67ab8c 100644 --- a/src/Math-Tests-KDTree/PMKDTreeTest.class.st +++ b/src/Math-Tests-KDTree/PMKDTreeTest.class.st @@ -80,9 +80,9 @@ PMKDTreeTest >> testIndexedKDTreeSimple [ | r n aTree bTree | r := rand next: 200. aTree := PMIndexedKDTree - withAll: (r collect: [ :i | FloatArray with: i with: i ]). "2-dimensional data" + withAll: (r collect: [ :i | Float32Array with: i with: i ]). "2-dimensional data" bTree := PMIndexedKDTree - withAll: (r collect: [ :i | FloatArray with: i ]). "1-dimensional data" + withAll: (r collect: [ :i | Float32Array with: i ]). "1-dimensional data" 1 to: 20 do: [ :v | n := 1 / v. self From 847f16aac17f854e779248a9a6cedcb3f28b223d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 20 Feb 2023 14:10:28 +0100 Subject: [PATCH 2/3] Enable P11 CI --- .github/workflows/release.yml | 4 ++-- .github/workflows/smalltalk-ci.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e5db2b68..9449620cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: CI +name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -11,7 +11,7 @@ jobs: build: strategy: matrix: - smalltalk: [ Pharo64-9.0, Pharo64-10 ] + smalltalk: [ Pharo64-9.0, Pharo64-10, Pharo64-11 ] os: [ macos-latest, windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} name: ${{ matrix.smalltalk }} on ${{ matrix.os }} diff --git a/.github/workflows/smalltalk-ci.yml b/.github/workflows/smalltalk-ci.yml index 9d9536084..1e6d5c4bd 100644 --- a/.github/workflows/smalltalk-ci.yml +++ b/.github/workflows/smalltalk-ci.yml @@ -17,7 +17,7 @@ jobs: PROJECT_NAME: PolyMath-${{ matrix.smalltalk }} strategy: matrix: - smalltalk: [ Pharo64-9.0, Pharo64-10 ] + smalltalk: [ Pharo64-9.0, Pharo64-10, Pharo64-11 ] name: ${{ matrix.smalltalk }} steps: - uses: actions/checkout@v2 From 86cc9ebdd5209f248658f9ac71d49ab379e2280b Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 20 Feb 2023 14:32:10 +0100 Subject: [PATCH 3/3] Rename compatibility packages --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 8 ++++---- .../Float32Array.class.st | 2 +- src/Math-CompatibilityUpToPharo11/package.st | 1 + src/Math-Pharo11/package.st | 1 - 4 files changed, 6 insertions(+), 6 deletions(-) rename src/{Math-Pharo11 => Math-CompatibilityUpToPharo11}/Float32Array.class.st (63%) create mode 100644 src/Math-CompatibilityUpToPharo11/package.st delete mode 100644 src/Math-Pharo11/package.st diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index a7922b6d8..fac7a74a9 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -171,10 +171,10 @@ BaselineOfPolyMath >> baseline: spec [ spec for: #( #'pharo6.x' #'pharo7.x' #'pharo8.x' #'pharo9.x' #'pharo10.x' ) do: [ spec - package: 'Math-Numerical' with: [ spec requires: #( 'Math-Pharo11' ) ]; - package: 'Math-Benchmarks-KDTree' with: [ spec requires: #( 'Math-Pharo11' ) ]; - package: 'Math-Tests-KDTree' with: [ spec requires: #( 'Math-Pharo11' ) ]; - package: 'Math-Pharo11' ] + package: 'Math-Numerical' with: [ spec requires: #( 'Math-CompatibilityUpToPharo11' ) ]; + package: 'Math-Benchmarks-KDTree' with: [ spec requires: #( 'Math-CompatibilityUpToPharo11' ) ]; + package: 'Math-Tests-KDTree' with: [ spec requires: #( 'Math-CompatibilityUpToPharo11' ) ]; + package: 'Math-CompatibilityUpToPharo11' ] ] { #category : #accessing } diff --git a/src/Math-Pharo11/Float32Array.class.st b/src/Math-CompatibilityUpToPharo11/Float32Array.class.st similarity index 63% rename from src/Math-Pharo11/Float32Array.class.st rename to src/Math-CompatibilityUpToPharo11/Float32Array.class.st index a27e17087..19d291a86 100644 --- a/src/Math-Pharo11/Float32Array.class.st +++ b/src/Math-CompatibilityUpToPharo11/Float32Array.class.st @@ -2,5 +2,5 @@ Class { #name : #Float32Array, #superclass : #FloatArray, #type : #words, - #category : #'Math-Pharo11' + #category : #'Math-CompatibilityUpToPharo11' } diff --git a/src/Math-CompatibilityUpToPharo11/package.st b/src/Math-CompatibilityUpToPharo11/package.st new file mode 100644 index 000000000..9d9ac190d --- /dev/null +++ b/src/Math-CompatibilityUpToPharo11/package.st @@ -0,0 +1 @@ +Package { #name : #'Math-CompatibilityUpToPharo11' } diff --git a/src/Math-Pharo11/package.st b/src/Math-Pharo11/package.st deleted file mode 100644 index 8971b3a85..000000000 --- a/src/Math-Pharo11/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-Pharo11' }