Skip to content

Fix CompileInterfaceSummaryJSON.parse() to respect compressed mode#45

Merged
Joseph-Ellaway merged 2 commits intonew-mol-key-and-compressionfrom
copilot/sub-pr-43
Mar 9, 2026
Merged

Fix CompileInterfaceSummaryJSON.parse() to respect compressed mode#45
Joseph-Ellaway merged 2 commits intonew-mol-key-and-compressionfrom
copilot/sub-pr-43

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 8, 2026

CompileInterfaceSummaryJSON.parse() ignored self.compressed, always globbing for *.json and reading via plain open(). In compressed mode, interface files are interface_*.json.gz, so the method would find nothing or fail to read them.

Changes

  • File discovery: uses .json.gz extension when self.compressed=True
  • File reading: replaces open() with open_compressed() consistent with _load_assembly_json()
ext = ".json.gz" if self.compressed else ".json"
interface_files = [
    f for f in os.listdir(self.path_interface_jsons)
    if f.startswith("interface_") and f.endswith(ext)
]
...
with open_compressed(interface_json_path, self.compressed) as f:
    d = json.load(f)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Joseph-Ellaway <69363546+Joseph-Ellaway@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback from PR #43 on mol key and compression changes Fix CompileInterfaceSummaryJSON.parse() to respect compressed mode Mar 8, 2026
@Joseph-Ellaway Joseph-Ellaway marked this pull request as ready for review March 9, 2026 12:01
@Joseph-Ellaway Joseph-Ellaway merged commit 008a43f into new-mol-key-and-compression Mar 9, 2026
@Joseph-Ellaway Joseph-Ellaway deleted the copilot/sub-pr-43 branch March 9, 2026 12:01
Joseph-Ellaway added a commit that referenced this pull request Mar 10, 2026
* Additional test data files

Other structure format files added to test set

* Expected compressed JSON files

* Test for compressed cif and JSONs

* Enable compression for assembly parser

* Test files for compressed interfaces

* Tests for compressing interfaces

* Test for compressed interface summary JSON

* Test files for interface summary compression

* Compress JSONs for interface summary results

* Scratch folder

* List file parsers updated to allow compression

* CLI entry point updated to take compression flags

* Updated output test files for component_id

* Increased test verbosity

* Models updated to accept component_id

* component_id fed into models from parsers

* Version bump

* Unnecessary compressionlevel removed

* Update pisa_utils/parsers.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update pisa_utils/run.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update pisa_utils/run.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix missing `.gz` extension on `path_assembly_json` when `--compress_output` is enabled (#44)

* Initial plan

* Fix path_assembly_json missing .gz extension when compress_output is enabled

Co-authored-by: Joseph-Ellaway <69363546+Joseph-Ellaway@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Joseph-Ellaway <69363546+Joseph-Ellaway@users.noreply.github.com>

* Linting fix

* Abstract gzip and saving in XML->JSON parsers

* Fix CompileInterfaceSummaryJSON.parse() to respect compressed mode (#45)

* Initial plan

* Fix CompileInterfaceSummaryJSON.parse() to respect self.compressed flag

Co-authored-by: Joseph-Ellaway <69363546+Joseph-Ellaway@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Joseph-Ellaway <69363546+Joseph-Ellaway@users.noreply.github.com>

* Tests fixed, point to compressed int. folder

* Tests updated to compress on the fly

* Compressed files removed

* Compress with Python native approach

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants