simpa icon indicating copy to clipboard operation
simpa copied to clipboard

Spectrum constructor args type does not match with corresponding attribute type

Open RecurvedBow opened this issue 1 year ago • 0 comments

Describe the bug Even though the constructor of sp.Spectrum expects for the parameter wavelengths an args of type np.ndarray, the resulting attribute wavelengths of the created spectrum instance is of type torch.Tensor. The problem is that if you want to copy the wavelengths of one spectrum to a new spectrum instance, you would have to convert the wavelengths attribute tensor to np.ndarray first (otherwise it causes an error).

Solution Decide on the same type for both constructor parameter and instance attribute, then update the implementation accordingly. If other parameters/attributes also have this issue, update these too.

RecurvedBow avatar Dec 04 '24 12:12 RecurvedBow