Permalink
Browse files

Merge pull request #235 from nextstrain/stable-json

Emit JSON with sorted keys
  • Loading branch information...
trvrb committed Oct 28, 2018
2 parents d5f6042 + 53de527 commit 4ebe931c75891c4ec9fb989cfa9d1289a9cabeb5
Showing with 3 additions and 3 deletions.
  1. +1 −1 augur/sequence_traits.py
  2. +1 −1 augur/traits.py
  3. +1 −1 augur/utils.py
@@ -320,4 +320,4 @@ def run(args):
#write out json
with open(args.output, 'w') as results:
json.dump({"nodes":seq_features}, results, indent=1)
json.dump({"nodes":seq_features}, results, indent=1, sort_keys = True)
@@ -172,7 +172,7 @@ def run(args):
ofile.write(str(gtr))
with open(args.output, 'w') as results:
json.dump({"nodes":mugration_states}, results, indent=1)
json.dump({"nodes":mugration_states}, results, indent=1, sort_keys = True)
print("\nInferred ancestral states of discrete character using TreeTime:"
"\n\tSagulenko et al. TreeTime: Maximum-likelihood phylodynamic analysis"
@@ -147,7 +147,7 @@ def write_json(data, file_name, indent=1):
except IOError:
raise
else:
json.dump(data, handle, indent=indent)
json.dump(data, handle, indent=indent, sort_keys = True)
handle.close()
success=True

0 comments on commit 4ebe931

Please sign in to comment.