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

Int input to atmos.rays/compute_rays #42

Closed
Goobley opened this issue Sep 29, 2023 · 0 comments
Closed

Int input to atmos.rays/compute_rays #42

Goobley opened this issue Sep 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Goobley
Copy link
Owner

Goobley commented Sep 29, 2023

If an int is passed into atmos.rays instead of a float, e.g. due to the case of ctx.compute_rays(wave, 1), it is not caught by the non-iterable check, as this checks isinstance(muz, float). This cascades onwards causing a number of issues, resulting in failure to create a new Context.
Further if one instead puts a list with a singular int, different but similar issues arise due to types getting carried over somewhere, and being incompatible with the backend memory views (e.g. ctx.compute_rays(wave, [1])).

The best fix here is likely to be using something like np.asarray(muz, dtype=np.float64) instead of the current checks (and then ensuring that it's 1- and not 0-dimensional).

For now this issue can be worked around by only passing floats to the mu argument: e.g. ctx.compute_rays(wave, 1.0).

@Goobley Goobley added the bug Something isn't working label Sep 29, 2023
@Goobley Goobley closed this as completed Jan 8, 2024
This issue was closed.
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