Skip to content

Fix HeterodynedTransientLikelihoodFD initialization#238

Merged
kazewong merged 1 commit into208-replacing-keyword-arguments-in-single_eventlikelihoodpyfrom
bugfix
Jul 15, 2025
Merged

Fix HeterodynedTransientLikelihoodFD initialization#238
kazewong merged 1 commit into208-replacing-keyword-arguments-in-single_eventlikelihoodpyfrom
bugfix

Conversation

@thomasckng
Copy link
Collaborator

@thomasckng thomasckng commented Jul 15, 2025

Summary by CodeRabbit

  • New Features
    • Added support for specifying fixed parameters when initializing the heterodyned transient likelihood functionality. This provides greater flexibility in configuring likelihood calculations.

@thomasckng thomasckng requested a review from kazewong July 15, 2025 06:36
@coderabbitai
Copy link

coderabbitai bot commented Jul 15, 2025

Walkthrough

The constructor of the HeterodynedTransientLikelihoodFD class was updated to accept an optional fixed_parameters argument. This parameter is now passed to the superclass constructor, aligning the initialization with the base class and supporting fixed parameters in the heterodyned likelihood workflow.

Changes

File(s) Change Summary
src/jimgw/core/single_event/likelihood.py Updated HeterodynedTransientLikelihoodFD constructor to add and pass fixed_parameters to the superclass. Adjusted signature accordingly.

Suggested labels

bug

Suggested reviewers

  • kazewong

Poem

A tweak in the code, a parameter new,
Now fixed values glide right through.
Constructors aligned, inheritance neat,
Hopping along, our fix is complete!
With every small change, we leap and we bound—
The likelihood’s better, the bugs are unbound!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6ae3d6 and cbd7d82.

📒 Files selected for processing (1)
  • src/jimgw/core/single_event/likelihood.py (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: kazewong
PR: kazewong/jim#172
File: src/jimgw/single_event/likelihood.py:50-53
Timestamp: 2025-04-25T12:01:32.432Z
Learning: The `**kwargs` pattern in the `TransientLikelihoodFD` constructor should be replaced with explicit parameters in a future refactoring to improve API clarity and debuggability, but requires careful consideration due to varying keyword parameters in the underlying likelihood functions.
Learnt from: thomasckng
PR: kazewong/jim#218
File: src/jimgw/single_event/transforms.py:359-369
Timestamp: 2025-05-13T06:24:16.876Z
Learning: The `d_hat_unbounded` parameter in DistanceToSNRWeightedDistanceTransform has been renamed to `d_hat`, and the corresponding unit tests in test/unit/test_transform.py will be updated in a separate PR.
src/jimgw/core/single_event/likelihood.py (2)
Learnt from: kazewong
PR: kazewong/jim#172
File: src/jimgw/single_event/likelihood.py:50-53
Timestamp: 2025-04-25T12:01:32.432Z
Learning: The `**kwargs` pattern in the `TransientLikelihoodFD` constructor should be replaced with explicit parameters in a future refactoring to improve API clarity and debuggability, but requires careful consideration due to varying keyword parameters in the underlying likelihood functions.
Learnt from: thomasckng
PR: kazewong/jim#218
File: src/jimgw/single_event/transforms.py:359-369
Timestamp: 2025-05-13T06:24:16.876Z
Learning: The `d_hat_unbounded` parameter in DistanceToSNRWeightedDistanceTransform has been renamed to `d_hat`, and the corresponding unit tests in test/unit/test_transform.py will be updated in a separate PR.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: pre-commit (3.12)
  • GitHub Check: pre-commit (3.11)
🔇 Additional comments (2)
src/jimgw/core/single_event/likelihood.py (2)

417-417: Good addition of fixed_parameters support.

The fixed_parameters parameter addition aligns the constructor with the base class BaseTransientLikelihoodFD and follows the established pattern across the codebase.


431-431: Correct parameter propagation to superclass.

The fixed_parameters parameter is properly passed to the base class constructor, completing the integration of fixed parameters support in the heterodyned likelihood workflow.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@thomasckng
Copy link
Collaborator Author

@coderabbitai review

@thomasckng thomasckng self-assigned this Jul 15, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 15, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thomasckng thomasckng added the bug Something isn't working label Jul 15, 2025
@kazewong kazewong merged commit d9cae2a into 208-replacing-keyword-arguments-in-single_eventlikelihoodpy Jul 15, 2025
1 of 7 checks passed
@kazewong kazewong deleted the bugfix branch July 15, 2025 12:47
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

Successfully merging this pull request may close these issues.

2 participants