Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/amuse/units/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,9 @@ def __truediv__(self, other):
# return factor_unit(1.0 / other, self)

def __rmul__(self, other):
if other == 1:
return self
else:
if isinstance(other, unit):
return factor_unit(other, self)
return self.new_quantity(other)
if isinstance(other, unit):
return factor_unit(other, self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong, because factor units are supposed to construct from a number(like) and a unit..you should only get here with other a number..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced it with mul_unit, I think that's correct?

return self.new_quantity(other)

def __ror__(self, value):
"""Create a new Quantity object.
Expand Down