Skip to content

Conversation

@nwlandry
Copy link
Collaborator

This PR converts NaNs to None in the write_hif function so that we no longer get JSON errors.

@codecov
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.59%. Comparing base (eecad09) to head (06e682b).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
xgi/convert/hif_dict.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #677      +/-   ##
==========================================
- Coverage   93.62%   93.59%   -0.03%     
==========================================
  Files          66       66              
  Lines        5110     5120      +10     
==========================================
+ Hits         4784     4792       +8     
- Misses        326      328       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@maximelucas
Copy link
Collaborator

maximelucas commented Jul 29, 2025

Nice, thanks Nich!
Should we open an issue to make sure we re-write all XGI-data files with the fix?

But wait, just to check, what was the problem with the nans?
It looks like JSON can handle nans: https://stackoverflow.com/questions/6601812/sending-nan-in-json

@nwlandry
Copy link
Collaborator Author

nwlandry commented Jul 31, 2025

Nice, thanks Nich! Should we open an issue to make sure we re-write all XGI-data files with the fix?

But wait, just to check, what was the problem with the nans? It looks like JSON can handle nans: https://stackoverflow.com/questions/6601812/sending-nan-in-json

From my reading of the article, Javascript can handle NaN, but JSON cannot.

"NaN, Infinity and -Infinity are not part of JSON, but they are standard in Javascript"

I will open an issue on XGI-DATA!

@nwlandry nwlandry merged commit f6d1c9d into main Jul 31, 2025
17 checks passed
@nwlandry nwlandry deleted the HIF-clean-up-nans branch July 31, 2025 19:24
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.

3 participants