Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default behavior for Python to SST conversion #9

Open
researcherben opened this issue Sep 5, 2022 · 1 comment
Open

default behavior for Python to SST conversion #9

researcherben opened this issue Sep 5, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@researcherben
Copy link
Collaborator

@srkohn says

In converting parameters from Python to SST, the default “give up” converter used to convert to a JSON string. Your new behavior creates a JSON string and then re-parses it to a Python dict. Is there some reason for this change?

I believe that SST converts an unknown data structure into a string, so the data value is passed to C++ as a stringified Python dict. I don’t know how to parse that string in C++. Python’s string converter and JSON are incompatible, so I cannot use the default JSON parser I used before.

The work-around is to convert the parameter to a JSON string before passing the parameter to ahp_graph, so I can get it to work, but I’d like to understand the motivation.

@researcherben researcherben added the question Further information is requested label Sep 5, 2022
@researcherben
Copy link
Collaborator Author

@lpsmodsim replied

For the encoding of parameters, I attempted to replicate what was occurring before we switched to orjson so there is no particular reason for it, orjson.dumps just returns a Bytes object and not a string so I'll just have to convert that to a string instead of a dict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants