Skip to content

Commit

Permalink
Merge pull request #40 from dms-viz/39-sort-the-json-consistently-for…
Browse files Browse the repository at this point in the history
…-diffing

Sort the output `JSON` consistently for diffing
  • Loading branch information
WillHannon-MCB authored Nov 25, 2024
2 parents 02820a6 + a47bc6b commit 92dc756
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 9 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,22 @@

### Removed

- N/A

## [1.6.0] - 2024-11-25

### Added

- N/A

### Changed

- Sort the keys in the output JSON to prevent overhead in `git` diffs.

### Deprecated

- N/A

### Removed

- N/A
4 changes: 2 additions & 2 deletions configure_dms_viz/configure_dms_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ def format(

# Write the dictionary to a json file
with open(output, "w") as f:
json.dump({name: experiment_dict}, f)
json.dump({name: experiment_dict}, f, sort_keys=True)

click.secho(
message=f"\nSuccess! The visualization JSON was written to '{output}'",
Expand Down Expand Up @@ -1088,7 +1088,7 @@ def join_command(input, output, description):
try:
# Write the combined data to the specified output file
with open(output, "w") as f:
json.dump(combined_data, f)
json.dump(combined_data, f, sort_keys=True)
except Exception as e:
click.secho(f"Failed to write to output file. Error: {str(e)}", fg="red")
return
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "configure-dms-viz"
version = "1.5.0"
version = "1.6.0"
description = "Configure your data for visualization with dms-viz.github.io"
authors = ["Will Hannon <[email protected]>"]
maintainers = ["Will Hannon <[email protected]>"]
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/IAV-PB1-DMS/output/IAV-PB1-DMS.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/SARS2-RBD-REGN-DMS/output/REGN mAb Cocktail.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tests/SARS2-RBD-REGN-DMS/output/SARS2-RBD-REGN-DMS.json

This file was deleted.

0 comments on commit 92dc756

Please sign in to comment.