Skip to content

refactor: mark read_json/write_json as internal helpers (#697)#738

Open
leotrs wants to merge 1 commit into
devfrom
remove-deprecated-json
Open

refactor: mark read_json/write_json as internal helpers (#697)#738
leotrs wants to merge 1 commit into
devfrom
remove-deprecated-json

Conversation

@leotrs

@leotrs leotrs commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #697 (Option 1 path).

`read_json`/`write_json` had already been pulled from the top-level public API in #692 but still lived under public names and emitted `DeprecationWarning`s. The advice in those warnings ('use `read_hif`/`write_hif` instead') was misleading for the only remaining caller — `xgi_data.py` — because xgi-data still stores datasets in the legacy hypergraph-dict JSON format, not HIF, and the internal caller had nowhere else to go.

This PR completes the cleanup:

  • Rename `read_json` → `_read_json`, `write_json` → `_write_json` so the private status is obvious.
  • Drop the `DeprecationWarning` calls.
  • `all` explicitly empty.
  • Update the one internal call site in `xgi/readwrite/xgi_data.py`.
  • Update `See Also` references in `hypergraph_dict.py` to point at the HIF readers/writers.
  • Tests adjusted via import alias so the existing coverage is preserved.

Once xgi-data finishes migrating to HIF (tracked separately by Nich/Dan), these helpers can be deleted entirely.

Test plan

  • Full test suite passes (418 passed, 6 skipped)
  • No deprecation warning emitted by xgi-data calls anymore

These functions were already removed from the public API (in #692) but
still lived under public names and emitted DeprecationWarnings that
users could no longer act on. They cannot simply be deleted because
xgi-data datasets are still stored in the legacy hypergraph-dict JSON
format and xgi_data.py needs to read/write them.

This commit completes the Option 1 path agreed in #697:

- Rename read_json -> _read_json and write_json -> _write_json
- Remove from __all__ (was empty after #692 anyway, now explicit)
- Drop the DeprecationWarning calls (advice was misleading: the
  internal callers had nowhere else to go)
- Update the only internal caller (xgi_data.py) to use the new names
- Update See Also references in hypergraph_dict.py to point at
  read_hif / write_hif instead
- Tests adjusted to import via aliases

Once xgi-data migrates fully to HIF (issue separate), the two helpers
can be deleted entirely.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.58%. Comparing base (9e1e9af) to head (f0f468d).
⚠️ Report is 45 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #738      +/-   ##
==========================================
+ Coverage   93.65%   94.58%   +0.93%     
==========================================
  Files          66       66              
  Lines        5168     5268     +100     
==========================================
+ Hits         4840     4983     +143     
+ Misses        328      285      -43     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant