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

Raise error when saving bad variable name to mat file #1203

Closed
valentinsulzer opened this issue Oct 19, 2020 · 2 comments · Fixed by #1206
Closed

Raise error when saving bad variable name to mat file #1203

valentinsulzer opened this issue Oct 19, 2020 · 2 comments · Fixed by #1206

Comments

@valentinsulzer
Copy link
Member

If a .mat file has a variable name with a space in the name, MATLAB won't be able to load it. So we shouldn't save it. Raise error instead and suggest making a new variable with a more MATLAB-compatible name.
We could try converting spaces to underscores, etc, but units ([mol.m-3]) would not work (none of [, ., - are ok)

@valentinsulzer
Copy link
Member Author

Alternatively, add an extra keyword argument to solution.save_data which allows the user to provide a dictionary of name conversions

@rtimms
Copy link
Contributor

rtimms commented Oct 20, 2020

I think passing a dict of name conversion is more user-friendly that creating new variables. I guess we still raise the error and then suggest passing the dict

valentinsulzer added a commit that referenced this issue Oct 21, 2020
valentinsulzer added a commit that referenced this issue Oct 22, 2020
valentinsulzer added a commit that referenced this issue Oct 23, 2020
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 a pull request may close this issue.

2 participants