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

Ensure Tests Work for SSP #95

Open
12 of 14 tasks
niazim3 opened this issue Jun 11, 2018 · 3 comments
Open
12 of 14 tasks

Ensure Tests Work for SSP #95

niazim3 opened this issue Jun 11, 2018 · 3 comments
Assignees

Comments

@niazim3
Copy link
Collaborator

niazim3 commented Jun 11, 2018

This issue comes up from implementation of #92 for SSP. The following tests need to be checked to see if running them results in the same results as before restructuring the folder and file structure:

  • SSA_Ex6Tester.m
  • SSA_GenAlgTester.m
  • SSA_InputSpecial.m only used by SSA_InputTester
  • SSA_InputTester.m
  • SSA_KinAdmTester.m
  • SSA_Original_GenAlgNonCirc.m not used by any test
  • SSA_Original_RFEMSliceTester.m only used by SSA_RFEMSliceTester
  • SSA_Original_SliceTester.m only used by SSA_MPSliceTester
  • SSA_PropertySorterTester.m has a different type of error (i.e. Undefined function or variable 'SlicerModule'.)
  • SSA_SliceTesterAlgorithm.m only used by SSA_MPSliceTester and SSA_RFEMSliceTester
  • SSA_SlipWeightTester.m
  • SSA_TesterMain.m
  • SSA_MPSliceTester.m
  • SSA_RFEMSliceTester.m
@niazim3
Copy link
Collaborator Author

niazim3 commented Jun 11, 2018

Many of the tests pass in functions as arguments using '@' for function handling. This creates an issue since for instance in SSA_RFEMSliceTester.m:

...
[E1] = SSA_SliceTesterAlgorithm (@RFEMSolver, slip, params_layers,... % compute F and lam for slip surface
    params_piez, params_soln, params_load, 1.319, nStar);

[E1MP] = SSA_SliceTesterAlgorithm (@MorgPriceSolver, slip, params_layers,... % compute F and lam for slip surface
    params_piez, params_soln, params_load, 1.319, nStar);
...

SSA_SliceTesterAlgorithm is in the same directory as SSA_RFEMSliceTester, which is why the easier fixes of adding cd ../src will not work in this case.

MorgPriceTester and RFEMSolver are passed in as arguments into the SSA_SliceTesterAlgorithm, but it is unable to find the definitions for said functions since they are not in the same directory. It is not possible to pass in something like @ ../src/MorgPriceTester because the syntax @ expects does not match.

Therefore, a solution like the one provided at the following link may be an option: https://www.mathworks.com/matlabcentral/answers/97571-how-do-i-specify-an-absolute-pathname-for-a-function-when-using-str2func-to-capture-its-handle.

Edit: Also a problem for SSA_MPSliceTester.

@niazim3
Copy link
Collaborator Author

niazim3 commented Jun 12, 2018

Update: such an implementation will not work, since the function that is passed in will expect arguments to be passed into the function right away (i.e. when it's passed in as an argument) as well, which is not possible since the arguments to pass into the passed in function are determined in a separate testing file.

For now, will continue to work on #92 as if SSA_MPSliceTester.m and SSA_RFEMSliceTester.m were fixed. (Keeping in mind that SSA_MPSliceTester resulted in segmentation violation before the file standardization task and that SSA_RFEMSliceTester produces a multitude of warnings of the following nature

In RFEMSolver (line 309)
  In SSA_SliceTesterAlgorithm (line 39)
  In SSA_RFEMSliceTester (line 51)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  1.827556e-16.

before the standardization task as well, this issue can close upon getting these results).

@smiths
Copy link
Owner

smiths commented Jun 12, 2018

Matlab can be tricky to work with for tasks such as this. If you can get it to work with the tests in a separate folder, that would be great, but if we have to change the file structure to something simpler, that is a viable option.

Some thoughts that come to mind for dealing with the matlab headaches is to play with the matlab path environment variables. There may be a way to tell it to search the folder you want it to search. Another option might be to create symbolic links to the files that you need. This isn't a pretty option, and I don't think it would be easy to maintain.

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

No branches or pull requests

2 participants