Base: Quantity: use isDimensionless whenever feasible
Quantity is often queried for Unit just to see if it has a dimension. Ask Quantity directly using isDimensionless() method and modify that method not to care about Quantity value validity; no user was ever asking for value validity.
This commit is contained in:
@@ -488,7 +488,7 @@ static inline Quantity pyToQuantity(const Py::Object &pyobj,
|
||||
}
|
||||
|
||||
Py::Object pyFromQuantity(const Quantity &quantity) {
|
||||
if(!quantity.getUnit().isEmpty())
|
||||
if (!quantity.isDimensionless())
|
||||
return Py::asObject(new QuantityPy(new Quantity(quantity)));
|
||||
double v = quantity.getValue();
|
||||
long l;
|
||||
|
||||
Reference in New Issue
Block a user