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

have custom Grid throw error if spacing or weights is called when it was not passed in #981

Closed
dpanici opened this issue Apr 3, 2024 · 2 comments · Fixed by #985
Closed
Assignees

Comments

@dpanici
Copy link
Collaborator

dpanici commented Apr 3, 2024

No description provided.

@unalmis
Copy link
Collaborator

unalmis commented Apr 3, 2024

The idea is that, if we are assigning these automatically, we should assign uniform spacing / uniform weights if the user doesn't pass them in. While we can compute the weights to be uniform automatically, it is not possible to compute uniform spacing without additional information. To get uniform spacing you would need to do:

spacing = jnp.array([1 / rho.size, 2 * jnp.pi / t.size, 2 * jnp.pi / z.size])[
which requires knowing the number of unique surfaces. Had I not explicitly passed in this spacing, then the computation would be incorrect and it would take long to debug. Others may forget, so we should throw an error unless spacing is passed in explicitly.

@unalmis
Copy link
Collaborator

unalmis commented Apr 3, 2024

And then also delete this chunk, since it is an identity operation for the non-custom grids anyway, and we shouldn't modify spacing if it is passed in by the user.

if (self.spacing.T * duplicates ** (1 / 6)).prod(axis=0).sum():

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants