Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spectrum constructor args type does not match with corresponding attribute type #409

Open
RecurvedBow opened this issue Dec 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@RecurvedBow
Copy link
Collaborator

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 RecurvedBow added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant