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

fix: suppress buggy output from pytensor.function #595

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

cpaniaguam
Copy link
Collaborator

See #594.

@cpaniaguam cpaniaguam added bug Something isn't working enhancement New feature or request labels Oct 18, 2024
@cpaniaguam cpaniaguam self-assigned this Oct 18, 2024
Copy link
Collaborator

@AlexanderFengler AlexanderFengler left a comment

Choose a reason for hiding this comment

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

Is this functionality meant to sit in test_likelihoods.py or is this wip?

@cpaniaguam
Copy link
Collaborator Author

pytensor.function is also used in

lapse_func = pytensor.function(

It could be used there as well right now.

@AlexanderFengler Where would a good home be for the output suppressor?

@cpaniaguam cpaniaguam force-pushed the fix-suppress-output-pytensor-function branch from 5793a2e to 7e4a5a2 Compare October 21, 2024 20:02
Copy link
Collaborator

@digicosmos86 digicosmos86 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just one comment: we use numpy docstring format. The docstring is slightly non-standard :)

Copy link
Collaborator

@AlexanderFengler AlexanderFengler left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -548,3 +550,43 @@ def _rearrange_data(data: pd.DataFrame | np.ndarray) -> pd.DataFrame | np.ndarra
def _split_array(data: np.ndarray | list[int], divisor: int) -> list[np.ndarray]:
num_splits = len(data) // divisor + (1 if len(data) % divisor != 0 else 0)
return [tmp.astype(int) for tmp in np.array_split(data, num_splits)]


class SuppressOutput:
Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry about the late response here, but his converged to the right spot :)

@cpaniaguam cpaniaguam merged commit 8e0908b into main Oct 23, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants