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

Implementing unit tests #82

Open
2 of 6 tasks
raphaeltimbo opened this issue Jan 15, 2018 · 5 comments
Open
2 of 6 tasks

Implementing unit tests #82

raphaeltimbo opened this issue Jan 15, 2018 · 5 comments

Comments

@raphaeltimbo
Copy link
Collaborator

raphaeltimbo commented Jan 15, 2018

List of test files to be added (one for each module):

  • test_sdof.py
  • test_mdof.py
  • test_sdof.py
  • test_continuous_systems.py
  • test_ema.py
  • test_vibesystem.py

@josephcslater I saw your commits and comments regarding implementing unit tests instead of having only doctests. I totally agree that we should do that.
I think it would be a good idea to split the tests between files that will test each module (test_sdof.py, test_mdof.py...) to avoid having lots of tests in only one file.

I was taking a look at the travis build history. I saw the following error when you tried to add the test file:

______ ERROR collecting vibration_toolbox/tests/test_vibration_toolbox.py ______
ImportError while importing test module '/home/travis/build/vibrationtoolbox/vibration_toolbox/vibration_toolbox/tests/test_vibration_toolbox.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
vibration_toolbox/tests/test_vibration_toolbox.py:3: in <module>
    import vibrationtesting as vt
E   ModuleNotFoundError: No module named 'vibrationtesting'
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 2 error in 1.81 seconds ============================

Was this vibrationtesting module added to the commit? I could not find it.
The tests were failing on your local machine?

@josephcslater
Copy link
Member

I just copied the file from my vobrationtesting module. (pip install )

You can find it if interested. It’s more professional grade.

@raphaeltimbo
Copy link
Collaborator Author

I will take a look at the module!
I think the file didn't make to the commit. Maybe it was not included in your version control and not pushed to git I imagine...

@josephcslater
Copy link
Member

It certainly didn't. I was very lazy and just tried to move the text file over to use as a quick reference. Sloppy.

The vibrationtesting module is a companion to my text (that is in progress). It's also intended to be more useful as a tool instead of as a learning aid.

Some actions in the vibration toolbox are repeated, but I simplified and used better calls. For instance: M, C, and K are symmetric so often that I use symmetric eigensolvers that will be much more reliable. If C or K is not, state space can always be used. However, this is not an emphasis of my manuscript.

Some of the code (the modal parameter ID) actually came to the vibration toolbox from my Matlab version of the vibration testing toolbox (which is stagnated at this time). I'll have more "professional grade" ID algorithms eventually. I've coded them before, but was sloppy and lost them.

You're welcome, of course, to contribute to the other code base as well. Happy to share the manuscript with you if you are interested, noting that it is a work in progress.

@raphaeltimbo
Copy link
Collaborator Author

I will add a list test files that we should have and start to add them.

Yes I would like to see your manuscript!

@josephcslater
Copy link
Member

test_mdof started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants