mystran-validation


Namemystran-validation JSON
Version 0.18.0 PyPI version JSON
download
home_page
SummaryPython framework for MYSTRAN validation
upload_time2023-05-26 10:40:28
maintainer
docs_urlNone
authorNicolas Cordier
requires_python>=3.8
licenseMIT license
keywords mystran_validation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            MYSTRAN validation
==================


![pypi](https://img.shields.io/pypi/v/mystran_validation.svg "https://pypi.python.org/pypi/mystran_validation")


Python framework for [MYSTRAN](http://https://github.com/dr-bill-c/MYSTRAN) validation.


* Free software: MIT license

[[_TOC_]]

Features
--------

* [declarative framework](#a-declarative-framework)
* [flexible](#a-flexible-framework)
* built on top of [pytest](https://pytest.org/), [femap-neutral-parser](https://pypi.org/project/femap-neutral-parser/) and [PyNastran](https://pypi.org/project/pyNastran/).
* tests-results are summarized within a [JUnitXML](https://junit.org/junit5/docs/current/user-guide) file, therefore compatible with Jenkins/Travis or other CI tools.
* HTML files are created out of the JUnit file (`--report`) 

Limitations
-----------

* for now, only [a few vectors](#vectors) are implemented 
* Mystran results are based on `.NEU` result file, therefore, somewhere limited with available results. Plan is to migrate to OP2 parsing once it will have been developped.


Vectors
-------

Currently implemented vectors:

- [x] Displacements (3 translations, 3 rotations)
- [x] Reactions (6-dof reactions)
- [x] CBAR internal forces
- [x] CBUSH internal forces

Next in the pipe:

- [ ] CQUAD4 internal forces
- [ ] CTRIA3 internal forces

A declarative Framework
-----------------------

`mystran_validation` is a python **declarative** framework dedicated to MYSTRAN test cases.

**declarative** means that end-user do not need to know python **at-all**. Test cases are declared as `ini` text files, pointing to relevant files, and describing the test itself.

Example::

        [DEFAULT]
        title = test 00
        bulk = bulk_model.nas
        reference = test_case_03.op2

        [Checking Displs]
        # we check all nodes displacements
        description = check all displacements
        vector = displacements

        [Reactions]
        # we check all nodes displacements
        description = this is a multi-lines
        	description
        vector = reactions

The above configuration file describes **two tests** performed on ``bulk_model.nas`` (named "Checking Displs"). This test will check **all displacements** and **all ractions** against ``test_case_03.op2`` file. 


A flexible framework
--------------------

Event though [many limitations] still remain, the framework features:

### tolerance management

The above example may be tweaked as follows::

     [...]

     [Displacements]
     # we check all nodes displacements
     description = check all displacements
     vector = displacements
     ## we can reduce / increase tolerance
     rtol = 1e-05 # default relative tolerance
     atol = 1e-08 # default absolute tolerance 

### checking data subset

Data subset can be checked by specifying `gids`, `SubcaseIDs`::

     [...]

     [Displacements]
     # we check all nodes displacements
     description = check all displacements
     vector = displacements
     ## we can restrict checked data:
     gids = 1, 2
     SubcaseIDs = 1,2

### Manual references

Beside reference results file, one can specify a value *by-hand* as follows::

        [Displacements II]
        description = Check one single value
        vector = displacements
        ## restrict check to MYSTRAN subset:
        gids = 1
        SubcaseIDs = 2
        axis = 6
        reference = 0.00513
        atol = 1e-06 


USAGE
=====

`mystran-validation` is a command-line tool. The main entry point is the `mystran-val` command. `mystran-val --help` for options and arguments.

The main command ``mystran-val run`` will trigger all the test-suites found in the tests repository. 

Configuration
-------------

`mystran-validation` finds its settings from a central configuration file located under:

* Linux: /home/<user>/.config/mystran-validation/config.ini
* Windows: C:\\Users\\<user>\\AppData\\Roaming\\numeric\\mystran-validation\\config.ini

By default, only the ``[DEFAULT]`` section is present. You can create any number of profile by adding a new section with relevant name::

    [dev]
    mystran-bin = path/to/dev/mystran/version

You can now pass ``--profile dev`` to ``maystran-val`` command.

Overriding test repository
--------------------------

The test repository is defaulted to `$HOME/mystran_test_cases` and can be overridden by passing ``--rootdir`` option::

    $ mystran-val --rootdir ~/another-repo run


Specifying MYSTRAN binary to use
--------------------------------

MYSTRAN Binary is found with the following scheme:

- from `--mystran-bin` (`-m` short option) passed option
- from "``mystran-bin``" value in configuration file

Starting from scratch
=====================

After installing `mystran-validation` (*eg* using [pipx](https://pypi.org/project/pipx/)), you will need to setup a tests repository. This can be done automatically by using (without additional options)::

	mystran-val init

This will create:

* a configuration file in `/.config/mystran-validation/config.ini`
* an example folder with two simple models, `.OP2` for reference and a `.ini` file ready to be ran.

You can crate as many profiles as you wish in the configuration file. Just add a new section like:

    [dev]
    mystran-bin = /path/to/mystran
    rootdir = ~/mystran-test-cases

Yo will then be able to run test-cases per profile:

    mystran-val -p toto run

Running your first run
----------------------

Once your repository is setup, trigger your first test-cases checking:

	mystran-val run

Or, if `toto` profile is defined in the configuration file:

    mystran-val -p toto run

If you need to override MYSTRAN binary:

	mystran-val -m "path/to/my/mystran" run










=======
History
=======

0.1.0 (2021-05-17)
------------------

* First release on PyPI.



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "mystran-validation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "mystran_validation",
    "author": "Nicolas Cordier",
    "author_email": "nicolas.cordier@numeric-gmbh.ch",
    "download_url": "https://files.pythonhosted.org/packages/59/eb/5f2f448733cf46a28d11535786655df197e6973d419bbea0cda7b77f91e1/mystran_validation-0.18.0.tar.gz",
    "platform": null,
    "description": "MYSTRAN validation\n==================\n\n\n![pypi](https://img.shields.io/pypi/v/mystran_validation.svg \"https://pypi.python.org/pypi/mystran_validation\")\n\n\nPython framework for [MYSTRAN](http://https://github.com/dr-bill-c/MYSTRAN) validation.\n\n\n* Free software: MIT license\n\n[[_TOC_]]\n\nFeatures\n--------\n\n* [declarative framework](#a-declarative-framework)\n* [flexible](#a-flexible-framework)\n* built on top of [pytest](https://pytest.org/), [femap-neutral-parser](https://pypi.org/project/femap-neutral-parser/) and [PyNastran](https://pypi.org/project/pyNastran/).\n* tests-results are summarized within a [JUnitXML](https://junit.org/junit5/docs/current/user-guide) file, therefore compatible with Jenkins/Travis or other CI tools.\n* HTML files are created out of the JUnit file (`--report`) \n\nLimitations\n-----------\n\n* for now, only [a few vectors](#vectors) are implemented \n* Mystran results are based on `.NEU` result file, therefore, somewhere limited with available results. Plan is to migrate to OP2 parsing once it will have been developped.\n\n\nVectors\n-------\n\nCurrently implemented vectors:\n\n- [x] Displacements (3 translations, 3 rotations)\n- [x] Reactions (6-dof reactions)\n- [x] CBAR internal forces\n- [x] CBUSH internal forces\n\nNext in the pipe:\n\n- [ ] CQUAD4 internal forces\n- [ ] CTRIA3 internal forces\n\nA declarative Framework\n-----------------------\n\n`mystran_validation` is a python **declarative** framework dedicated to MYSTRAN test cases.\n\n**declarative** means that end-user do not need to know python **at-all**. Test cases are declared as `ini` text files, pointing to relevant files, and describing the test itself.\n\nExample::\n\n        [DEFAULT]\n        title = test 00\n        bulk = bulk_model.nas\n        reference = test_case_03.op2\n\n        [Checking Displs]\n        # we check all nodes displacements\n        description = check all displacements\n        vector = displacements\n\n        [Reactions]\n        # we check all nodes displacements\n        description = this is a multi-lines\n        \tdescription\n        vector = reactions\n\nThe above configuration file describes **two tests** performed on ``bulk_model.nas`` (named \"Checking Displs\"). This test will check **all displacements** and **all ractions** against ``test_case_03.op2`` file. \n\n\nA flexible framework\n--------------------\n\nEvent though [many limitations] still remain, the framework features:\n\n### tolerance management\n\nThe above example may be tweaked as follows::\n\n     [...]\n\n     [Displacements]\n     # we check all nodes displacements\n     description = check all displacements\n     vector = displacements\n     ## we can reduce / increase tolerance\n     rtol = 1e-05 # default relative tolerance\n     atol = 1e-08 # default absolute tolerance \n\n### checking data subset\n\nData subset can be checked by specifying `gids`, `SubcaseIDs`::\n\n     [...]\n\n     [Displacements]\n     # we check all nodes displacements\n     description = check all displacements\n     vector = displacements\n     ## we can restrict checked data:\n     gids = 1, 2\n     SubcaseIDs = 1,2\n\n### Manual references\n\nBeside reference results file, one can specify a value *by-hand* as follows::\n\n        [Displacements II]\n        description = Check one single value\n        vector = displacements\n        ## restrict check to MYSTRAN subset:\n        gids = 1\n        SubcaseIDs = 2\n        axis = 6\n        reference = 0.00513\n        atol = 1e-06 \n\n\nUSAGE\n=====\n\n`mystran-validation` is a command-line tool. The main entry point is the `mystran-val` command. `mystran-val --help` for options and arguments.\n\nThe main command ``mystran-val run`` will trigger all the test-suites found in the tests repository. \n\nConfiguration\n-------------\n\n`mystran-validation` finds its settings from a central configuration file located under:\n\n* Linux: /home/<user>/.config/mystran-validation/config.ini\n* Windows: C:\\\\Users\\\\<user>\\\\AppData\\\\Roaming\\\\numeric\\\\mystran-validation\\\\config.ini\n\nBy default, only the ``[DEFAULT]`` section is present. You can create any number of profile by adding a new section with relevant name::\n\n    [dev]\n    mystran-bin = path/to/dev/mystran/version\n\nYou can now pass ``--profile dev`` to ``maystran-val`` command.\n\nOverriding test repository\n--------------------------\n\nThe test repository is defaulted to `$HOME/mystran_test_cases` and can be overridden by passing ``--rootdir`` option::\n\n    $ mystran-val --rootdir ~/another-repo run\n\n\nSpecifying MYSTRAN binary to use\n--------------------------------\n\nMYSTRAN Binary is found with the following scheme:\n\n- from `--mystran-bin` (`-m` short option) passed option\n- from \"``mystran-bin``\" value in configuration file\n\nStarting from scratch\n=====================\n\nAfter installing `mystran-validation` (*eg* using [pipx](https://pypi.org/project/pipx/)), you will need to setup a tests repository. This can be done automatically by using (without additional options)::\n\n\tmystran-val init\n\nThis will create:\n\n* a configuration file in `/.config/mystran-validation/config.ini`\n* an example folder with two simple models, `.OP2` for reference and a `.ini` file ready to be ran.\n\nYou can crate as many profiles as you wish in the configuration file. Just add a new section like:\n\n    [dev]\n    mystran-bin = /path/to/mystran\n    rootdir = ~/mystran-test-cases\n\nYo will then be able to run test-cases per profile:\n\n    mystran-val -p toto run\n\nRunning your first run\n----------------------\n\nOnce your repository is setup, trigger your first test-cases checking:\n\n\tmystran-val run\n\nOr, if `toto` profile is defined in the configuration file:\n\n    mystran-val -p toto run\n\nIf you need to override MYSTRAN binary:\n\n\tmystran-val -m \"path/to/my/mystran\" run\n\n\n\n\n\n\n\n\n\n\n=======\nHistory\n=======\n\n0.1.0 (2021-05-17)\n------------------\n\n* First release on PyPI.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Python framework for MYSTRAN validation",
    "version": "0.18.0",
    "project_urls": null,
    "split_keywords": [
        "mystran_validation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39eb2dff0d8cc5a1992bf3bc3abacc12334ee6cb24dc4f4b707ced83fd1ec31a",
                "md5": "7a351ba310cc33d07f7cb9300385bccd",
                "sha256": "64779706b4605b1bbf300cd978de5cf370d81a656b2ac5dcdd19f4c47e901754"
            },
            "downloads": -1,
            "filename": "mystran_validation-0.18.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7a351ba310cc33d07f7cb9300385bccd",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 42835,
            "upload_time": "2023-05-26T10:40:26",
            "upload_time_iso_8601": "2023-05-26T10:40:26.561880Z",
            "url": "https://files.pythonhosted.org/packages/39/eb/2dff0d8cc5a1992bf3bc3abacc12334ee6cb24dc4f4b707ced83fd1ec31a/mystran_validation-0.18.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59eb5f2f448733cf46a28d11535786655df197e6973d419bbea0cda7b77f91e1",
                "md5": "ba50803a8862652220ce0fd206b945c4",
                "sha256": "1a0d50c360bce615e976cceb3c43dc214743b1b7199ea5425a54b5de73f71770"
            },
            "downloads": -1,
            "filename": "mystran_validation-0.18.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ba50803a8862652220ce0fd206b945c4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 36236,
            "upload_time": "2023-05-26T10:40:28",
            "upload_time_iso_8601": "2023-05-26T10:40:28.907077Z",
            "url": "https://files.pythonhosted.org/packages/59/eb/5f2f448733cf46a28d11535786655df197e6973d419bbea0cda7b77f91e1/mystran_validation-0.18.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-26 10:40:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mystran-validation"
}
        
Elapsed time: 4.73965s