Closed wandell closed 8 years ago
Sorry for all the messages ... The '//' bug above might have been unimportant. Not sure. Here is a similar failure, but without the '//' error. Sigh.
%% ieInit
%% Create the rdt object and open browser rd = RdtClient('isetbio'); rd =
repositoryName: isetbio repositoryUrl: http://52.32.77.154/repository/isetbio serverUrl: http://52.32.77.154/ workingRemotePath: resources/scene username: guest password: **** verbosity: 0
%% Our files are all version '1' at this point. fileVersion = '1';
% Here is an example remote directory. rd.crp('/resources/scene');
%% Problems here:
% Currently only returns 30 elements
% 'type' is not right because it says jpg when there are nef and pgm files
% as well
a = rd.listArtifacts;
a(1)
ans =
artifactId: 'RedRose'
description: ''
localPath: ''
name: ''
remotePath: 'resources/scenes/multiband/scien/2004'
repositoryId: 'isetbio'
type: 'mat'
url: [1x100 char]
version: '1'
%% Fetch the data artifacts s = rd.readArtifact(a(1).artifactId); Error using gradleFetchArtifact (line 100) error status 1 (:fetchIt FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':fetchIt'.
Could not resolve all dependencies for configuration ':fetch'. Could not find any matches for resources.scene:RedRose:+ as no versions of resources.scene:RedRose are available. Searched in the following locations: http://52.32.77.154/repository/isetbio/resources/scene/RedRose/maven-metadata.xml http://52.32.77.154/repository/isetbio/resources/scene/RedRose/ Required by: :gradle:unspecified
BUILD FAILED
Total time: 1.094 secs )
I think this is a matter of usage / incomplete documentation.
As written above, the read fails because readArtifact()
needs to know more than just the artifactId. It also needs to know the remote path where to find an artifact with that id.
Here is a revised version of the first example which should work better:
rdt = RdtClient('isetbio');
rdt.crp('');
artifacts = rdt.searchArtifacts('RedRose', 'type', 'mat');
dataCell = rdt.readArtifacts(artifacts);
data = dataCell{1}
This uses readArtifacts()
with an s. This method accepts a struct array of artifact metadata, as returned from searchArtifacts()
. It returns a cell array of the same size.
Here is another revised version, which should also read a single artifact. It provides the artifact id and remote path explicitly:
rdt = RdtClient('isetbio');
rdt.crp('');
artifacts = rdt.searchArtifacts('RedRose', 'type', 'mat');
data = rdt.readArtifact(artifacts(1).artifactId, 'remotePath', artifacts(1).remotePath);
Here is a revised version of the second example which should work.
rd = RdtClient('isetbio');
rd.crp('/resources/scene');
a = rd.listArtifacts();
s = rd.readArtifact(a(1).artifactId, 'remotePath', a(1).remotePath);
The reason this one failed is that the working remote path /resources/scene
is not the full path to the artifact we're trying to read resources/scenes/hyperspectral/harvard_database
. So we must supply that path explicitly.
We could equally use readArtifacts()
with an s, and pass in a struct array of with one or more search results.
dataCell = rd.readArtifacts(a(1:3));
data = dataCell{3}
Another issue was that listArtifacts()
was returning only 30 results when the correct number would have been higher.
9b632531eadd537b49088757262f2a2bacd1b9e8 fixes this bug. It raises the default limit from 30 results to 1000 results. It also adds a 'pageSize' parameter for listArtifacts()
which allows the caller to specify some other limit.
The last issue I see is about artifact types. As above,
% 'type' is not right because it says jpg when there are nef and pgm files as well
This seems related to #41, so I will take it up over there.
I think Ben answered all the questions I raised. Onward.
The matlab code below is failing. Please help. Thanks ...
rdt = RdtClient('isetbio'); % Works OK rdt.crp('');
rdt =
repositoryName: isetbio repositoryUrl: http://52.32.77.154/repository/isetbio serverUrl: http://52.32.77.154/ workingRemotePath: Root username: guest password: **** verbosity: 0
artifacts = rdt.searchArtifacts('RedRose','type','mat'); % Works OK artifacts =
% But the read fails, see comment below data = rdt.readArtifact(artifacts.artifactId);
%%%% % Returns the error from gradle (Note the http: address is ....isetbio//RedRose/, note the '//' after isetbio) %%%
What went wrong: Execution failed for task ':fetchIt'.