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

Unifying the use and calculation of QSO luminosity #18

Closed
wants to merge 0 commits into from

Conversation

MBravoS
Copy link
Collaborator

@MBravoS MBravoS commented Jul 4, 2024

Both the calculation of CO SLEDs and AGN bolometric LFs use the AGN luminosities. Previously this had to be recalculated as we didn't save the AGN luminosities in the Shark outputs. With their recent addition to the outputs in 24f0d89 (along with other properties) we can simplify both calculate_co_emission.py and lf_qso.py to just read the saved AGN luminosities instead of recalculating them. This also fixes the current inconsistency between both recalculations, as the one currently in calculate_co_emission.py doesn't take BH spin into account.

Summary by Sourcery

This pull request unifies the use and calculation of AGN luminosities by leveraging precomputed values from Shark outputs, thereby simplifying the code and ensuring consistency across different modules.

  • Enhancements:
    • Simplified the calculation of AGN bolometric luminosities by reading precomputed values from the Shark outputs instead of recalculating them in both calculate_co_emission.py and lf_qso.py.

Copy link

sourcery-ai bot commented Jul 4, 2024

Reviewer's Guide by Sourcery

This pull request unifies the use and calculation of QSO luminosity by removing the need to recalculate AGN luminosities in qso_lf.py and calculate_co_emission.py. Instead, it directly reads the saved AGN luminosities from the HDF5 data, simplifying the code and fixing inconsistencies.

File-Level Changes

Files Changes
standard_plots/qso_lf.py
standard_plots/calculate_co_emission.py
Removed the recalculation of AGN luminosities and directly used the saved L_bol and Lbol values from the HDF5 data, simplifying the code and ensuring consistency.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @MBravoS - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.


if(read_spin):
(h0, volh, MBH, bh_accretion_rate_hh, bh_accretion_rate_sb, BH_spin) = hdf5_data
else:
Copy link

Choose a reason for hiding this comment

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

issue: Unused variable vol

The variable vol is calculated but not used in the function. Consider removing it if it is not needed.

if(read_spin):
(h0, volh, MBH, bh_accretion_rate_hh, bh_accretion_rate_sb, BH_spin) = hdf5_data
else:
(h0, volh, MBH, bh_accretion_rate_hh, bh_accretion_rate_sb) = hdf5_data
Copy link

Choose a reason for hiding this comment

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

issue: Changed L_bol calculation

The calculation of L_bol has been simplified. Ensure that this change does not affect the handling of edge cases where L_bol might be zero or negative.

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.

1 participant