ncrystal-python 3.9.81__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- NCrystal/__init__.py +85 -0
- NCrystal/__main__.py +98 -0
- NCrystal/_chooks.py +854 -0
- NCrystal/_cli_cif2ncmat.py +269 -0
- NCrystal/_cli_endf2ncmat.py +503 -0
- NCrystal/_cli_hfg2ncmat.py +144 -0
- NCrystal/_cli_mcstasunion.py +74 -0
- NCrystal/_cli_ncmat2cpp.py +31 -0
- NCrystal/_cli_ncmat2hkl.py +180 -0
- NCrystal/_cli_nctool.py +1018 -0
- NCrystal/_cli_vdos2ncmat.py +463 -0
- NCrystal/_cli_verifyatompos.py +257 -0
- NCrystal/_cliimpl.py +307 -0
- NCrystal/_cliwrap_config.py +36 -0
- NCrystal/_common.py +499 -0
- NCrystal/_coreimpl.py +114 -0
- NCrystal/_hfgdata.py +546 -0
- NCrystal/_hklobjects.py +136 -0
- NCrystal/_is_std.py +0 -0
- NCrystal/_locatelib.py +210 -0
- NCrystal/_miscimpl.py +354 -0
- NCrystal/_mmc.py +757 -0
- NCrystal/_msg.py +60 -0
- NCrystal/_ncmat2cpp_impl.py +445 -0
- NCrystal/_ncmatimpl.py +2131 -0
- NCrystal/_numpy.py +76 -0
- NCrystal/_testimpl.py +579 -0
- NCrystal/api.py +56 -0
- NCrystal/atomdata.py +177 -0
- NCrystal/cfgstr.py +77 -0
- NCrystal/cifutils.py +1795 -0
- NCrystal/cli.py +96 -0
- NCrystal/constants.py +134 -0
- NCrystal/core.py +1910 -0
- NCrystal/datasrc.py +226 -0
- NCrystal/exceptions.py +66 -0
- NCrystal/hfg2ncmat.py +270 -0
- NCrystal/mcstasutils.py +438 -0
- NCrystal/misc.py +317 -0
- NCrystal/mmc.py +35 -0
- NCrystal/ncmat.py +778 -0
- NCrystal/ncmat2cpp.py +80 -0
- NCrystal/obsolete.py +67 -0
- NCrystal/plot.py +484 -0
- NCrystal/plugins.py +49 -0
- NCrystal/test.py +76 -0
- NCrystal/vdos.py +1034 -0
- ncrystal_python-3.9.81.dist-info/LICENSE +206 -0
- ncrystal_python-3.9.81.dist-info/METADATA +515 -0
- ncrystal_python-3.9.81.dist-info/RECORD +53 -0
- ncrystal_python-3.9.81.dist-info/WHEEL +5 -0
- ncrystal_python-3.9.81.dist-info/entry_points.txt +10 -0
- ncrystal_python-3.9.81.dist-info/top_level.txt +1 -0
NCrystal/test.py
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
|
|
2
|
+
################################################################################
|
|
3
|
+
## ##
|
|
4
|
+
## This file is part of NCrystal (see https://mctools.github.io/ncrystal/) ##
|
|
5
|
+
## ##
|
|
6
|
+
## Copyright 2015-2024 NCrystal developers ##
|
|
7
|
+
## ##
|
|
8
|
+
## Licensed under the Apache License, Version 2.0 (the "License"); ##
|
|
9
|
+
## you may not use this file except in compliance with the License. ##
|
|
10
|
+
## You may obtain a copy of the License at ##
|
|
11
|
+
## ##
|
|
12
|
+
## http://www.apache.org/licenses/LICENSE-2.0 ##
|
|
13
|
+
## ##
|
|
14
|
+
## Unless required by applicable law or agreed to in writing, software ##
|
|
15
|
+
## distributed under the License is distributed on an "AS IS" BASIS, ##
|
|
16
|
+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
|
|
17
|
+
## See the License for the specific language governing permissions and ##
|
|
18
|
+
## limitations under the License. ##
|
|
19
|
+
## ##
|
|
20
|
+
################################################################################
|
|
21
|
+
|
|
22
|
+
"""Module which is intended to trigger the built-in test from the command line
|
|
23
|
+
by running python3 -m NCrystal.test"""
|
|
24
|
+
|
|
25
|
+
from ._testimpl import ( test, test_cmdline, test_cmake, # noqa F401
|
|
26
|
+
test_extra, test_all ) # noqa F401
|
|
27
|
+
|
|
28
|
+
if __name__ == '__main__':
|
|
29
|
+
from . import _testimpl as _tests
|
|
30
|
+
import sys
|
|
31
|
+
args=set(sys.argv[1:])
|
|
32
|
+
if '-h' in args or '--help' in args:
|
|
33
|
+
print('Run tests. By default the standard tests if no keywords (std/cmake/cmdline/extra/all)\n'
|
|
34
|
+
'are supplied (use "verbose"/"quiet" for printout control).')
|
|
35
|
+
raise SystemExit
|
|
36
|
+
do_quiet = ('quiet' in args)
|
|
37
|
+
do_verbose = ( not do_quiet) and ('verbose' in args)
|
|
38
|
+
do_cmake = ('cmake' in args)
|
|
39
|
+
do_cmdline = ('cmdline' in args)
|
|
40
|
+
do_extra = ('extra' in args)
|
|
41
|
+
do_all = ('all' in args)
|
|
42
|
+
do_std = ('std' in args)
|
|
43
|
+
|
|
44
|
+
if not do_cmake and not do_cmdline and not do_extra and not do_all:
|
|
45
|
+
do_std = True
|
|
46
|
+
|
|
47
|
+
unknown = args - set(['cmake','cmdline','extra','all','std','verbose','quiet'])
|
|
48
|
+
for u in unknown:
|
|
49
|
+
raise SystemExit('Unknown keyword: %s'%u)
|
|
50
|
+
|
|
51
|
+
test_kwargs = dict( verbose = ('quiet' if do_quiet else do_verbose) )
|
|
52
|
+
if do_extra and do_cmake:
|
|
53
|
+
do_all = True
|
|
54
|
+
|
|
55
|
+
if ( do_cmake and do_std and do_cmdline ):
|
|
56
|
+
do_all = True
|
|
57
|
+
|
|
58
|
+
if do_all:
|
|
59
|
+
_tests.test( **test_kwargs )
|
|
60
|
+
_tests.test_cmdline( **test_kwargs )
|
|
61
|
+
_tests.test_cmake( **test_kwargs )
|
|
62
|
+
raise SystemExit
|
|
63
|
+
|
|
64
|
+
if do_extra:
|
|
65
|
+
_tests.test_extra( **test_kwargs )
|
|
66
|
+
do_std = False
|
|
67
|
+
do_cmdline = False
|
|
68
|
+
|
|
69
|
+
if do_std:
|
|
70
|
+
_tests.test( **test_kwargs )
|
|
71
|
+
|
|
72
|
+
if do_cmdline:
|
|
73
|
+
_tests.test_cmdline( **test_kwargs )
|
|
74
|
+
|
|
75
|
+
if do_cmake:
|
|
76
|
+
_tests.test_cmake( **test_kwargs )
|