BAMWelDX / weldx

The welding data exchange format
https://www.bam.de/weldx
BSD 3-Clause "New" or "Revised" License
20 stars 10 forks source link

Add or modify interfaces of `from_euler` functions to support quantities #776

Open vhirtham opened 2 years ago

vhirtham commented 2 years ago

While refactoring the LCS tutorial I used the from_euler functions a lot. They currently require something like this:

WelDXClass.from_euler(sequence="x", angles=[1], degrees=False)

The combined parameters angles and degrees are basically just information that can be expressed by a quantity. I think we should modify the interface to support pint.Quantity to be consistent with the rest of the code base and we can write something like this instead:

WelDXClass.from_euler(sequence="x", angles="1rad")
CagtayFabry commented 2 years ago

We could implement this using WXRotation (which we should do anyway instead of scipy) in .from_euler since WXRotation can already handle quantities as inputs by always converting to quantities like we do in the other classes.