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

Feature/distributions part2 #7

Merged
merged 7 commits into from
Oct 19, 2024
Merged

Feature/distributions part2 #7

merged 7 commits into from
Oct 19, 2024

Conversation

whaeck
Copy link
Member

@whaeck whaeck commented Aug 1, 2024

This PR adds the following one dimensional function components:

  • Legendre and tabulated angular distributions
  • tabulated energy distributions

This PR adds the following two dimensional function components:

  • Legendre angular distribution data on a grid
  • Tabulated angular distribution data on a grid
  • Tabulated energy distribution data on a grid

This is based on the latest scion developments

@whaeck whaeck requested review from cjosey and nathangibson14 August 1, 2024 20:53
@whaeck whaeck requested a review from joewpeterson September 9, 2024 18:50
Copy link

@cjosey cjosey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Questions]
Are there no equivalent Python tests for the energy-angle evaluation?
Do operators like chunk(energy, angle) work with numpy.ndarray inputs or do you have to construct an numpy.vectorize object?

Otherwise, looks good.

Edit: I see now, the Python interface is in part 3.

@whaeck
Copy link
Member Author

whaeck commented Oct 18, 2024

chunk(energy, angle) is a function call that interpolates on the the data.

@cjosey
Copy link

cjosey commented Oct 18, 2024

chunk(energy, angle) is a function call that interpolates on the the data.

I meant more in this sense:

import numpy as np

e_vals = np.logspace(-5, 8, 100)
mu_vals = np.linspace(-1, 1, 50)

e_mesh, mu_mesh = np.meshgrid(e_vals, mu_vals)

val = chunk(e_mesh, mu_mesh)

If it's only a scalar argument, I could just do

chunk_vecfun = np.vectorize(chunk)

val = chunk_vecfun(e_mesh, mu_mesh)

@whaeck
Copy link
Member Author

whaeck commented Oct 19, 2024

Oh, that's an interesting use case.

The function is specifically only for scalar arguments, and only returns a double. I won't be able to do it with the call operator - as C++ requires the same return type when using operator overloading. Still, I'll look into it.

@whaeck whaeck merged commit 2b5646f into develop Oct 19, 2024
8 checks passed
@whaeck whaeck deleted the feature/distributions-part2 branch October 19, 2024 14:24
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 this pull request may close these issues.

2 participants