Skip to content

Commit

Permalink
Refs #4399. Switch from long->int until Max fix is working.
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Mar 5, 2012
1 parent 25280b4 commit 92c0134
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Mantid

// Map the Python types to the best match in C++
REGISTER_MAPPING(PyFloat_Type, double);
REGISTER_MAPPING(PyInt_Type, long);
REGISTER_MAPPING(PyInt_Type, int);
REGISTER_MAPPING(PyString_Type, std::string);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace
void export_BoundedValidator()
{
EXPORT_BOUNDEDVALIDATOR(double);
EXPORT_BOUNDEDVALIDATOR(int);
EXPORT_BOUNDEDVALIDATOR(long);
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace
void export_IValidators()
{
EXPORT_IVALIDATOR(double,double);
EXPORT_IVALIDATOR(int,int);
EXPORT_IVALIDATOR(long,long);
EXPORT_IVALIDATOR(std::string,std_string);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ def BoundedValidator(lower = None, upper = None):
raise TypeError("Cannot create a BoundedValidator with both lower and upper limit unset.")

def get_validator_class(value):
from mantid.kernel import BoundedValidator_double, BoundedValidator_long
from mantid.kernel import BoundedValidator_double, BoundedValidator_int
if type(value) == float:
from mantid.kernel import BoundedValidator_double
return BoundedValidator_double
elif type(value) == int:
return BoundedValidator_long
from mantid.kernel import BoundedValidator_int
return BoundedValidator_int
else:
raise TypeError("Unknown type passed for BoundedValidator: %s" % str(type(value)))
#
Expand Down

0 comments on commit 92c0134

Please sign in to comment.