Skip to content
Snippets Groups Projects
Commit 570a6f64 authored by Henry Luetcke's avatar Henry Luetcke Committed by Adam Laskowski
Browse files

fix issue in dataset download and add download to testing function

parent 2249420c
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -533,6 +533,10 @@ classdef OpenBis ...@@ -533,6 +533,10 @@ classdef OpenBis
parse(p, obj, dataset, files, varargin{:}); parse(p, obj, dataset, files, varargin{:});
a = p.Results; a = p.Results;
% ensure that files are passed as 1-N cell array (required for
% Matlab to Python conversion)
a.files = reshape(a.files, 1, numel(a.files));
dataset.download(pyargs('files', a.files, 'destination', a.destination, 'wait_until_finished', a.wait_until_finished, 'workers', int16(a.workers))); dataset.download(pyargs('files', a.files, 'destination', a.destination, 'wait_until_finished', a.wait_until_finished, 'workers', int16(a.workers)));
path_to_file = fullfile(a.destination, dataset.char, a.files); path_to_file = fullfile(a.destination, dataset.char, a.files);
......
...@@ -84,24 +84,38 @@ catch ...@@ -84,24 +84,38 @@ catch
rethrow(lasterror) rethrow(lasterror)
end end
% delete the dummy files
delete(file1); delete(file2);
%% 6. Download the created dataset %% 6. Download the created dataset
try
files = obi.get_dataset_files(dataset);
file_list = files.pathInDataSet(files.fileSize>0);
destination = sprintf('temp_%d%d%d%d%d', randi(9,1,5));
path_to_files = obi.dataset_download(dataset, file_list, 'destination', destination, ...
'wait_until_finished', true);
fprintf('\n%s - Successfully downloaded Dataset with permId %s to folder %s\n', ...
datestr(clock,31), char(dataset.permId), destination)
catch
disp('Could not download dataset')
rethrow(lasterror)
end
%% 7. Tear-down (delete everything, optional) %% 7. Tear-down (delete everything, optional)
if teardown if teardown
fprintf('\n\n%s - Starting tear-down', datestr(clock,31)) fprintf('\n\n%s - Starting tear-down', datestr(clock,31))
% delete experiment % delete the created local files
delete(file1); delete(file2); rmdir(destination, 's');
fprintf('\n%s - Successfully deleted local files\n', datestr(clock,31))
% delete openBIS experiment
obi.delete_experiment(exp, 'created by Matlab-openBIS toolbox test function'); obi.delete_experiment(exp, 'created by Matlab-openBIS toolbox test function');
fprintf('\n%s - Successfully deleted Experiment %s\n', datestr(clock,31), exp_name) fprintf('\n%s - Successfully deleted Experiment %s\n', datestr(clock,31), exp_name)
% delete project
% delete openBIS project
obi.delete_project(project_name, 'created by Matlab-openBIS toolbox test function'); obi.delete_project(project_name, 'created by Matlab-openBIS toolbox test function');
fprintf('\n%s - Successfully deleted Project %s\n', datestr(clock,31), project_name) fprintf('\n%s - Successfully deleted Project %s\n', datestr(clock,31), project_name)
% delete space
% delete openBIS space
obi.delete_space(space, 'created by Matlab-openBIS toolbox test function'); obi.delete_space(space, 'created by Matlab-openBIS toolbox test function');
fprintf('\n%s - Successfully deleted Space %s\n', datestr(clock,31), space_name) fprintf('\n%s - Successfully deleted Space %s\n', datestr(clock,31), space_name)
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment