Skip to content

Commit

Permalink
import from dgcode mercurial: version 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tkittel committed Aug 30, 2017
1 parent a3fdb29 commit fb9a131
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v0.9.1 2017-08-30
* Proper behaviour of python interface if Numpy is absent.

v0.9.0 2017-08-30
* First github based public release of NCrystal.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0
0.9.1
6 changes: 3 additions & 3 deletions ncrystal_core/include/NCrystal/NCVersion.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

#define NCRYSTAL_VERSION_MAJOR 0
#define NCRYSTAL_VERSION_MINOR 9
#define NCRYSTAL_VERSION_PATCH 0
#define NCRYSTAL_VERSION 9000 /* (1000000*MAJOR+1000*MINOR+PATCH) */
#define NCRYSTAL_VERSION_STR "0.9.0"
#define NCRYSTAL_VERSION_PATCH 1
#define NCRYSTAL_VERSION 9001 /* (1000000*MAJOR+1000*MINOR+PATCH) */
#define NCRYSTAL_VERSION_STR "0.9.1"

#endif
6 changes: 3 additions & 3 deletions ncrystal_core/include/NCrystal/ncrystal.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ extern "C" {
/* NCrystal version info: */
#define NCRYSTAL_VERSION_MAJOR 0
#define NCRYSTAL_VERSION_MINOR 9
#define NCRYSTAL_VERSION_PATCH 0
#define NCRYSTAL_VERSION 9000 /* (1000000*MAJOR+1000*MINOR+PATCH) */
#define NCRYSTAL_VERSION_STR "0.9.0"
#define NCRYSTAL_VERSION_PATCH 1
#define NCRYSTAL_VERSION 9001 /* (1000000*MAJOR+1000*MINOR+PATCH) */
#define NCRYSTAL_VERSION_STR "0.9.1"
int ncrystal_version(); /* returns NCRYSTAL_VERSION */
const char * ncrystal_version_str(); /* returns NCRYSTAL_VERSION_STR */

Expand Down
2 changes: 1 addition & 1 deletion ncrystal_mcstas/NCrystal_sample.comp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* %I
*
* Written by: NCrystal developers
* Version: 0.9.0
* Version: 0.9.1
* Origin: NCrystal Developers (European Spallation Source ERIC and DTU Nutech)
*
* McStas sample component for the NCrystal scattering library. Find more
Expand Down
15 changes: 11 additions & 4 deletions ncrystal_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

__license__ = "Apache 2.0, http://www.apache.org/licenses/LICENSE-2.0"
__copyright__ = "Copyright 2017"
__version__ = '0.9.0'
__version__ = '0.9.1'
__status__ = "Production"
__author__ = "NCrystal developers (Thomas Kittelmann, Xiao Xiao Cai)"
__copyright__ = "Copyright 2015-2017 %s"%__author__
Expand Down Expand Up @@ -125,8 +125,6 @@ def _find_nclib():
except ImportError:
_np = None



_globalstates = {}


Expand Down Expand Up @@ -244,6 +242,8 @@ def ncrystal_info_getstructure(nfo):


def _prepare_many(ekin,repeat):
if _np is None and not repeat is None:
raise NCBadInput('Can not use "repeat" parameter when Numpy is absent on the system')
if repeat is None and not hasattr(ekin,'__len__'):
return None#scalar case, array interface not triggered
repeat = 1 if repeat is None else repeat
Expand Down Expand Up @@ -698,7 +698,14 @@ def flteq(a,b,rtol=1.0e-6,atol=1.0e-6):
(2.0527318521221001, 0.0), (2.0527318521221001, 0.0), (2.0527318521221001, 0.0),
(2.8283092712311082, 0.0), (0.72997630752329012, 0.038570589541834406),
(2.0527318521221001, 0.0), (2.0527318521221001, 0.0)]
ang,de = alpc.generateScatteringNonOriented(wl2ekin(4.0),repeat=10)
if _np is None:
ang,de=[],[]
for i in range(10):
_ang,_de=alpc.generateScatteringNonOriented(wl2ekin(4.0))
ang += [_ang]
de += [_de]
else:
ang,de = alpc.generateScatteringNonOriented(wl2ekin(4.0),repeat=10)
for i in range(10):
require(flteq(ang[i],expected[i][0]))
require(flteq(de[i],expected[i][1]))
Expand Down

0 comments on commit fb9a131

Please sign in to comment.