SasView / sasmodels

Package for calculation of small angle scattering models using OpenCL.
BSD 3-Clause "New" or "Revised" License
15 stars 27 forks source link

Tests failing for mixture model from sasview model editor #217

Open pkienzle opened 5 years ago

pkienzle commented 5 years ago

Mixture model tests in SasView 4.3 is failing with because Fq is not defined in mixture.py. Similarly for product.py. Could either override Fq or _call_kernel. The latter is cleaner but a little more work. In either case, Iq won't be needed. Third option is to skip the Fq test in model_test.py if not model.info.have_Fq.

This is related to #205, but we don't need to support beta approximation to remove the error in the testing infrastructure.

Example model:

from sasmodels.core import load_model_info

model_info = load_model_info('sphere+cylinder')
model_info.name = 'sphere_plus_cylinder'

Test output

Running model 'sphere_plus_cylinder.py'...

Success:
Note: sphere_plus_cylinder has no user defined tests.
test_sphere+cylinder_opencl (sasmodels.model_test._hide_model_case_from_nose.<locals>.ModelTestCase) ... ERROR
Traceback (most recent call last):
  File "/Users/pkienzle/Source/sasmodels/sasmodels/model_test.py", line 236, in run_all
    results = [self.run_one(model, test) for test in P_tests]
  File "/Users/pkienzle/Source/sasmodels/sasmodels/model_test.py", line 236, in <listcomp>
    results = [self.run_one(model, test) for test in P_tests]
  File "/Users/pkienzle/Source/sasmodels/sasmodels/model_test.py", line 336, in run_one
    F, Fsq, R_eff, volume, volume_ratio = call_Fq(kernel, pars)
  File "/Users/pkienzle/Source/sasmodels/sasmodels/direct_model.py", line 82, in call_Fq
    return calculator.Fq(call_details, values, cutoff, is_magnetic, R_eff_type)
  File "/Users/pkienzle/Source/sasmodels/sasmodels/kernel.py", line 155, in Fq
    radius_effective_mode)
  File "/Users/pkienzle/Source/sasmodels/sasmodels/kernel.py", line 189, in _call_kernel
    raise NotImplementedError()
NotImplementedError: sphere_plus_cylinder-opencl

It is curious that the test registered an error but reported success.

RichardHeenan commented 5 years ago

Does this matter? Is sasview 4.3 going to use current sasmodels master or stick at sasmodels v0.99 ?

pkienzle commented 5 years ago

Tests ought to be failing for 5.0 as well, assuming it is running the standard 'smoke tests' for each model to make sure it runs and doesn't return NaN. I haven't checked that this is the case.