Skip to content

reverse py_to_json integer types to match json::parse() - #12646

Merged
maloel merged 1 commit into
realsenseai:developmentfrom
maloel:py-to-json
Feb 11, 2024
Merged

reverse py_to_json integer types to match json::parse()#12646
maloel merged 1 commit into
realsenseai:developmentfrom
maloel:py-to-json

Conversation

@maloel

@maloel maloel commented Feb 9, 2024

Copy link
Copy Markdown
Contributor

During debugging I noticed weird behavior. My conclusion:

  • nlohmann::json and pybind11_json have different interpretation of number values
    • I.e., a 0 converted from Python is taken as a signed integer, while a text "0" is parsed as unsigned

So I made the python-to-json code match this behavior:

  • An integer number (in Python, these are unbound) is converted to an 'unsigned` json value if it's not negative

@maloel
maloel requested a review from OhadMeir February 9, 2024 16:09
@maloel
maloel merged commit 0fc5b79 into realsenseai:development Feb 11, 2024
@maloel
maloel deleted the py-to-json branch February 11, 2024 09:21
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