-
Notifications
You must be signed in to change notification settings - Fork 184
Add tests to check that SLX file versions do not exceed R2020b #919
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
Conversation
|
The tests are revealing 5 files that exceed the maximum version:
|
|
I added #920 to track converting the SLX files with the wrong versions. |
|
@kmruehl, do you think it's worth adding something to the WEC-Sim Library page about how to save the files to the correct version? |
|
@H0R5E we require the WEC-Sim Library to be saved in 2020b, but we've never required model files to also be saved in a prior version of MATLAB. There have been (rare) instances when a model is saved in a newer version of MATLAB (e.g. 2021b), and I'm unable to open it in an older version (e.g. 2020a). However, this is not a common issue, and I do not want to require all WEC-Sim models to be saved in prior versions of MATLAB. I'd prefer to just update the cases causing issues. In this instance, it looks like two of the library files were not properly saved in 2020b. @jtgrasb will update these files:
|
|
@H0R5E, @jtgrasb is going to save the WEC-Sim library blocks on dev to 2020b. I don't want to require the WEC-Sim model files to be saved to 2020b. But this PR check would be helpful to run on the library files, on the Can you update this PR so that it only checks the library files? Thanks! |
Sorry, I'm going to have to disagree with this approach. If we are supporting users running R2020b, then they should be able to open the example files. For example, when I try to open It's very low effort to save the files in the correct format, so I don't understand why it's not worth doing to ensure compatibility for all users. At a minimum, we should put a warning in the docs saying that the example files can only be opened with a specific version. |
|
So, another option is to get our users to turn off the compatibility check when opening Simulink files saved in newer versions. In this case, we should document the process of setting the option in the Simulink preferences. |
|
@H0R5E do you know is there is a way to turn off that option programmatically? The WEC-Sim team discussed this issue. We only way to require the library to be saved in a prior version of MATLAB, but would like users to be able to open model files saved in a newer version of MATLAB. |
Yes, the command is EDIT: Note the above command is one-and-done. It's a global setting, not one associated to the model. |
|
There are 3 options of how to implement this (not listed in order of preference):
|
|
So, the command above is already called here in I really don't think this is the best place for it, as you need to run WEC-Sim before you can open the model. 🛒 before 🐴. |
|
This command has been inside the The problem is that if we removed this command and it was not run before calling WEC-Sim then WEC-Sim would fail if we were trying to run a newer model. Therefore, you could argue it's a necessary part of the installation process. So I think putting it into |
95e30c6 to
c8da02d
Compare
|
So, I've gone ahead and moved Happy to change again if not what you want. I just thought it would be useful to see what it looked like in this configuration. |
537ccd0 to
ef955ae
Compare
|
@H0R5E do you know why these tests are failing? |
ef955ae to
dc32cfb
Compare
|
Hi, the test failure being generated is: The most important part being |
|
@kmruehl will save the cable library block to 2020b |
kmruehl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@H0R5E I'm going to make this minor change and then merge the PR once the tests pass
| warning('off','sm:sli:setup:compile:SteadyStateStartNotSupported') | ||
| set_param(0, 'ErrorIfLoadNewModel', 'off') | ||
|
|
||
| % Load parameters to Simulink model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern about removing it here, is that not everyone uses the addWecSimSource script each time they open MATLAB. I think we should keep it in both places. I'm going to add it back here, additioanlly.
| clear wecSimSource | ||
| % Allow opening of Simulink models saved in a newer version | ||
| set_param(0, 'ErrorIfLoadNewModel', 'off') | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution only works if users execute this script, which they may not do. For example, I have the source always added and never run this script. I think we should keep it in both places, and will make this revision.
|
@H0R5E you can delete your branch if you like |
This PR adds some new tests to check whether the versions of any SLX files stored in the repository exceed R2020b.
Having these tests will make sure that incompatible versions are not merged accidentally.