Add JSON conversion warnings, store save-type metadata and use ns file timestamps (v0.8.2) - #8
Open
kyrylo-gr wants to merge 1 commit into
Open
Add JSON conversion warnings, store save-type metadata and use ns file timestamps (v0.8.2)#8kyrylo-gr wants to merge 1 commit into
kyrylo-gr wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation (#6)
Description
_warn_json_conversion_if_neededand extendedtransform_not_dict_on_saveto acceptjson_conversion_modeandkeyso conversions can warn in modesall,auto, or be muted; recursive calls mute warnings.save_sub_dictandsave_dictto acceptjson_conversion_modeand astorage_typedict to collect metadata about how each key was stored, and changedsave_dictto return nanosecond-resolution modification time (int) instead offloatmtime.st_sizeandst_mtime_nsinDH5, updated loading/saving logic to useos.stat(...).st_mtime_nsandst_size, and updatedpull_availableto compare both mtime and size.DH5._saved_storage_typeand appended saved-type postfixes to the repr viaoutput_dict_structureadditional info.json_conversion_modeand defaulted it to"auto"inDH5.dict_structure.pyand ensured warnings/logging import indata_transformation.py.Testing
tests/dh5_class_tests/main_test.py, including newly addedtest_repr_contains_saved_type_after_saveandtest_json_conversion_warning_modes, and they passed under the unittest run.