Skip to content

Matlab strings--potential fix for scipy read error #1727

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

Closed
wants to merge 6 commits into from

Conversation

dcwhite
Copy link
Member

@dcwhite dcwhite commented Oct 27, 2017

@jessdtate can you verify this fixes the scipy error referenced in #1692? Also check round-trip save/load for basically every other matlab file type and program that reads/writes such types...

@dcwhite dcwhite self-assigned this Oct 27, 2017
@dcwhite dcwhite requested a review from jessdtate October 27, 2017 19:52
@jessdtate
Copy link
Contributor

There seems to be a problem reading integer matrices into scirun now. Before, they could be read from matlab. Here is the error from a saved matrix (same from Python and matlab):

Message: Import failed.
ERROR: /Users/jess/software/SCIRun/src/Modules/DataIO/GenericReader.h(190): Throw in function virtual void SCIRun::Modules::DataIO::GenericReader >, SCIRun::Modules::MatrixPortTag>::execute() [HType = boost::shared_ptr >, PortTag = SCIRun::Modules::MatrixPortTag] Dynamic exception type: boost::exception_detail::clone_impl std::exception::what: Import failed. [SCIRun::Core::tag_error_message*] = Import failed.

Matlab_save_int_matrix.mat.zip
python_save_int_matrix.mat.zip

@jessdtate
Copy link
Contributor

jessdtate commented Oct 31, 2017

There is a bit of inconsistency with ints in matrices, which may be the source of the issue. it seems the modules that work (like getfielddata) just convert it to a double. This doesn't seem to be happening correctly in read field.

@dcwhite
Copy link
Member Author

dcwhite commented Oct 31, 2017

OK I'll take a look

@jessdtate
Copy link
Contributor

a slight correction, ints from matlab didn't work either, but the error was just: import failed.

@jessdtate
Copy link
Contributor

I can get it to work with any fields. I still get the error: TypeError: Expecting miINT8 as data type

@dcwhite
Copy link
Member Author

dcwhite commented Oct 31, 2017

OK I'll close this and come up with a different fix.

@dcwhite dcwhite closed this Oct 31, 2017
@dcwhite dcwhite deleted the matlab-strings branch November 14, 2017 20:43
@jessdtate jessdtate restored the matlab-strings branch November 29, 2022 23:45
@jessdtate
Copy link
Contributor

Maybe we should merge this into master? It works with matrix files, so it's half fix at least. I've been including it in local builds for a while to deal with matrix files.

@jessdtate jessdtate reopened this Nov 29, 2022
@dcwhite
Copy link
Member Author

dcwhite commented Dec 1, 2022

I can see if I can merge it in with a feature flag--enabled at run-time, or a setting which you can save as turned on.

@dcwhite dcwhite mentioned this pull request Dec 20, 2022
@dcwhite dcwhite closed this in 089b553 Feb 3, 2023
dcwhite added a commit that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants