-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* isd compression * added docs * Added changelog * addressed PR feedback * Adds compress option to isd_generate * updated changelog * fixed typo * add decompress instructions * compress_json to take in json data instead of file
- Loading branch information
1 parent
62f7688
commit f754b5f
Showing
4 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ dependencies: | |
- pytest-cov | ||
- networkx | ||
- breathe | ||
- brotli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
import json | ||
import os | ||
|
||
import ale | ||
|
||
import ale.isd_generate as isdg | ||
|
||
from conftest import get_image_label, get_isd, compare_dicts | ||
|
||
|
||
def test_compress_decompress(): | ||
label = get_image_label("EN1072174528M") | ||
isd_str = get_isd("messmdis_isis") | ||
|
||
compressed_file = os.path.splitext(label)[0] + '.br' | ||
|
||
isdg.compress_json(isd_str, compressed_file) | ||
|
||
decompressed_file = isdg.decompress_json(compressed_file) | ||
|
||
with open(decompressed_file, 'r') as fp: | ||
isis_dict = json.load(fp) | ||
|
||
comparison = compare_dicts(isis_dict, isd_str) | ||
assert comparison == [] | ||
|
||
|