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

Need for tests for the beam plot functions (Discussion) #16674

Open
ishanaj opened this issue Apr 17, 2019 · 8 comments
Open

Need for tests for the beam plot functions (Discussion) #16674

ishanaj opened this issue Apr 17, 2019 · 8 comments
Labels
physics.continuum_mechanics plotting Testing Related to the test runner. Do not use for test failures unless it relates to the test runner itself

Comments

@ishanaj
Copy link
Contributor

ishanaj commented Apr 17, 2019

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 functions

I am not sure about the need of such tests, so I guess some discussions can be done over this.

ping @moorepants @jashan498

@oscarbenjamin oscarbenjamin added physics.continuum_mechanics plotting Testing Related to the test runner. Do not use for test failures unless it relates to the test runner itself labels Apr 17, 2019
@moorepants
Copy link
Member

If you'd like to implement the matplotlib testing features that compare output images, go for it.

@moorepants
Copy link
Member

@sylee957
Copy link
Member

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.
We may better use SVG format if possible

@povinsahu1909
Copy link
Contributor

I think there is also need for the tests to check whether the singularity in plot was handled correctly or not.

@sylee957
Copy link
Member

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.

@povinsahu1909
Copy link
Contributor

povinsahu1909 commented Mar 18, 2020

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?

@sylee957
Copy link
Member

sylee957 commented Mar 18, 2020

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

@povinsahu1909
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physics.continuum_mechanics plotting Testing Related to the test runner. Do not use for test failures unless it relates to the test runner itself
Projects
None yet
Development

No branches or pull requests

5 participants