Skip to content

Commit

Permalink
Minor style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
augustjohansson committed Jan 7, 2024
1 parent b67c8b0 commit c1ef64b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Utilities/JsonUtils/checkLint.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import json
import sys


def check(filename):
try:
with open(filename) as f:
lf = json.load(f)
with open(filename) as fid:
json.load(fid)
return True
except:
return False
Expand Down
2 changes: 1 addition & 1 deletion Utilities/JsonUtils/resolveFileInputJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def resolveFileInputJson(battmoDir, jsoninput):
if type(jsoninput) is dict:
if isinstance(jsoninput, dict):
if "isFile" in jsoninput:
filename = jsoninput["filename"]
fullfilename = os.path.join(battmoDir, filename)
Expand Down
9 changes: 4 additions & 5 deletions Utilities/JsonUtils/validateJsonFiles.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function is_valid = validateJsonFiles(jsonfiles)
function isValid = validateJsonFiles(jsonfiles)

if ~iscell(jsonfiles)
jsonfiles = {jsonfiles};
Expand All @@ -14,17 +14,16 @@
jsonfile = jsonfiles{k};
dispif(mrstVerbose, 'Validating %s\n', jsonfile);
try
%is_valid{k} = py.(modname).validate(battmoDir(), jsonfile); %#ok
py.(modname).validate(battmoDir(), jsonfile); %#ok
isValid{k} = py.(modname).validate(battmoDir(), jsonfile); %#ok
catch e
disp(e);
error('Error when running the validation');
end
assert(is_valid{k}, 'jsonfile %s is not valid', jsonfile);
assert(isValid{k}, 'jsonfile %s is not valid', jsonfile);
end

if numel(jsonfiles) == 1
is_valid = is_valid{1};
isValid = isValid{1};
end

end
Expand Down

0 comments on commit c1ef64b

Please sign in to comment.