Skip to content

Commit

Permalink
Merge pull request #723 from nextcloud/revert/mozart
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelklehr authored Mar 8, 2023
2 parents 7cf3525 + b8f50d4 commit 622ce63
Show file tree
Hide file tree
Showing 17 changed files with 305 additions and 123 deletions.
2 changes: 0 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@
->notPath('l10n')
->notPath('src')
->notPath('vendor')
->notPath('lib/Vendor')
->notPath('lib/autoload')
->in(__DIR__);
return $config;
20 changes: 0 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand All @@ -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"
]
}
}
}
192 changes: 175 additions & 17 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Classifiers/Classifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions lib/Clustering/DualTreeBall.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 622ce63

Please sign in to comment.