Skip to content

Commit

Permalink
Require ensemble to load variables in fixed order
Browse files Browse the repository at this point in the history
  • Loading branch information
JonKing93 committed Jul 4, 2021
1 parent 1bb326d commit 440d75f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions @ensemble/loadSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
notEnoughMembersError(max(members), nEns, obj.file);
end

% Return the variable indices in sorted order
v = sort(v);

end

% Long error messages
Expand Down
2 changes: 1 addition & 1 deletion @ensemble/useVariables.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
else
obj.stateVector.checkVariables(varNames);
varNames = string(varNames);
varNames = unique(varNames(:), 'stable');
varNames = unique(varNames(:));
end
obj.variables = varNames;

Expand Down
1 change: 1 addition & 0 deletions @ensembleMetadata/extract.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
% obj: The updated ensembleMetadata object.

% Error check, variable indices
assert(~isempty(varNames), 'varNames cannot be empty');
v = dash.checkStrsInList(varNames, obj.variableNames, 'varNames', 'variable in the state vector');

% Get the variables to remove
Expand Down

0 comments on commit 440d75f

Please sign in to comment.