ncrystal-python 4.2.0__py3-none-any.whl → 4.2.2__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 +1 -1
- NCrystal/_common.py +26 -0
- NCrystal/_ncmat2endf_impl.py +3 -1
- NCrystal/ncmat2endf.py +2 -2
- {ncrystal_python-4.2.0.dist-info → ncrystal_python-4.2.2.dist-info}/METADATA +1 -1
- {ncrystal_python-4.2.0.dist-info → ncrystal_python-4.2.2.dist-info}/RECORD +10 -10
- {ncrystal_python-4.2.0.dist-info → ncrystal_python-4.2.2.dist-info}/WHEEL +0 -0
- {ncrystal_python-4.2.0.dist-info → ncrystal_python-4.2.2.dist-info}/entry_points.txt +0 -0
- {ncrystal_python-4.2.0.dist-info → ncrystal_python-4.2.2.dist-info}/licenses/LICENSE +0 -0
- {ncrystal_python-4.2.0.dist-info → ncrystal_python-4.2.2.dist-info}/top_level.txt +0 -0
NCrystal/__init__.py
CHANGED
|
@@ -55,7 +55,7 @@ For detailed usage conditions and licensing of this open source project, see:
|
|
|
55
55
|
|
|
56
56
|
#NB: Synchronize meta-data below with fields in setup.py+template_setup.py.in meta data:
|
|
57
57
|
__license__ = "Apache 2.0, http://www.apache.org/licenses/LICENSE-2.0"
|
|
58
|
-
__version__ = '4.2.
|
|
58
|
+
__version__ = '4.2.2'
|
|
59
59
|
__status__ = "Production"
|
|
60
60
|
__author__ = "NCrystal developers (Thomas Kittelmann, Xiao Xiao Cai)"
|
|
61
61
|
__copyright__ = "Copyright 2015-2024 %s"%__author__
|
NCrystal/_common.py
CHANGED
|
@@ -514,3 +514,29 @@ def _lookup_existing_file( path ):
|
|
|
514
514
|
p = pathlib.Path(dd).joinpath(path)
|
|
515
515
|
if p.exists():
|
|
516
516
|
return p.absolute()
|
|
517
|
+
|
|
518
|
+
_override_datetime_now = [ None ]
|
|
519
|
+
def _datetime_now():
|
|
520
|
+
"""Returns datetime.datetime.now() but possibly intercepted for unit tests"""
|
|
521
|
+
import datetime
|
|
522
|
+
n = datetime.datetime.now()
|
|
523
|
+
return _override_datetime_now[0] or n
|
|
524
|
+
|
|
525
|
+
class FixedFakeDatetimeNow():
|
|
526
|
+
# Context manager to be used in unit tests to modify the returned value from
|
|
527
|
+
# the datetime_now function below, to a fixed value.
|
|
528
|
+
def __enter__(self):
|
|
529
|
+
import datetime
|
|
530
|
+
self.__orig = _override_datetime_now[0]
|
|
531
|
+
_override_datetime_now[0] = datetime.datetime( 2017, 8, 29, 13, 40,
|
|
532
|
+
tzinfo
|
|
533
|
+
= datetime.timezone.utc )
|
|
534
|
+
def __exit__(self,*args,**kwargs):
|
|
535
|
+
_override_datetime_now[0] = self.__orig
|
|
536
|
+
|
|
537
|
+
def fixed_fake_datetime_now(f):
|
|
538
|
+
#To be used as a decorator
|
|
539
|
+
def fw(*a, **kw):
|
|
540
|
+
with FixedFakeDatetimeNow():
|
|
541
|
+
return f(*a, **kw)
|
|
542
|
+
return fw
|
NCrystal/_ncmat2endf_impl.py
CHANGED
|
@@ -1524,7 +1524,9 @@ def _tidy_beta( x, allow_negative=False):
|
|
|
1524
1524
|
assert -1e99 <= x <= 1e99
|
|
1525
1525
|
else:
|
|
1526
1526
|
assert 0.0 <= x <= 1e99
|
|
1527
|
-
if x
|
|
1527
|
+
if x < -120:
|
|
1528
|
+
return float('%.1g'%x)
|
|
1529
|
+
if abs(x) > 8:
|
|
1528
1530
|
return float('%.2g'%x)
|
|
1529
1531
|
return float('%.3g'%x)
|
|
1530
1532
|
|
NCrystal/ncmat2endf.py
CHANGED
|
@@ -185,12 +185,12 @@ class EndfMetaData():
|
|
|
185
185
|
(key,value) pairs, or another EndfMetaData object, the associated values
|
|
186
186
|
will be updated accordingly.
|
|
187
187
|
"""
|
|
188
|
-
from
|
|
188
|
+
from ._common import _datetime_now
|
|
189
189
|
import copy
|
|
190
190
|
from ._ncmat2endf_impl import _metadata_definitions
|
|
191
191
|
self.__data = dict( (k,copy.deepcopy(v['defval']))
|
|
192
192
|
for k,v in _metadata_definitions.items() )
|
|
193
|
-
self.__now_MMMYY =
|
|
193
|
+
self.__now_MMMYY = _datetime_now().strftime('%b%y').upper()
|
|
194
194
|
if data:
|
|
195
195
|
self.update_from_dict(data)
|
|
196
196
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
NCrystal/__init__.py,sha256=
|
|
1
|
+
NCrystal/__init__.py,sha256=HBWHBQGuKN-FUrsd3L1ZqyBcRloJatZmGWXJl9cQIAc,4151
|
|
2
2
|
NCrystal/__main__.py,sha256=tYOeVhY6joHahgtnBwNgcBDd-WXYQoHFmpslk2TAlTY,3624
|
|
3
3
|
NCrystal/_chooks.py,sha256=blZZ4IWjZDYAS7YLhmqxjYKl2IArcE4dotZXoziDE48,43713
|
|
4
4
|
NCrystal/_cli_cif2ncmat.py,sha256=Hmp8MWV7d3Bzu_5Ekiik9Pdv43yNyZygun8HtqShn78,14626
|
|
@@ -13,7 +13,7 @@ NCrystal/_cli_vdos2ncmat.py,sha256=SnLHzwc1Vg5V896zc4ou1Eug1tKwZR3qrGcCrMybjAI,2
|
|
|
13
13
|
NCrystal/_cli_verifyatompos.py,sha256=cDcbLlaBUo6F9_nhFjNYXrqgAoPdpw_U2IUBFrTM3-g,12348
|
|
14
14
|
NCrystal/_cliimpl.py,sha256=3boTxHnmX3ppqSvOHPauU4LPULr8OqHTF8a9KeBiU4E,13354
|
|
15
15
|
NCrystal/_cliwrap_config.py,sha256=RPawApLbRrZRTkWdAP3JK_eTtU_nfPrARYcnfF1-7sE,2002
|
|
16
|
-
NCrystal/_common.py,sha256=
|
|
16
|
+
NCrystal/_common.py,sha256=YNQ9xm6lqtc_E75RRvCSGVTunJkr-T6BMOmGRa1kj0k,19860
|
|
17
17
|
NCrystal/_coreimpl.py,sha256=dWBPwbdb8l8Bi3wfDaaQVyqSqTQzwDfs1oEIJR9KTiQ,5727
|
|
18
18
|
NCrystal/_hfgdata.py,sha256=uYTB_xHTHVN8Vw91wr7_kXi18ileHJGNyVjnSi-Ss7g,62828
|
|
19
19
|
NCrystal/_hklobjects.py,sha256=wQAUe3tD6UncSW-qfuyAh5jSGnA_2kzvE5-HZ43s3xQ,4974
|
|
@@ -23,7 +23,7 @@ NCrystal/_miscimpl.py,sha256=SF1RriTZXgF4uINON6UZqY4vtroJZJ_HuoGaV0tMuK0,17380
|
|
|
23
23
|
NCrystal/_mmc.py,sha256=FiavyAkRDb3MZ222AHXbmQpBQLwqBdzxtDCMunnKfRI,29349
|
|
24
24
|
NCrystal/_msg.py,sha256=wBJk0kGHusm0xXSt8KNYq6iIO_cubnznvnJ5Erl87EU,2624
|
|
25
25
|
NCrystal/_ncmat2cpp_impl.py,sha256=D_knqsv92EnaPJlufE3fJe2fnETnyQ8k9TbMwpXmxZs,18383
|
|
26
|
-
NCrystal/_ncmat2endf_impl.py,sha256=
|
|
26
|
+
NCrystal/_ncmat2endf_impl.py,sha256=TlBwdM5JvvVzZ7qigs1FHrIVPSkgfePW9_e1WGDBALE,62691
|
|
27
27
|
NCrystal/_ncmatimpl.py,sha256=fsIHG77q27tZT9R7ZDMrSr3yunT2W5dE9FH6uA0gvYk,95041
|
|
28
28
|
NCrystal/_numpy.py,sha256=SwFcvrNBDqP647guedRdFeISsC8b4VvGm9McFyF1gJQ,2924
|
|
29
29
|
NCrystal/_sabutils.py,sha256=vZD2wB42r48_0EZKPTS6q5sKN1RGgjWi2zVuVvtbdGk,4798
|
|
@@ -43,15 +43,15 @@ NCrystal/misc.py,sha256=KmbmW2PB2roQReqLtn-RWse30f6w7gOmJPb7cId_-ME,14083
|
|
|
43
43
|
NCrystal/mmc.py,sha256=LQ0IXMgJexpSPrGYwZZm6bAh5Bo6y2z5CjezFAFy1UE,1948
|
|
44
44
|
NCrystal/ncmat.py,sha256=iOBbe7KmmgAeMDnFpBDqzinUYjn9QpH8YRhaklt4dzs,42577
|
|
45
45
|
NCrystal/ncmat2cpp.py,sha256=_gXxXgbPcCmn0XnLx0h_dS_N3s4d18RORDSgSeVTgG4,4398
|
|
46
|
-
NCrystal/ncmat2endf.py,sha256=
|
|
46
|
+
NCrystal/ncmat2endf.py,sha256=1T1I08mWRG_yBhdb20dzEaVJMC0OeF2BYm2qY-L9BHg,12504
|
|
47
47
|
NCrystal/obsolete.py,sha256=v2HzQFqdrLaGm6bWNqioGwMdQMAhuWYSbTEF2He_HbY,3451
|
|
48
48
|
NCrystal/plot.py,sha256=oymblLRKTfE2xCsX4W7H6cXIKxDNV7rr6Z4dZnCJjt0,19975
|
|
49
49
|
NCrystal/plugins.py,sha256=U4EF25DlYE8aO6uoG5Ptyia5Nj08LCrVl7973BCIkDI,2440
|
|
50
50
|
NCrystal/test.py,sha256=fH6OfjvQ2KJRYaooYVGFsp4QJGj_WC4QRq1bPd36vwg,2731
|
|
51
51
|
NCrystal/vdos.py,sha256=DL3UtaCMLaY-bBB6ztT1qZKYfO44INeEpgra_9JAyMo,47607
|
|
52
|
-
ncrystal_python-4.2.
|
|
53
|
-
ncrystal_python-4.2.
|
|
54
|
-
ncrystal_python-4.2.
|
|
55
|
-
ncrystal_python-4.2.
|
|
56
|
-
ncrystal_python-4.2.
|
|
57
|
-
ncrystal_python-4.2.
|
|
52
|
+
ncrystal_python-4.2.2.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
53
|
+
ncrystal_python-4.2.2.dist-info/METADATA,sha256=aUQvlJ7Ijju7DGy4p1RwvGk5iMGTrBAAXGD96xzUQaQ,16274
|
|
54
|
+
ncrystal_python-4.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
55
|
+
ncrystal_python-4.2.2.dist-info/entry_points.txt,sha256=I9Nz-pdriq2xHbYRAw-yUaI33jQwVbNRy8-3mCVe_jE,521
|
|
56
|
+
ncrystal_python-4.2.2.dist-info/top_level.txt,sha256=VIJdIQMfLIbKpFXA8xm0fKY5okz8s5IHrZTYDSH18y0,9
|
|
57
|
+
ncrystal_python-4.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|