Skip to content

Plot vs z#39

Open
steven-murray wants to merge 15 commits into
mainfrom
plot-vs-z
Open

Plot vs z#39
steven-murray wants to merge 15 commits into
mainfrom
plot-vs-z

Conversation

@steven-murray

Copy link
Copy Markdown
Contributor

This adds a new plotting function, plot_vs_z.

I also added two examples of using this function in the tutorial notebook.

@steven-murray steven-murray self-assigned this Jun 26, 2026
@steven-murray steven-murray added the type: feature New feature that adds functionality for the user label Jun 26, 2026
@codecov-commenter

codecov-commenter commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.72549% with 23 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@3ac614e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/eor_limits/_plot.py 88.66% 23 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #39   +/-   ##
=======================================
  Coverage        ?   87.30%           
=======================================
  Files           ?       12           
  Lines           ?      898           
  Branches        ?        0           
=======================================
  Hits            ?      784           
  Misses          ?      114           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bhazelton bhazelton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't actually run the plotting code yet, but here are a few things I noticed on my first read through.

Comment thread docs/source/tutorial.ipynb Outdated
@@ -12,17 +12,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we want to clear outputs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmmm maybe @JitenDhandha can say more about this. Usually I keep the outputs for notebooks because building the docs doesn't run the code, but maybe we're doing it differently here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nbsphinx has a nbsphinx_execute setting that defaults to auto, which means that the notebook is executed when no outputs are present, and skips execution when outputs are present. So I always leave them unexecuted. Easy enough to override or make explicit in conf.py with nbsphinx_execute = "always" or whatever.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah! cool, I don't think that was an option when I originally started using nbsphinx :-)

Comment thread pyproject.toml
Comment on lines +48 to +49
"ipykernel>=7.3.0",
"pip>=26.1.2",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why are these being added to the dev group? Surely pip is installed already since uv uses it. And why ipykernel vs jupyter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

uv actually does not use pip so it needs to be installed explicitly if you want it. I added these so that I could use the uv environment as a jupyter kernel in VSCode. I wasn't entirely sure if this is a good idea to add here. They are dev requirements, but only because I was developing in a particular modality. I can remove them if we think that's better.

@JitenDhandha

Copy link
Copy Markdown
Contributor

Hi @steven-murray! Thanks for adding this functionality. I'm leaving a few comments off the top of my head for now:

  • I noticed that none of the plots vs $z$ in the tests had any colorbars. This isn't the default intended output I presume?
  • We need to add CLI tests too alongside the library plotting tests. They're missing right now.
  • There is a legend handler I see for the plot-vs-z but not for plot-vs-k. Is there reason for this? Would be good to ensure that the function signatures match as closely between the two (alongside default values; e.g. one of them has shade limits on and the other off I think).

I'll take a closer look later today or tomorrow as time permits!

- Add legend_labeler support for plot-vs-k
- Use key-to-label dicts for CLI-friendly legend labels
- Add library and CLI tests for legend labeling
- Align shared plot-vs-k and plot-vs-z options
- Add fig_width, leg_cols, and colorbar support to plot-vs-k
- Remove unused theory_redshifts from plot-vs-z
- Add legend label mapping and matching CLI coverage
- Match plotting docstring parameter order to function signatures
- Align shared plot-vs-k and plot-vs-z parameter wording
- Rename leg_cols to legend_ncols
- rename plot_limits and plot_theories to be k-specific
- fix the logic around nz_for_lines
- pop kwargs that throw error on plotting for basic styling
- improve phrasing in README
- change png name to make clear which one it is
- remove custom plotting in tutorial, and polish wording
- renamed colorbar -> show_colorbar
- added color_by option
- added functionality for k_label in legend or title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature that adds functionality for the user

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants