Skip to content

Commit

Permalink
fix: modify the output style of list type fields to enable auto parse
Browse files Browse the repository at this point in the history
To enable auto parse of Yaml format, the output style of fields with one more elements was reorganized.
  • Loading branch information
haowang-bioinfo committed May 14, 2018
1 parent 81be856 commit d856b85
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions io/writeYaml.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function writeYaml(model,name)
%
% Benjamin Sanchez, 2018-04-11
% Simonas Marcisauskas, 2018-04-13
% Hao Wang, 2018-05-14
%

%Check that model is in RAVEN format:
Expand Down Expand Up @@ -191,9 +192,7 @@ function writeField(model,fid,fieldName,type,pos,name)
list = strrep(field{pos},' ',''); %Exception for eccodes
list = strsplit(list,';');
end
if length(list) == 1 && ~strcmp(list{1},'')
fprintf(fid,[' ' name ': ' list{1} '\n']);
elseif length(list) > 1
if ~strcmp(list{1},'')
fprintf(fid,[' ' name ':\n']);
for i = 1:length(list)
fprintf(fid,[' - ' list{i} '\n']);
Expand Down

0 comments on commit d856b85

Please sign in to comment.