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

any2jd: raise error if object cannot be converted #96

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

FreyJo
Copy link
Contributor

@FreyJo FreyJo commented Aug 15, 2024

I found this useful when trying to dump a nested structure with objects that need to be converted carefully.

@fangq
Copy link
Member

fangq commented Aug 15, 2024

@FreyJo, thanks for your patch - can you post a small reproducer code so that I can recreate the error? I am curious what object that getByteStreamFromArray() in matlab fails to serialize.

@FreyJo
Copy link
Contributor Author

FreyJo commented Aug 16, 2024

We are using jsonlab in acados to dump the problem formulation of an optimization problem to a json file and then perform code generation.
E.g. if there are CasADi expressions in the struct to be dumped, it fails.
Also we dump objects of types that we define in our Matlab interface which need to be converted to structs before dumping them via jsonlab.
So this change was useful when changing our interface, as currently done in acados/acados#1193

@fangq
Copy link
Member

fangq commented Aug 16, 2024

I see. can you confirm if you had used miss_hit command mh_style --fix . inside jsonlab root folder to format the added lines? currently, the code is formatted with mh_style 0.9.35-dev on a Ubuntu 18.04/20.04 linux box. ideally, if there is any format correction, it should be only in the updated section.

@fangq fangq merged commit 288dc92 into NeuroJSON:master Aug 18, 2024
7 checks passed
@fangq
Copy link
Member

fangq commented Aug 18, 2024

thanks, merged, the format looks fine.

@FreyJo FreyJo deleted the any2jd_try branch August 19, 2024 07:57
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