ncrystal-python 4.3.0__py3-none-any.whl → 4.3.4__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 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.3.0'
58
+ __version__ = '4.3.4'
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
@@ -126,6 +126,28 @@ class modify_ncrystal_print_fct_ctxmgr:
126
126
  self.__fct = None
127
127
 
128
128
 
129
+ class capture_print_ctxmgr:
130
+ """Context manager for capturing printouts"""
131
+ def __init__(self ):
132
+ log = []
133
+ def printlog(*args, sep=' ', end='\n', file=None, flush=False):
134
+ log.append( sep.join(str(a) for a in args)
135
+ + ('' if end is None else end) )
136
+ self.__log = log
137
+ self.__fct = printlog
138
+ def __enter__(self):
139
+ self.__orig = get_ncrystal_print_fct()
140
+ set_ncrystal_print_fct( self.__fct )
141
+ return self
142
+ def __exit__(self,*args,**kwargs):
143
+ set_ncrystal_print_fct( self.__orig )
144
+ self.__orig = None
145
+ self.__fct = None
146
+ return False
147
+ @property
148
+ def data(self):
149
+ return self.__log
150
+
129
151
  def warn(msg):
130
152
  """Emit NCrystalUserWarning via standard warnings.warn function"""
131
153
  from .exceptions import NCrystalUserWarning
NCrystal/hist.py CHANGED
@@ -959,7 +959,7 @@ class HistFiller1D:
959
959
  assert xmin < xmax
960
960
  self.__nbins = nbins
961
961
  self.__xmin, self.__xmax = float(xmin), float(xmax)
962
- self.__title = str(title) or None
962
+ self.__title = None if title is None else str(title)
963
963
  self.__invbw = nbins/(xmax-xmin)
964
964
  self.__bin_edges = _np_linspace(xmin, xmax, nbins+1)
965
965
  self.__sumw = _np.zeros(nbins, dtype=float)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ncrystal-python
3
- Version: 4.3.0
3
+ Version: 4.3.4
4
4
  Summary: Library for thermal neutron transport in crystals and other materials.
5
5
  Author: NCrystal developers (Thomas Kittelmann, Xiao Xiao Cai)
6
6
  License:
@@ -1,4 +1,4 @@
1
- NCrystal/__init__.py,sha256=U9yejzdhoNtqRG8J5RsjVh7taPYfCSsH1YSodDfsG4c,4151
1
+ NCrystal/__init__.py,sha256=RL__eY8U897JcN5nGsvEGmkS-gB8LBpEqG-jgZYaP-E,4151
2
2
  NCrystal/__main__.py,sha256=oYk085KH-byQDyHDFiJ9eI_h5tvwN8yJ8CgjIqZSpbw,3624
3
3
  NCrystal/_chooks.py,sha256=ntNys5hOUYgKwq95J8ny-EUMKf5PF35SKuAvPMoLiaw,45242
4
4
  NCrystal/_cli_cif2ncmat.py,sha256=YaCHkN5qTQsRtftmayv-QQBnvjZ2x1Rs6F_LHJ6qZCw,14787
@@ -16,7 +16,7 @@ NCrystal/_cli_verifyatompos.py,sha256=jMtFqRMsJP8XBSSE-Raulobtf6LJeJO6f_fn5F4yGH
16
16
  NCrystal/_clientry.py,sha256=NQTIbqdqDYu1jEoS0m-n64BHY7wqm1eMdQ9QlP7_c-w,5534
17
17
  NCrystal/_cliimpl.py,sha256=_vmr0hY_103f4BMGm2GI7M4v75YNpd9wQ9fzl5AKL8w,13723
18
18
  NCrystal/_cliwrap_config.py,sha256=1iaQnX3d1zba7Pn4xKA7IVzlLIi2wCOuJrQz6zeKCkg,2407
19
- NCrystal/_common.py,sha256=-lJtSlcYROipTOXe2XkcgRWdXPKohH08-BRqWNlpeS0,22509
19
+ NCrystal/_common.py,sha256=6xeQZCf4bkDjvEEdkkdN7L1jNmIlEHmnOK5WwDd0Zwc,23225
20
20
  NCrystal/_coreimpl.py,sha256=YxN60FWjOXbA2UbBBfgSDhUeaqED10Gkbr93x5lAQjw,5353
21
21
  NCrystal/_hfgdata.py,sha256=kksehB71jdwfOkW0_WC1XRDBNR04ggKR2kfBekuwiw4,62828
22
22
  NCrystal/_hklobjects.py,sha256=2tsKPCXKlksB3iKtq2mv8RgV45Ua_ywyvpVzlrkGcdU,4973
@@ -43,7 +43,7 @@ NCrystal/core.py,sha256=ofHwclmmsuQXwQf4kqCO0fkoS9Cn4o8orwtfi59D35I,84499
43
43
  NCrystal/datasrc.py,sha256=N_zOvHgpXTxTy2Rl1VuW6RfU34sCgNMTzYftmjp1RjE,9978
44
44
  NCrystal/exceptions.py,sha256=MEgPfDecQqs-0PurU-yOgtTr21-YBxttV2GVsuU5uyo,2679
45
45
  NCrystal/hfg2ncmat.py,sha256=DUXqajdz8DIqwWSHqkRqP-Ng93D-NfC970ScS24ZehU,10189
46
- NCrystal/hist.py,sha256=zBvvw7R1gLGxJq0djYCVByUyhDau7S53fvpKsEdEeNs,43797
46
+ NCrystal/hist.py,sha256=F91hAyTkxOvps-zkWuPLe6liPCh76adEhL5vVVNaQzQ,43816
47
47
  NCrystal/mcstasutils.py,sha256=A6LViE0USo6mxB2b6fxj6hADQilCReRZ9XqyoKxxqHU,18650
48
48
  NCrystal/minimc.py,sha256=Mb2bzrzvpei2f7P1ds1OcCPiNagmu6uM0RNKiep7nCI,6008
49
49
  NCrystal/minimc_objects.py,sha256=rXMQ_lpoSnpSmUaXulmj_xMaW0o7HM4j37bMjoOrMNc,19153
@@ -57,9 +57,9 @@ NCrystal/plot.py,sha256=zndm1GT5VBVyKHHEVyJoccnfuGkHDRvs2PsblxGUEK4,28473
57
57
  NCrystal/plugins.py,sha256=jdyNHHjS6qJtisy1tqeWBidCSX1UX797hQFNEmqN50Y,2440
58
58
  NCrystal/test.py,sha256=ogLLfvXoTR_KiX0SWAFkqXSUDAzlgH_0cDPIVdqU2y8,2731
59
59
  NCrystal/vdos.py,sha256=PzP0abjpj9vW1JWSh-qY0_LSYSTwRXVvYrnkQOa9IfQ,47332
60
- ncrystal_python-4.3.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
61
- ncrystal_python-4.3.0.dist-info/METADATA,sha256=58ernr3DcfmBIHJ9kQlOFPJkpsu7sM3EgVJqyqIrctE,16274
62
- ncrystal_python-4.3.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
63
- ncrystal_python-4.3.0.dist-info/entry_points.txt,sha256=GPVTPLWJz1NCRMTEA0SjBrn8d-o0G57uzz885qA54Uc,642
64
- ncrystal_python-4.3.0.dist-info/top_level.txt,sha256=VIJdIQMfLIbKpFXA8xm0fKY5okz8s5IHrZTYDSH18y0,9
65
- ncrystal_python-4.3.0.dist-info/RECORD,,
60
+ ncrystal_python-4.3.4.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
61
+ ncrystal_python-4.3.4.dist-info/METADATA,sha256=Z31eVK5UUPEQGZO3orNfOL_QpNc_jL2fc87ABGKSZww,16274
62
+ ncrystal_python-4.3.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
63
+ ncrystal_python-4.3.4.dist-info/entry_points.txt,sha256=GPVTPLWJz1NCRMTEA0SjBrn8d-o0G57uzz885qA54Uc,642
64
+ ncrystal_python-4.3.4.dist-info/top_level.txt,sha256=VIJdIQMfLIbKpFXA8xm0fKY5okz8s5IHrZTYDSH18y0,9
65
+ ncrystal_python-4.3.4.dist-info/RECORD,,