xarray-contrib / xbatcher

Batch generation from xarray datasets
https://xbatcher.readthedocs.io
Apache License 2.0
167 stars 27 forks source link

Schema to json #159

Closed rcjackson closed 3 months ago

rcjackson commented 1 year ago

This adds functionality to BatchSchema to dump the properties of a BatchSchema to a json file. All you do is, for a given BatchSchema bs, do

json_str = bs.to_json() 

to have the JSON representation in a string.

To put the JSON representation in a file, do:

bs.to_file('file.json')

Fixes #155

codecov-commenter commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.57%. Comparing base (43c9135) to head (3415d3d). Report is 25 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #159 +/- ## ========================================== + Coverage 96.25% 97.57% +1.32% ========================================== Files 6 6 Lines 347 371 +24 Branches 82 87 +5 ========================================== + Hits 334 362 +28 + Misses 8 6 -2 + Partials 5 3 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

andersy005 commented 4 months ago

@rcjackson, i wanted to reach out to see if this PR is something you're still interested in bringing to completion? i'm happy to help

andersy005 commented 3 months ago

pre-commit.ci autofix

andersy005 commented 3 months ago

thank you for this contribution🚀, @rcjackson!