HERA-Team / hera_pspec

HERA power spectrum estimation code and data formats
http://hera-pspec.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

feat: add profiling/logging arguments to scripts #380

Closed steven-murray closed 1 year ago

steven-murray commented 1 year ago

This simply uses the new cli-tools in hera_cal to add a bit of functionality to hera_pspec scripts.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (c34b82e) 95.98% compared to head (032bd55) 95.98%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #380 +/- ## ======================================= Coverage 95.98% 95.98% ======================================= Files 17 17 Lines 6053 6053 ======================================= Hits 5810 5810 Misses 243 243 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `95.98% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/HERA-Team/hera_pspec/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | Coverage Δ | | |---|---|---| | [hera\_pspec/plot.py](https://codecov.io/gh/HERA-Team/hera_pspec/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#diff-aGVyYV9wc3BlYy9wbG90LnB5) | `93.11% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

steven-murray commented 1 year ago

Ah, I should have linked to the PR in hera_cal: https://github.com/HERA-Team/hera_cal/pull/861#issuecomment-1382451023.

Basically, there's a new module in hera_cal that adds parameters to a CLI script for controlling logging and line-profiling. These are super helpful for performance testing. It's opt-in, so doesn't change anything for anyone by default. If turned on, it'll log the memory usage at each logging statement, looks like this:

image

adeliegorce commented 1 year ago

Perfect! thanks for the explanation @steven-murray and for updating the calls to merge_spectra functions. I'll merge and closer the pull request now.