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

Create proper Unit Testing directory structure for SasModels (Trac #822) #137

Open
rozyczko opened this issue Mar 30, 2019 · 6 comments
Open

Comments

@rozyczko
Copy link
Member

rozyczko commented Mar 30, 2019

Migrated from http://trac.sasview.org/ticket/822

{
    "status": "assigned",
    "changetime": "2019-03-26T09:28:42",
    "_ts": "2019-03-26 09:28:42.782914+00:00",
    "description": "",
    "reporter": "piotr",
    "cc": "",
    "resolution": "",
    "workpackage": "SasView Framework Enhancements",
    "time": "2016-12-06T15:04:46",
    "component": "sasmodels",
    "summary": "Create proper Unit Testing directory structure for SasModels",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView 4.3.0",
    "owner": "richardh",
    "type": "enhancement"
}
@butlerpd
Copy link
Member

Trac update at 2017/10/27 16:21:09:

  • butler changed milestone from "SasView 4.2.0" to "SasView 4.3.0"
  • butler changed workpackage from "SasView Bug Fixing" to "SasView Framework Enhancements"

@pkienzle
Copy link
Contributor

Trac update at 2018/10/22 17:24:43:

  • pkienzle changed _comment0 from:

Could extend the test environment within each model file to allow structure factor tests. That way user models can include structure factor evaluations.

something like:
{{{
tests = [
[{}, 0.0005, 859.916526646],
[{}, 0.100600200401, 1.77063682331],
[{}, 0.5, 0.00355351388906],
[{'model': '@hardsphere',
'structure_factor_type': 1, # decoupling approximation
'effective_radius_type': 1, # equivalent sphere
}, 0.5, ????],
]
}}}

Need some rejiggering of model_test.py, but easy enough.

to:

1540229613485520

  • pkienzle commented:

Could extend the test environment within each model file to allow structure factor tests. That way user models can include structure factor evaluations.

something like:

tests = [
    [{}, 0.0005, 859.916526646],
    [{}, 0.100600200401, 1.77063682331],
    [{}, 0.5, 0.00355351388906],
    [{'@S': 'hardsphere',          # hard sphere structure factor
      'structure_factor_type': 1,  # decoupling approximation
      'effective_radius_type': 1,  # equivalent sphere
     }, 0.5, ????],
]

Need some rejiggering of model_test.py, but easy enough.

@sasview-bot
Copy link

Trac update at 2018/10/25 22:16:21: Paul Kienzle [email protected] commented:

In changeset 81751c2:

#!CommitTicketReference repository="sasmodels" revision="81751c29b389be731a04ab84a1a93dedf718e16a"
allow structure factor tests in model file. Refs #137.

@sasview-bot
Copy link

Trac update at 2019/03/19 14:49:37:

In changeset 29c455a:

#!CommitTicketReference repository="sasmodels" revision="29c455af8add2421edd313d03218d6a1ba3b7873"
Merge pull request SasView/sasview#318 from SasView/beta_approx

Beta approx

closes #191
closes #192
closes #137
closes SasView/sasview#1130

@pkienzle
Copy link
Contributor

Trac update at 2019/03/25 20:48:21:

  • pkienzle commented:

Reopening.

The original request wasn't satisfied, which was to restructure sasmodels tests to use proper Unit Testing directory structure.

Python has a variety of "proper" test structures such as:

  • embedded: put tests in package/code.py
  • sub-package: put tests package/test/code_test.py
  • separate: put tests in test/package/code_test.py

and test styles:

  • py.test
  • nose
  • nose2
  • unittest

Currently using embedded nose tests which py.test can identify.

Discuss whether this should be changed before closing this ticket.

  • pkienzle changed resolution from "fixed" to ""
  • pkienzle changed status from "closed" to "reopened"

@RichardHeenan
Copy link
Contributor

Trac update at 2019/03/26 09:28:42:

  • richardh commented:

Created new branch in sasmodels ticket_822_v5_unit_tests, to start adding unit tests for @s(Q) and beta(Q) approx in sasview 5 as per http://trac.sasview.org/ticket/822#comment:2 above, using this ticket number as a reference.

Will assign this ticket to myself for now.

  • richardh changed component from "SasView" to "sasmodels"
  • richardh changed owner from "GitHub [email protected]" to "richardh"
  • richardh changed status from "reopened" to "assigned"

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

5 participants