From e8d1780ceb6dfa3fe9f326db06e6b9609d4a48f5 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 8 Mar 2023 13:01:05 +0100 Subject: [PATCH 1/7] fix(dependencies): Revert using mozart Signed-off-by: Marcel Klehr --- composer.json | 20 --- composer.lock | 192 +++++++++++++++++++++++++--- lib/Classifiers/Classifier.php | 6 +- lib/Clustering/DualTreeBall.php | 14 +- lib/Clustering/DualTreeClique.php | 14 +- lib/Clustering/HDBSCAN.php | 18 +-- lib/Clustering/MrdBallTree.php | 24 ++-- lib/Clustering/MstSolver.php | 4 +- lib/Clustering/SquaredDistance.php | 6 +- lib/Dav/Faces/FacePhoto.php | 2 +- lib/Service/FaceClusterAnalyzer.php | 4 +- tests/ClusterTest.php | 2 +- vendor-bin/mozart/composer.json | 5 - 13 files changed, 222 insertions(+), 89 deletions(-) delete mode 100644 vendor-bin/mozart/composer.json diff --git a/composer.json b/composer.json index 035bc4f1..c773ca11 100644 --- a/composer.json +++ b/composer.json @@ -24,12 +24,10 @@ "test:unit": "phpunit --config tests/phpunit.xml", "post-install-cmd": [ "@composer bin all install --ansi", - "\"vendor/bin/mozart\" compose", "composer dump-autoload" ], "post-update-cmd": [ "@composer bin all update --ansi", - "\"vendor/bin/mozart\" compose", "composer dump-autoload" ] }, @@ -45,23 +43,5 @@ "classmap-authoritative": true, "optimize-autoloader": true, "sort-packages": true - }, - "extra": { - "mozart": { - "dep_namespace": "OCA\\Recognize\\Vendor\\", - "dep_directory": "/lib/Vendor/", - "classmap_directory": "/lib/autoload/", - "classmap_prefix": "NEXTCLOUDRECOGNIZE_", - "excluded_packages": [ - "symfony/polyfill-php72", - "symfony/polyfill-php80", - "symfony/polyfill-iconv", - "symfony/polyfill-intl", - "symfony/polyfill-intl-normalizer", - "symfony/polyfill-mbstring", - "symfony/console", - "psr/log" - ] - } } } diff --git a/composer.lock b/composer.lock index 031038a5..2e3b986e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "afc65b846ae1e0700210c33ec98956c8", + "content-hash": "1533ea43d0849481c9aa5d8d8a8db129", "packages": [ { "name": "amphp/amp", @@ -719,16 +719,16 @@ }, { "name": "rubix/ml", - "version": "2.3.0", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/RubixML/ML.git", - "reference": "d0de8a0f07b65d9f5668a2f2ccaceb505b094f31" + "reference": "65ae632dfe9f72a68fb0dc9e42b31804108be2d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/RubixML/ML/zipball/d0de8a0f07b65d9f5668a2f2ccaceb505b094f31", - "reference": "d0de8a0f07b65d9f5668a2f2ccaceb505b094f31", + "url": "https://api.github.com/repos/RubixML/ML/zipball/65ae632dfe9f72a68fb0dc9e42b31804108be2d8", + "reference": "65ae632dfe9f72a68fb0dc9e42b31804108be2d8", "shasum": "" }, "require": { @@ -736,10 +736,12 @@ "andrewdalpino/okbloomer": "^1.0", "ext-json": "*", "php": ">=7.4", - "psr/log": "^1.1", + "psr/log": "^1.1|^2.0|^3.0", "rubix/tensor": "^3.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.17", + "symfony/polyfill-php82": "^1.27", + "symfony/polyfill-php83": "^1.27", "wamania/php-stemmer": "^2.0" }, "require-dev": { @@ -875,7 +877,7 @@ "type": "github" } ], - "time": "2022-12-31T01:32:18+00:00" + "time": "2023-03-07T01:45:04+00:00" }, { "name": "rubix/tensor", @@ -1797,18 +1799,174 @@ ], "time": "2022-11-03T14:55:06+00:00" }, + { + "name": "symfony/polyfill-php82", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php82.git", + "reference": "80ddf7bfa17ef7b06db4e6d007a95bf584e07b44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/80ddf7bfa17ef7b06db4e6d007a95bf584e07b44", + "reference": "80ddf7bfa17ef7b06db4e6d007a95bf584e07b44", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php82\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php82/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-10T10:10:54+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "508c652ba3ccf69f8c97f251534f229791b52a57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/508c652ba3ccf69f8c97f251534f229791b52a57", + "reference": "508c652ba3ccf69f8c97f251534f229791b52a57", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-php80": "^1.14" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, { "name": "symfony/process", - "version": "v5.4.19", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1" + "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c5ba874c9b636dbccf761e22ce750e88ec3f55e1", - "reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1", + "url": "https://api.github.com/repos/symfony/process/zipball/d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd", + "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd", "shasum": "" }, "require": { @@ -1841,7 +1999,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.19" + "source": "https://github.com/symfony/process/tree/v5.4.21" }, "funding": [ { @@ -1857,7 +2015,7 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:32:19+00:00" + "time": "2023-02-21T19:46:44+00:00" }, { "name": "symfony/service-contracts", @@ -2258,12 +2416,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "c4a05e2e3b749899fb3dd5577ecb5763d3993da3" + "reference": "3d228889e662de1efb448bb2a40ac25586009d27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/c4a05e2e3b749899fb3dd5577ecb5763d3993da3", - "reference": "c4a05e2e3b749899fb3dd5577ecb5763d3993da3", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/3d228889e662de1efb448bb2a40ac25586009d27", + "reference": "3d228889e662de1efb448bb2a40ac25586009d27", "shasum": "" }, "require": { @@ -2295,7 +2453,7 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2023-02-22T00:36:09+00:00" + "time": "2023-03-08T00:41:11+00:00" }, { "name": "psr/clock", diff --git a/lib/Classifiers/Classifier.php b/lib/Classifiers/Classifier.php index f0cba1ed..68adf94b 100644 --- a/lib/Classifiers/Classifier.php +++ b/lib/Classifiers/Classifier.php @@ -21,9 +21,9 @@ use OCP\IPreview; use OCP\ITempManager; use Psr\Log\LoggerInterface; -use OCA\Recognize\Vendor\Symfony\Component\Process\Exception\ProcessTimedOutException; -use OCA\Recognize\Vendor\Symfony\Component\Process\Exception\RuntimeException; -use OCA\Recognize\Vendor\Symfony\Component\Process\Process; +use Symfony\Component\Process\Exception\ProcessTimedOutException; +use Symfony\Component\Process\Exception\RuntimeException; +use Symfony\Component\Process\Process; class Classifier { public const TEMP_FILE_DIMENSION = 1024; diff --git a/lib/Clustering/DualTreeBall.php b/lib/Clustering/DualTreeBall.php index 3b5cf41d..ba78a86a 100644 --- a/lib/Clustering/DualTreeBall.php +++ b/lib/Clustering/DualTreeBall.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled; -use OCA\Recognize\Vendor\Rubix\ML\Graph\Nodes\Ball; -use OCA\Recognize\Vendor\Rubix\ML\Helpers\Stats; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance; -use function OCA\Recognize\Vendor\Rubix\ML\argmax; +use Rubix\ML\Datasets\Labeled; +use Rubix\ML\Graph\Nodes\Ball; +use Rubix\ML\Helpers\Stats; +use Rubix\ML\Kernels\Distance\Distance; +use function Rubix\ML\argmax; class DualTreeBall extends Ball { protected float $longestDistanceInNode = INF; @@ -97,8 +97,8 @@ public function propagateSetChanges(array &$labelToSetId) { /** * Factory method to build a hypersphere by splitting the dataset into left and right clusters. * - * @param \OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled $dataset - * @param \OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance $kernel + * @param Rubix\ML\Datasets\Labeled $dataset + * @param Rubix\ML\Kernels\Distance\Distance $kernel * @return self */ public static function split(Labeled $dataset, Distance $kernel): self { diff --git a/lib/Clustering/DualTreeClique.php b/lib/Clustering/DualTreeClique.php index 66fc0884..52f1522d 100644 --- a/lib/Clustering/DualTreeClique.php +++ b/lib/Clustering/DualTreeClique.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled; -use OCA\Recognize\Vendor\Rubix\ML\Graph\Nodes\Clique; -use OCA\Recognize\Vendor\Rubix\ML\Helpers\Stats; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance; -use function OCA\Recognize\Vendor\Rubix\ML\argmax; +use Rubix\ML\Datasets\Labeled; +use Rubix\ML\Graph\Nodes\Clique; +use Rubix\ML\Helpers\Stats; +use Rubix\ML\Kernels\Distance\Distance; +use function Rubix\ML\argmax; class DualTreeClique extends Clique { protected float $longestDistanceInNode = INF; @@ -80,8 +80,8 @@ public function propagateSetChanges(array &$labelToSetId) { /** * Terminate a branch with a dataset. * - * @param \OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled $dataset - * @param \OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance $kernel + * @param Rubix\ML\Datasets\Labeled $dataset + * @param Rubix\ML\Kernels\Distance\Distance $kernel * @return self */ public static function terminate(Labeled $dataset, Distance $kernel): self { diff --git a/lib/Clustering/HDBSCAN.php b/lib/Clustering/HDBSCAN.php index 4c23658c..c4d5f025 100644 --- a/lib/Clustering/HDBSCAN.php +++ b/lib/Clustering/HDBSCAN.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled; -use OCA\Recognize\Vendor\Rubix\ML\Estimator; -use OCA\Recognize\Vendor\Rubix\ML\EstimatorType; -use OCA\Recognize\Vendor\Rubix\ML\Helpers\Params; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance; +use Rubix\ML\Datasets\Labeled; +use Rubix\ML\Estimator; +use Rubix\ML\EstimatorType; +use Rubix\ML\Helpers\Params; +use Rubix\ML\Kernels\Distance\Distance; /** * HDBSCAN @@ -60,7 +60,7 @@ class HDBSCAN { * The distance kernel used for computing interpoint distances. * */ - protected \OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled $dataset; + protected Rubix\ML\Datasets\Labeled $dataset; @@ -71,7 +71,7 @@ class HDBSCAN { * @param int $sampleSize * @param float $maxEdgeLength * @param Distance $kernel - * @throws \OCA\Recognize\Vendor\Rubix\ML\Exceptions\InvalidArgumentException + * @throws Rubix\ML\Exceptions\InvalidArgumentException */ public function __construct(Labeled $dataset, int $minClusterSize = 5, int $sampleSize = 5, array $oldCoreDistances = [], ?Distance $kernel = null, bool $useTrueMst = true) { if ($minClusterSize < 2) { @@ -97,7 +97,7 @@ public function getCoreNeighborDistances(): array { /** * Return the estimator type. * - * @return \OCA\Recognize\Vendor\Rubix\ML\EstimatorType + * @return Rubix\ML\EstimatorType */ public function type(): EstimatorType { return EstimatorType::clusterer(); @@ -106,7 +106,7 @@ public function type(): EstimatorType { /** * Return the data types that the estimator is compatible with. * - * @return list<\OCA\Recognize\Vendor\Rubix\ML\DataType> + * @return list */ public function compatibility(): array { return $this->mstSolver->kernel()->compatibility(); diff --git a/lib/Clustering/MrdBallTree.php b/lib/Clustering/MrdBallTree.php index 00a6b4fc..48aa6abf 100644 --- a/lib/Clustering/MrdBallTree.php +++ b/lib/Clustering/MrdBallTree.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled; -use OCA\Recognize\Vendor\Rubix\ML\Graph\Nodes\Ball; -use OCA\Recognize\Vendor\Rubix\ML\Graph\Nodes\Hypersphere; -use OCA\Recognize\Vendor\Rubix\ML\Graph\Trees\BallTree; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance; +use Rubix\ML\Datasets\Labeled; +use Rubix\ML\Graph\Nodes\Ball; +use Rubix\ML\Graph\Nodes\Hypersphere; +use Rubix\ML\Graph\Trees\BallTree; +use Rubix\ML\Kernels\Distance\Distance; class MrdBallTree extends BallTree { private ?Labeled $dataset = null; @@ -25,8 +25,8 @@ class MrdBallTree extends BallTree { /** * @param int $maxLeafSize * @param int $coreDistSampleSize - * @param \OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance|null $kernel - * @throws \OCA\Recognize\Vendor\Rubix\ML\Exceptions\InvalidArgumentException + * @param Rubix\ML\Kernels\Distance\Distance|null $kernel + * @throws Rubix\ML\Exceptions\InvalidArgumentException */ public function __construct(int $maxLeafSize = 30, int $sampleSize = 5, ?Distance $kernel = null) { if ($maxLeafSize < 1) { @@ -462,7 +462,7 @@ public function cachedComputeNative($a, array $a_vector, $b, array $b_vector, bo * * @param int|string $sampleLabel * @param bool $useCachedValues - * @throws \OCA\Recognize\Vendor\Rubix\ML\Exceptions\InvalidArgumentException + * @throws Rubix\ML\Exceptions\InvalidArgumentException * @return array{list,list} */ public function getCoreNeighbors($sampleLabel, bool $useCachedValues = true): array { @@ -546,8 +546,8 @@ public function getCoreNeighbors($sampleLabel, bool $useCachedValues = true): ar * * @param int $sampleLabel * @param float $radius - * @throws \OCA\Recognize\Vendor\Rubix\ML\Exceptions\InvalidArgumentException - * @throws \OCA\Recognize\Vendor\Rubix\ML\Exceptions\RuntimeException + * @throws Rubix\ML\Exceptions\InvalidArgumentException + * @throws Rubix\ML\Exceptions\RuntimeException * @return array{list,list} */ public function cachedRange($sampleLabel, float $radius): array { @@ -624,8 +624,8 @@ public function cachedRange($sampleLabel, float $radius): array { * * @internal * - * @param \OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled $dataset - * @throws \OCA\Recognize\Vendor\Rubix\ML\Exceptions\InvalidArgumentException + * @param Rubix\ML\Datasets\Labeled $dataset + * @throws Rubix\ML\Exceptions\InvalidArgumentException */ public function grow(Labeled $dataset): void { $this->dataset = $dataset; diff --git a/lib/Clustering/MstSolver.php b/lib/Clustering/MstSolver.php index dccda0a5..d88a3383 100644 --- a/lib/Clustering/MstSolver.php +++ b/lib/Clustering/MstSolver.php @@ -6,8 +6,8 @@ namespace OCA\Recognize\Clustering; -use OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance; +use Rubix\ML\Datasets\Labeled; +use Rubix\ML\Kernels\Distance\Distance; class MstSolver { private MrdBallTree $tree; diff --git a/lib/Clustering/SquaredDistance.php b/lib/Clustering/SquaredDistance.php index 1529eed0..87b98f61 100644 --- a/lib/Clustering/SquaredDistance.php +++ b/lib/Clustering/SquaredDistance.php @@ -6,8 +6,8 @@ namespace OCA\Recognize\Clustering; -use OCA\Recognize\Vendor\Rubix\ML\DataType; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Distance; +use Rubix\ML\DataType; +use Rubix\ML\Kernels\Distance\Distance; /** * Squared distance @@ -24,7 +24,7 @@ class SquaredDistance implements Distance { * * @internal * - * @return list<\OCA\Recognize\Vendor\Rubix\ML\DataType> + * @return list */ public function compatibility(): array { return [ diff --git a/lib/Dav/Faces/FacePhoto.php b/lib/Dav/Faces/FacePhoto.php index be632732..50290a6b 100644 --- a/lib/Dav/Faces/FacePhoto.php +++ b/lib/Dav/Faces/FacePhoto.php @@ -16,7 +16,7 @@ use OCP\IPreview; use OCP\ITagManager; use OCP\ITags; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Euclidean; +use Rubix\ML\Kernels\Distance\Euclidean; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\IFile; diff --git a/lib/Service/FaceClusterAnalyzer.php b/lib/Service/FaceClusterAnalyzer.php index e786b6d0..afe33c51 100644 --- a/lib/Service/FaceClusterAnalyzer.php +++ b/lib/Service/FaceClusterAnalyzer.php @@ -11,8 +11,8 @@ use OCA\Recognize\Db\FaceClusterMapper; use OCA\Recognize\Db\FaceDetection; use OCA\Recognize\Db\FaceDetectionMapper; -use OCA\Recognize\Vendor\Rubix\ML\Datasets\Labeled; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Euclidean; +use Rubix\ML\Datasets\Labeled; +use Rubix\ML\Kernels\Distance\Euclidean; class FaceClusterAnalyzer { public const MIN_DATASET_SIZE = 30; diff --git a/tests/ClusterTest.php b/tests/ClusterTest.php index 6793cdae..2ff11eb0 100644 --- a/tests/ClusterTest.php +++ b/tests/ClusterTest.php @@ -5,7 +5,7 @@ use OCA\Recognize\Db\FaceDetectionMapper; use OCA\Recognize\Service\FaceClusterAnalyzer; use OCA\Recognize\Service\Logger; -use OCA\Recognize\Vendor\Rubix\ML\Kernels\Distance\Euclidean; +use Rubix\ML\Kernels\Distance\Euclidean; use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; diff --git a/vendor-bin/mozart/composer.json b/vendor-bin/mozart/composer.json deleted file mode 100644 index f2b0a29c..00000000 --- a/vendor-bin/mozart/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "coenjacobs/mozart": "^0.7.1" - } -} From c414523326ada7c3e286147abb4b03f5aa71ca67 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 8 Mar 2023 13:08:58 +0100 Subject: [PATCH 2/7] fix(psalm,cs): Remove lib/Vendor from ignored paths Signed-off-by: Marcel Klehr --- .php-cs-fixer.dist.php | 2 -- psalm.xml | 1 - 2 files changed, 3 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index e2f0eb56..f37f3b69 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -12,7 +12,5 @@ ->notPath('l10n') ->notPath('src') ->notPath('vendor') - ->notPath('lib/Vendor') - ->notPath('lib/autoload') ->in(__DIR__); return $config; diff --git a/psalm.xml b/psalm.xml index 53e5fa04..da15746f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -14,7 +14,6 @@ - From 3c09863d264a5229635cbb7881ede8fd5c8080d2 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 8 Mar 2023 13:17:47 +0100 Subject: [PATCH 3/7] fix(dependencies): Revert mozart functions fix Signed-off-by: Marcel Klehr --- lib/AppInfo/Application.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index a442e2d3..d0101135 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -43,11 +43,6 @@ public function __construct() { public function register(IRegistrationContext $context): void { @include_once __DIR__ . '/../../vendor/autoload.php'; - // Load Rubix functions because Mozart doesn't pick up on them - // see https://github.com/coenjacobs/mozart/issues/66 - require_once(__DIR__.'/../Vendor/Rubix/ML/functions.php'); - require_once(__DIR__.'/../Vendor/Rubix/ML/constants.php'); - /** Register $principalBackend for the DAV collection */ $context->registerServiceAlias('principalBackend', Principal::class); } From ce4e14a535a051d6e0396b868a71aea85119974d Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 8 Mar 2023 13:22:14 +0100 Subject: [PATCH 4/7] fix(types): Fix Rubix type refs Signed-off-by: Marcel Klehr --- lib/Clustering/DualTreeBall.php | 14 +++++++------- lib/Clustering/DualTreeClique.php | 14 +++++++------- lib/Clustering/HDBSCAN.php | 18 +++++++++--------- lib/Clustering/MrdBallTree.php | 24 ++++++++++++------------ lib/Clustering/MstSolver.php | 4 ++-- lib/Clustering/SquaredDistance.php | 6 +++--- lib/Dav/Faces/FacePhoto.php | 2 +- lib/Service/FaceClusterAnalyzer.php | 4 ++-- tests/ClusterTest.php | 2 +- 9 files changed, 44 insertions(+), 44 deletions(-) diff --git a/lib/Clustering/DualTreeBall.php b/lib/Clustering/DualTreeBall.php index ba78a86a..b27e7ad0 100644 --- a/lib/Clustering/DualTreeBall.php +++ b/lib/Clustering/DualTreeBall.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use Rubix\ML\Datasets\Labeled; -use Rubix\ML\Graph\Nodes\Ball; -use Rubix\ML\Helpers\Stats; -use Rubix\ML\Kernels\Distance\Distance; -use function Rubix\ML\argmax; +use RubixML\Datasets\Labeled; +use RubixML\Graph\Nodes\Ball; +use RubixML\Helpers\Stats; +use RubixML\Kernels\Distance\Distance; +use function RubixML\argmax; class DualTreeBall extends Ball { protected float $longestDistanceInNode = INF; @@ -97,8 +97,8 @@ public function propagateSetChanges(array &$labelToSetId) { /** * Factory method to build a hypersphere by splitting the dataset into left and right clusters. * - * @param Rubix\ML\Datasets\Labeled $dataset - * @param Rubix\ML\Kernels\Distance\Distance $kernel + * @param RubixML\Datasets\Labeled $dataset + * @param RubixML\Kernels\Distance\Distance $kernel * @return self */ public static function split(Labeled $dataset, Distance $kernel): self { diff --git a/lib/Clustering/DualTreeClique.php b/lib/Clustering/DualTreeClique.php index 52f1522d..d2426d1b 100644 --- a/lib/Clustering/DualTreeClique.php +++ b/lib/Clustering/DualTreeClique.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use Rubix\ML\Datasets\Labeled; -use Rubix\ML\Graph\Nodes\Clique; -use Rubix\ML\Helpers\Stats; -use Rubix\ML\Kernels\Distance\Distance; -use function Rubix\ML\argmax; +use RubixML\Datasets\Labeled; +use RubixML\Graph\Nodes\Clique; +use RubixML\Helpers\Stats; +use RubixML\Kernels\Distance\Distance; +use function RubixML\argmax; class DualTreeClique extends Clique { protected float $longestDistanceInNode = INF; @@ -80,8 +80,8 @@ public function propagateSetChanges(array &$labelToSetId) { /** * Terminate a branch with a dataset. * - * @param Rubix\ML\Datasets\Labeled $dataset - * @param Rubix\ML\Kernels\Distance\Distance $kernel + * @param RubixML\Datasets\Labeled $dataset + * @param RubixML\Kernels\Distance\Distance $kernel * @return self */ public static function terminate(Labeled $dataset, Distance $kernel): self { diff --git a/lib/Clustering/HDBSCAN.php b/lib/Clustering/HDBSCAN.php index c4d5f025..6be8fc4e 100644 --- a/lib/Clustering/HDBSCAN.php +++ b/lib/Clustering/HDBSCAN.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use Rubix\ML\Datasets\Labeled; -use Rubix\ML\Estimator; -use Rubix\ML\EstimatorType; -use Rubix\ML\Helpers\Params; -use Rubix\ML\Kernels\Distance\Distance; +use RubixML\Datasets\Labeled; +use RubixML\Estimator; +use RubixML\EstimatorType; +use RubixML\Helpers\Params; +use RubixML\Kernels\Distance\Distance; /** * HDBSCAN @@ -60,7 +60,7 @@ class HDBSCAN { * The distance kernel used for computing interpoint distances. * */ - protected Rubix\ML\Datasets\Labeled $dataset; + protected RubixML\Datasets\Labeled $dataset; @@ -71,7 +71,7 @@ class HDBSCAN { * @param int $sampleSize * @param float $maxEdgeLength * @param Distance $kernel - * @throws Rubix\ML\Exceptions\InvalidArgumentException + * @throws RubixML\Exceptions\InvalidArgumentException */ public function __construct(Labeled $dataset, int $minClusterSize = 5, int $sampleSize = 5, array $oldCoreDistances = [], ?Distance $kernel = null, bool $useTrueMst = true) { if ($minClusterSize < 2) { @@ -97,7 +97,7 @@ public function getCoreNeighborDistances(): array { /** * Return the estimator type. * - * @return Rubix\ML\EstimatorType + * @return RubixML\EstimatorType */ public function type(): EstimatorType { return EstimatorType::clusterer(); @@ -106,7 +106,7 @@ public function type(): EstimatorType { /** * Return the data types that the estimator is compatible with. * - * @return list + * @return list */ public function compatibility(): array { return $this->mstSolver->kernel()->compatibility(); diff --git a/lib/Clustering/MrdBallTree.php b/lib/Clustering/MrdBallTree.php index 48aa6abf..a674454e 100644 --- a/lib/Clustering/MrdBallTree.php +++ b/lib/Clustering/MrdBallTree.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use Rubix\ML\Datasets\Labeled; -use Rubix\ML\Graph\Nodes\Ball; -use Rubix\ML\Graph\Nodes\Hypersphere; -use Rubix\ML\Graph\Trees\BallTree; -use Rubix\ML\Kernels\Distance\Distance; +use RubixML\Datasets\Labeled; +use RubixML\Graph\Nodes\Ball; +use RubixML\Graph\Nodes\Hypersphere; +use RubixML\Graph\Trees\BallTree; +use RubixML\Kernels\Distance\Distance; class MrdBallTree extends BallTree { private ?Labeled $dataset = null; @@ -25,8 +25,8 @@ class MrdBallTree extends BallTree { /** * @param int $maxLeafSize * @param int $coreDistSampleSize - * @param Rubix\ML\Kernels\Distance\Distance|null $kernel - * @throws Rubix\ML\Exceptions\InvalidArgumentException + * @param RubixML\Kernels\Distance\Distance|null $kernel + * @throws RubixML\Exceptions\InvalidArgumentException */ public function __construct(int $maxLeafSize = 30, int $sampleSize = 5, ?Distance $kernel = null) { if ($maxLeafSize < 1) { @@ -462,7 +462,7 @@ public function cachedComputeNative($a, array $a_vector, $b, array $b_vector, bo * * @param int|string $sampleLabel * @param bool $useCachedValues - * @throws Rubix\ML\Exceptions\InvalidArgumentException + * @throws RubixML\Exceptions\InvalidArgumentException * @return array{list,list} */ public function getCoreNeighbors($sampleLabel, bool $useCachedValues = true): array { @@ -546,8 +546,8 @@ public function getCoreNeighbors($sampleLabel, bool $useCachedValues = true): ar * * @param int $sampleLabel * @param float $radius - * @throws Rubix\ML\Exceptions\InvalidArgumentException - * @throws Rubix\ML\Exceptions\RuntimeException + * @throws RubixML\Exceptions\InvalidArgumentException + * @throws RubixML\Exceptions\RuntimeException * @return array{list,list} */ public function cachedRange($sampleLabel, float $radius): array { @@ -624,8 +624,8 @@ public function cachedRange($sampleLabel, float $radius): array { * * @internal * - * @param Rubix\ML\Datasets\Labeled $dataset - * @throws Rubix\ML\Exceptions\InvalidArgumentException + * @param RubixML\Datasets\Labeled $dataset + * @throws RubixML\Exceptions\InvalidArgumentException */ public function grow(Labeled $dataset): void { $this->dataset = $dataset; diff --git a/lib/Clustering/MstSolver.php b/lib/Clustering/MstSolver.php index d88a3383..a5e79963 100644 --- a/lib/Clustering/MstSolver.php +++ b/lib/Clustering/MstSolver.php @@ -6,8 +6,8 @@ namespace OCA\Recognize\Clustering; -use Rubix\ML\Datasets\Labeled; -use Rubix\ML\Kernels\Distance\Distance; +use RubixML\Datasets\Labeled; +use RubixML\Kernels\Distance\Distance; class MstSolver { private MrdBallTree $tree; diff --git a/lib/Clustering/SquaredDistance.php b/lib/Clustering/SquaredDistance.php index 87b98f61..6c7bba0a 100644 --- a/lib/Clustering/SquaredDistance.php +++ b/lib/Clustering/SquaredDistance.php @@ -6,8 +6,8 @@ namespace OCA\Recognize\Clustering; -use Rubix\ML\DataType; -use Rubix\ML\Kernels\Distance\Distance; +use RubixML\DataType; +use RubixML\Kernels\Distance\Distance; /** * Squared distance @@ -24,7 +24,7 @@ class SquaredDistance implements Distance { * * @internal * - * @return list + * @return list */ public function compatibility(): array { return [ diff --git a/lib/Dav/Faces/FacePhoto.php b/lib/Dav/Faces/FacePhoto.php index 50290a6b..5878c3f4 100644 --- a/lib/Dav/Faces/FacePhoto.php +++ b/lib/Dav/Faces/FacePhoto.php @@ -16,7 +16,7 @@ use OCP\IPreview; use OCP\ITagManager; use OCP\ITags; -use Rubix\ML\Kernels\Distance\Euclidean; +use RubixML\Kernels\Distance\Euclidean; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\IFile; diff --git a/lib/Service/FaceClusterAnalyzer.php b/lib/Service/FaceClusterAnalyzer.php index afe33c51..8a319a42 100644 --- a/lib/Service/FaceClusterAnalyzer.php +++ b/lib/Service/FaceClusterAnalyzer.php @@ -11,8 +11,8 @@ use OCA\Recognize\Db\FaceClusterMapper; use OCA\Recognize\Db\FaceDetection; use OCA\Recognize\Db\FaceDetectionMapper; -use Rubix\ML\Datasets\Labeled; -use Rubix\ML\Kernels\Distance\Euclidean; +use RubixML\Datasets\Labeled; +use RubixML\Kernels\Distance\Euclidean; class FaceClusterAnalyzer { public const MIN_DATASET_SIZE = 30; diff --git a/tests/ClusterTest.php b/tests/ClusterTest.php index 2ff11eb0..03b2a89d 100644 --- a/tests/ClusterTest.php +++ b/tests/ClusterTest.php @@ -5,7 +5,7 @@ use OCA\Recognize\Db\FaceDetectionMapper; use OCA\Recognize\Service\FaceClusterAnalyzer; use OCA\Recognize\Service\Logger; -use Rubix\ML\Kernels\Distance\Euclidean; +use RubixML\Kernels\Distance\Euclidean; use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; From 5d198674585741249a17635ed7e240807f02a73b Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 8 Mar 2023 13:29:43 +0100 Subject: [PATCH 5/7] fix(types): Fix Rubix type refs Signed-off-by: Marcel Klehr --- lib/Clustering/DualTreeBall.php | 14 +++++++------- lib/Clustering/DualTreeClique.php | 14 +++++++------- lib/Clustering/HDBSCAN.php | 18 +++++++++--------- lib/Clustering/MrdBallTree.php | 24 ++++++++++++------------ lib/Clustering/MstSolver.php | 4 ++-- lib/Clustering/SquaredDistance.php | 6 +++--- lib/Dav/Faces/FacePhoto.php | 2 +- lib/Service/FaceClusterAnalyzer.php | 4 ++-- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/lib/Clustering/DualTreeBall.php b/lib/Clustering/DualTreeBall.php index b27e7ad0..3e7bbaad 100644 --- a/lib/Clustering/DualTreeBall.php +++ b/lib/Clustering/DualTreeBall.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use RubixML\Datasets\Labeled; -use RubixML\Graph\Nodes\Ball; -use RubixML\Helpers\Stats; -use RubixML\Kernels\Distance\Distance; -use function RubixML\argmax; +use \Rubix\ML\Datasets\Labeled; +use \Rubix\ML\Graph\Nodes\Ball; +use \Rubix\ML\Helpers\Stats; +use \Rubix\ML\Kernels\Distance\Distance; +use function \Rubix\ML\argmax; class DualTreeBall extends Ball { protected float $longestDistanceInNode = INF; @@ -97,8 +97,8 @@ public function propagateSetChanges(array &$labelToSetId) { /** * Factory method to build a hypersphere by splitting the dataset into left and right clusters. * - * @param RubixML\Datasets\Labeled $dataset - * @param RubixML\Kernels\Distance\Distance $kernel + * @param \Rubix\ML\Datasets\Labeled $dataset + * @param \Rubix\ML\Kernels\Distance\Distance $kernel * @return self */ public static function split(Labeled $dataset, Distance $kernel): self { diff --git a/lib/Clustering/DualTreeClique.php b/lib/Clustering/DualTreeClique.php index d2426d1b..01d3b96e 100644 --- a/lib/Clustering/DualTreeClique.php +++ b/lib/Clustering/DualTreeClique.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use RubixML\Datasets\Labeled; -use RubixML\Graph\Nodes\Clique; -use RubixML\Helpers\Stats; -use RubixML\Kernels\Distance\Distance; -use function RubixML\argmax; +use \Rubix\ML\Datasets\Labeled; +use \Rubix\ML\Graph\Nodes\Clique; +use \Rubix\ML\Helpers\Stats; +use \Rubix\ML\Kernels\Distance\Distance; +use function \Rubix\ML\argmax; class DualTreeClique extends Clique { protected float $longestDistanceInNode = INF; @@ -80,8 +80,8 @@ public function propagateSetChanges(array &$labelToSetId) { /** * Terminate a branch with a dataset. * - * @param RubixML\Datasets\Labeled $dataset - * @param RubixML\Kernels\Distance\Distance $kernel + * @param \Rubix\ML\Datasets\Labeled $dataset + * @param \Rubix\ML\Kernels\Distance\Distance $kernel * @return self */ public static function terminate(Labeled $dataset, Distance $kernel): self { diff --git a/lib/Clustering/HDBSCAN.php b/lib/Clustering/HDBSCAN.php index 6be8fc4e..37bd7030 100644 --- a/lib/Clustering/HDBSCAN.php +++ b/lib/Clustering/HDBSCAN.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use RubixML\Datasets\Labeled; -use RubixML\Estimator; -use RubixML\EstimatorType; -use RubixML\Helpers\Params; -use RubixML\Kernels\Distance\Distance; +use \Rubix\ML\Datasets\Labeled; +use \Rubix\ML\Estimator; +use \Rubix\ML\EstimatorType; +use \Rubix\ML\Helpers\Params; +use \Rubix\ML\Kernels\Distance\Distance; /** * HDBSCAN @@ -60,7 +60,7 @@ class HDBSCAN { * The distance kernel used for computing interpoint distances. * */ - protected RubixML\Datasets\Labeled $dataset; + protected \Rubix\ML\Datasets\Labeled $dataset; @@ -71,7 +71,7 @@ class HDBSCAN { * @param int $sampleSize * @param float $maxEdgeLength * @param Distance $kernel - * @throws RubixML\Exceptions\InvalidArgumentException + * @throws \Rubix\ML\Exceptions\InvalidArgumentException */ public function __construct(Labeled $dataset, int $minClusterSize = 5, int $sampleSize = 5, array $oldCoreDistances = [], ?Distance $kernel = null, bool $useTrueMst = true) { if ($minClusterSize < 2) { @@ -97,7 +97,7 @@ public function getCoreNeighborDistances(): array { /** * Return the estimator type. * - * @return RubixML\EstimatorType + * @return \Rubix\ML\EstimatorType */ public function type(): EstimatorType { return EstimatorType::clusterer(); @@ -106,7 +106,7 @@ public function type(): EstimatorType { /** * Return the data types that the estimator is compatible with. * - * @return list + * @return list<\Rubix\ML\DataType> */ public function compatibility(): array { return $this->mstSolver->kernel()->compatibility(); diff --git a/lib/Clustering/MrdBallTree.php b/lib/Clustering/MrdBallTree.php index a674454e..53d175f4 100644 --- a/lib/Clustering/MrdBallTree.php +++ b/lib/Clustering/MrdBallTree.php @@ -6,11 +6,11 @@ namespace OCA\Recognize\Clustering; -use RubixML\Datasets\Labeled; -use RubixML\Graph\Nodes\Ball; -use RubixML\Graph\Nodes\Hypersphere; -use RubixML\Graph\Trees\BallTree; -use RubixML\Kernels\Distance\Distance; +use \Rubix\ML\Datasets\Labeled; +use \Rubix\ML\Graph\Nodes\Ball; +use \Rubix\ML\Graph\Nodes\Hypersphere; +use \Rubix\ML\Graph\Trees\BallTree; +use \Rubix\ML\Kernels\Distance\Distance; class MrdBallTree extends BallTree { private ?Labeled $dataset = null; @@ -25,8 +25,8 @@ class MrdBallTree extends BallTree { /** * @param int $maxLeafSize * @param int $coreDistSampleSize - * @param RubixML\Kernels\Distance\Distance|null $kernel - * @throws RubixML\Exceptions\InvalidArgumentException + * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @throws \Rubix\ML\Exceptions\InvalidArgumentException */ public function __construct(int $maxLeafSize = 30, int $sampleSize = 5, ?Distance $kernel = null) { if ($maxLeafSize < 1) { @@ -462,7 +462,7 @@ public function cachedComputeNative($a, array $a_vector, $b, array $b_vector, bo * * @param int|string $sampleLabel * @param bool $useCachedValues - * @throws RubixML\Exceptions\InvalidArgumentException + * @throws \Rubix\ML\Exceptions\InvalidArgumentException * @return array{list,list} */ public function getCoreNeighbors($sampleLabel, bool $useCachedValues = true): array { @@ -546,8 +546,8 @@ public function getCoreNeighbors($sampleLabel, bool $useCachedValues = true): ar * * @param int $sampleLabel * @param float $radius - * @throws RubixML\Exceptions\InvalidArgumentException - * @throws RubixML\Exceptions\RuntimeException + * @throws \Rubix\ML\Exceptions\InvalidArgumentException + * @throws \Rubix\ML\Exceptions\RuntimeException * @return array{list,list} */ public function cachedRange($sampleLabel, float $radius): array { @@ -624,8 +624,8 @@ public function cachedRange($sampleLabel, float $radius): array { * * @internal * - * @param RubixML\Datasets\Labeled $dataset - * @throws RubixML\Exceptions\InvalidArgumentException + * @param \Rubix\ML\Datasets\Labeled $dataset + * @throws \Rubix\ML\Exceptions\InvalidArgumentException */ public function grow(Labeled $dataset): void { $this->dataset = $dataset; diff --git a/lib/Clustering/MstSolver.php b/lib/Clustering/MstSolver.php index a5e79963..70b8cbd4 100644 --- a/lib/Clustering/MstSolver.php +++ b/lib/Clustering/MstSolver.php @@ -6,8 +6,8 @@ namespace OCA\Recognize\Clustering; -use RubixML\Datasets\Labeled; -use RubixML\Kernels\Distance\Distance; +use \Rubix\ML\Datasets\Labeled; +use \Rubix\ML\Kernels\Distance\Distance; class MstSolver { private MrdBallTree $tree; diff --git a/lib/Clustering/SquaredDistance.php b/lib/Clustering/SquaredDistance.php index 6c7bba0a..bba0fd2f 100644 --- a/lib/Clustering/SquaredDistance.php +++ b/lib/Clustering/SquaredDistance.php @@ -6,8 +6,8 @@ namespace OCA\Recognize\Clustering; -use RubixML\DataType; -use RubixML\Kernels\Distance\Distance; +use \Rubix\ML\DataType; +use \Rubix\ML\Kernels\Distance\Distance; /** * Squared distance @@ -24,7 +24,7 @@ class SquaredDistance implements Distance { * * @internal * - * @return list + * @return list<\Rubix\ML\DataType> */ public function compatibility(): array { return [ diff --git a/lib/Dav/Faces/FacePhoto.php b/lib/Dav/Faces/FacePhoto.php index 5878c3f4..64c778fc 100644 --- a/lib/Dav/Faces/FacePhoto.php +++ b/lib/Dav/Faces/FacePhoto.php @@ -16,7 +16,7 @@ use OCP\IPreview; use OCP\ITagManager; use OCP\ITags; -use RubixML\Kernels\Distance\Euclidean; +use \Rubix\ML\Kernels\Distance\Euclidean; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\IFile; diff --git a/lib/Service/FaceClusterAnalyzer.php b/lib/Service/FaceClusterAnalyzer.php index 8a319a42..a8e5ea88 100644 --- a/lib/Service/FaceClusterAnalyzer.php +++ b/lib/Service/FaceClusterAnalyzer.php @@ -11,8 +11,8 @@ use OCA\Recognize\Db\FaceClusterMapper; use OCA\Recognize\Db\FaceDetection; use OCA\Recognize\Db\FaceDetectionMapper; -use RubixML\Datasets\Labeled; -use RubixML\Kernels\Distance\Euclidean; +use \Rubix\ML\Datasets\Labeled; +use \Rubix\ML\Kernels\Distance\Euclidean; class FaceClusterAnalyzer { public const MIN_DATASET_SIZE = 30; From 19b664e117b1a8720a3221b4fbd340b22df5323e Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 8 Mar 2023 13:29:54 +0100 Subject: [PATCH 6/7] fix(psalm): Update psalm basline Signed-off-by: Marcel Klehr --- psalm-baseline.xml | 109 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 83 insertions(+), 26 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index ad6610b5..5f528324 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -194,21 +194,29 @@ $distances + + Ball + Stats::mean($values) + + + Stats::mean($values) + compute + compute + isContinuous + new self($center, $radius, $subsets) + spatialSplit + $longestDistance $setId - + $values $values - argmax($distances) - argmax($distances) - - $center - $center + $column $leftCentroid $leftCentroid @@ -216,8 +224,7 @@ $sample $sample - - $center[] + $retVal $setId $this->longestDistanceInNode @@ -232,11 +239,6 @@ $this->setId $this->setId - - argmax($distances) - argmax($distances) - argmax(array_count_values($values)) - propagateSetChanges propagateSetChanges @@ -248,13 +250,21 @@ $distances + + Clique + Stats::mean($values) + + + Stats::mean($values) + compute + isContinuous + new self($dataset, $center, $radius) + $values $values - - $center - $center + $column $sample @@ -265,19 +275,23 @@ $labelToSetId[array_pop($labels)] - - $center[] + $label $values $labelToSetId[$this->dataset->label(0)] - - argmax(array_count_values($values)) - + + EstimatorType::clusterer() + + + EstimatorType::clusterer() + Params::stringify($this->params()) + compatibility + $flatClusters list<MstClusterer> @@ -287,6 +301,36 @@ + + center + center + center + center + cleanup + compute + compute + compute + compute + dataset + dataset + dataset + dataset + dataset + dataset + isPoint + radius + radius + radius + radius + radius + radius + radius + radius + radius + radius + radius + subsets + Labeled @@ -685,6 +729,14 @@ $referenceRight $referenceRight + + radius + radius + radius + radius + radius + radius + $edges @@ -831,6 +883,12 @@ + + DataType::continuous() + + + DataType::continuous() + $a $b @@ -1157,6 +1215,10 @@ + + compute + compute + $clusterId $sampled @@ -1184,9 +1246,4 @@ (int)$row['storage_id'] - - - Symfony\Polyfill\Intl\NEXTCLOUDRECOGNIZE_Normalizer\Normalizer - - From b8f50d4bf94e0fa4559e4373400713a8ca1306b3 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 8 Mar 2023 13:42:49 +0100 Subject: [PATCH 7/7] Fix type ref Signed-off-by: Marcel Klehr --- tests/ClusterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ClusterTest.php b/tests/ClusterTest.php index 03b2a89d..fc79748e 100644 --- a/tests/ClusterTest.php +++ b/tests/ClusterTest.php @@ -5,7 +5,7 @@ use OCA\Recognize\Db\FaceDetectionMapper; use OCA\Recognize\Service\FaceClusterAnalyzer; use OCA\Recognize\Service\Logger; -use RubixML\Kernels\Distance\Euclidean; +use \Rubix\ML\Kernels\Distance\Euclidean; use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase;