-
Notifications
You must be signed in to change notification settings - Fork 8
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
JSON object serialization #402
Comments
I figured out a way to save objects in a json format! Shall we have the default be saving it in a .mat file and create a TASBE Config variable for the output type? |
Yes, that sounds like the right plan. |
Currently, I am trying to find a way to load back in the JSON files. I created a recursive outside function that goes through a struct version of a json file and converts nested structs into objects. Everything works except for creating a When I run The constructor for gmdistribution is the only class that isn't in the code directory. I was wondering if there is a reason for that. I am not sure how to fix this problem without trying to move the folder into the code directory. (I manually added the gmdistribution folder to Path, but it still didn't work.) |
Running The |
Yep! I had to uninstall a Matlab toolbox, but now that part is working! |
I wonder why the Matlab code wasn't working... that's a significant problem, since we need to be able to use the matlab gmdistribution if it's there, rather than using our own. |
True! I tried searching the internet for using eval to create objects from a Matlab toolbox/ add-in and couldn't find a solution. |
I looked into the problem a bit more, and I think the reason it doesn't work is that the Matlab gmdistribution class does not take in the same properties as the local version, so it can't read in the necessary information from the colormodel JSON file. |
Is there any way to special-case for handling the gmdistribution class, based on whether we're using the Matlab version or not? The "which" command should be able to check. |
the which command does differentiate between the two but what do you mean by handling the gmdistribution class? Would this be whenever we deal with it in our analyses? |
I might have been wrong about the different properties statement. I wrote the following test function:
When I ran it, I got the following error with
However when I ran these lines, it worked fine.
This might have something to do with premissions for Matlab toolbox objects. |
Sounds like a special-case constructor might be possible... |
I was wondering if you could clarify what a special-case constructor would look like. The built-in Matlab |
Can the usual public constructor for gmdistribution be called in such a way that we end up with the properties having the desired values? |
CSV serialization has brought up the possibility that many objects might be JSON serialized rather than stored in .mat files. If we can do that, then we can potentially entirely work around the issues of Matlab vs. Octave serialization, allowing us to use modern classes as well as obsoleting #87.
The text was updated successfully, but these errors were encountered: