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
Need for tests for the beam plot functions (Discussion) #16674
Comments
If you'd like to implement the matplotlib testing features that compare output images, go for it. |
I agree that it would be a good idea to test out the numerical aspect of the plotting result itself, rather than making it as a blackbox. |
I think there is also need for the tests to check whether the singularity in plot was handled correctly or not. |
I think that the image comparison tests are needed. I have added some before for plots. But I wonder is there a better way to organize them such that it doesn’t bloat up the repository size. |
We can implement an MSE(Mean Square Method) and SSIM(Structural Similarity Index Measure) methods to compare the plot. For calculating the similarity, we can pass the sample value for the reference figure instead of passing the whole reference figure which in turn will not increase the repository size. Then passing the generated testing figure along with the sample value of reference figure to calculate the MSE value and SSIM value and making a conclusion about the correctness of the plot. Is this can be the way to compare image for tests? |
I had thought of something different like making the tests to download the images from the internet and compare every time. And we can upload the image to somewhere like sympy wiki |
There was a problem with the currently implemented image comparison method as it is passing the test even if the comparison file is changed with another file. |
I think that there is a need for tests to be added for the plot functions in the beam module.
The functions:
plot_shear_force()
plot_bending_moment()
plot_slope()
plot_deflection()
plot_loading_results()
have no tests in the test file.Some tests similar to the tests of the
plot.py
file can be added, which would just check whether the plot figure opens or not. Although this would not be able to check the correctness of the plot, but still this can be used as an initial check to the working of the plot functionsI am not sure about the need of such tests, so I guess some discussions can be done over this.
ping @moorepants @jashan498
The text was updated successfully, but these errors were encountered: