Opened 8 years ago

Last modified 6 years ago

#828 assigned defect

Fix tests for oriented 2D models for new orientation defintion

Reported by: pkienzle Owned by: richardh
Priority: major Milestone: SasView 4.3.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description (last modified by butler)

With the new orientation angle definitions, a number of the 2D unit tests failed to pass and were commented out. Now that we are preparing to release with the new definition we need to make sure that the unit tests are correct (i.e. that the models still work correctly).

Change History (9)

comment:1 Changed 8 years ago by pkienzle

There are commented out tests in the following files, some of which may be orientation tests:

  • core_shell_ellipsoid.py
  • core_shell_sphere.py
  • cylinder.py
  • flexible_cylinder.py
  • flexible_cylinder_elliptical.py
  • fractal_core_shell.py
  • fuzzy_sphere.py
  • micelles_ellipsoid.py
  • raspberry.py
  • stacked_disks.py

comment:2 Changed 8 years ago by pkienzle

  • Owner set to richardh
  • Status changed from new to assigned

comment:3 Changed 8 years ago by butler

  • Description modified (diff)
  • Summary changed from add tests for oriented 2D models to Fix tests for oriented 2D models for new orientation defintion

comment:4 Changed 8 years ago by butler

From Richard's email

20 Dec 2016 following discussion in the tele-conference.

Looking at the .py code for each, see list below for the models that I expect to be influenced by the change of angular coordinate conventions. Dirk commented out some unit tests, which were failing after he changed the coordinate system. The coordinates were then reverted to the original method in order to allow other testing which compared sasmodels with old sasview routines. I think that Paul K has now today “switched back on” the new coordinates in the master branch, he has a single line of code which does this.

I will have a look at the three cases all in bold, as it “ought to be easy” to reinstate at least some of their unit tests. We really need more unit tests in many other models which are missing them, as there was a tendency to think when converting the models that we would “get around to that later …” and in some cases the conversion was done before the unit test system was up and running.

I don’t know if the parallelepiped models are affected by the coordinate change – perhaps someone clever can let us know please.

With hindsight I should have put this list in a table on the wiki, sorry, was not intending to write so much when I started it. Apologies for any mistakes or omissions here.

Richard

[unless stated otherwise, all can do 2d calculations]

Cylinder functions

barbell – no tests

capped_cylinder – no tests

core_shell_bicelle – no tests

core_shell_bicelle_elliptical – one 1d test

core_shell_cylinder – no tests

cylinder – one 1d, one 2d test, commented out

elliptical_cylinder – one 1d test

flexible_cylinder – three 1d tests, another at Q=.001 commented out with “currently fails in OCL”, no 2d calc

flexible_cylinder_elliptical – three 1d tests, another at Q=.001 commented out with “currently fails in OCL”, no 2d calc

hollow_cylinder – two 1d tests,

pearl_necklace – one 1d test, no 2d calc

pringle – three 1d tests, no 2d calc

stacked_disks – all 1d & 2d, tests commented out


Ellipsoid Functions

core_shell_ellipsoid – two 1d, one 2d test commented out

ellipsoid – no tests

triaxial_ellipsoid – no tests


Lamellae Functions

lamellar – one 1d test, no 2d calc

lamellar_hg – one 1d test, no 2d calc

lamellar_hg_stack_caille – one 1d test, no 2d calc

lamellar_stack_caille – one 1d test, no 2d calc

lamellar_stack_paracrystal – two 1d test, no 2d calc

Paracrystal Functions

bcc_paracrystal – no tests, (does 2d calc, has 3 angles)

fcc_paracrystal – no tests, (does 2d calc, has 3 angles)

sc_paracrystal – three 1d tests, (does 2d calc, has 3 angles)

Parallelepiped Functions

core_shell_parallelepiped - two 1d tests, two 2d tests, (has 3 angles, check in new coords?)

hollow_rectangular_prism – one 1d test, no 2d calc

hollow_rectangular_prism_thin_walls – one 1d test, no 2d calc

parallelepiped - one 1d test, two 2d tests, (has 3 angles, check in new coords?)

rectangular_prism – one 1d test, no 2d calc


Others

I am assuming that all “sphere” and “shape independent” functions are purely 1d.

comment:5 Changed 7 years ago by butler

  • Milestone changed from SasView 4.1.0 to SasView 4.2.0

moving to 4.2 since assymetric orientation is getting changed in 4.2 anyway

comment:6 Changed 7 years ago by richardh

After code camp in Grenoble, I think that all the models above that were missing tests now have some 1d and also 2d where appropriate. Beware however, that thus far these are only in the ticket-890 branch of sasmodels, see #890 and #776.

Where I did add new tests, I assumed that the current code is producing correct results. This is only particularly serious for the fcc-, bcc- and sc- paracrystal models where where the numerical calculations may still be method and/or compiler dependent, so some 2d tests may yet need to be commented out. Also of course for those models there are no ways to compare against others, unlike the various cylinder & ellipsoid models where limiting cases can be compared. (Please also when you write unit tests ensure that the numerical values of all parameters are different, so that the tests are robust if the order of parameters is later changed in say a subroutine).

comment:7 Changed 7 years ago by butler

  • Priority changed from major to critical

comment:8 Changed 6 years ago by butler

  • Priority changed from critical to major

comment:9 Changed 6 years ago by butler

  • Milestone changed from SasView 4.2.0 to SasView 4.3.0
Note: See TracTickets for help on using tickets.