-
Notifications
You must be signed in to change notification settings - Fork 128
Add gsas2 unit tests #38123
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
Add gsas2 unit tests #38123
Conversation
Set the basic structure for the unit tests of call_G2sc.py. Had to wrap code in call_G2sc.py in a main() function so can import functions from file without triggering the entire routine.
Decided to create this function because if add_histograms exists then it makes sense for add_phases to exist as well
Added unit test for functions that write to directory. Set up class and tear down to clean temporary directory.
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.
Looks great, good job getting your head around call_G2sc
!
Tested GSAS-II is called OK from interfaces, just a couple of small changes requested but overall tests looks very comprehensive - good job!
...mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/gsas2/test/test_call_G2sc.py
Outdated
Show resolved
Hide resolved
...nterfaces/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/gsas2/call_G2sc.py
Show resolved
Hide resolved
...mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/gsas2/test/test_call_G2sc.py
Outdated
Show resolved
Hide resolved
Handled creation of temporary file with tempfile library
Put repeated line for setting up project inside setUp function
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.
Great thanks for the minor changes - sorry it took me so long to re-review!
Description of work
Originally the issue was to add tests to the view of gsas2, but I did not see a case for it when most of the test cases would have just been
mock.assert_called()
. Instead I added tests for thecall_G2sc.py
file, which passes mantid inputs into a GSAS2 script.Summary of work
Added unit tests to functions on
call_G2sc.py
file.Fixes #35624 .
Further detail of work
To test:
Code review and do at least one GSAS refinement on the Eng Diff interface.
Reviewer
Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.