Skip to content

Add Effects documentation section#899

Open
astronomyk wants to merge 3 commits intomainfrom
docs/effects-documentation
Open

Add Effects documentation section#899
astronomyk wants to merge 3 commits intomainfrom
docs/effects-documentation

Conversation

@astronomyk
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new docs/source/effects/ documentation section with two pages:
    • Effects Overview — describes the simulation pipeline (with Mermaid diagram), z-order system, YAML configuration, runtime interaction, and a full reference catalog of all 58+ built-in effect classes organized by category
    • Creating Custom Effects — tutorial on writing Effect subclasses, with a worked non-symmetric vignetting flat field example using the bundled example optical train, plus guidance on sharing/contributing effects
  • Adds the new section to the main index.rst toctree

Test plan

  • Verify RTD branch preview renders correctly (Mermaid diagram, code cell output, tables)
  • Check that all executable code cells run without errors during doc build
  • Confirm cross-references to existing pages (5_liners/, examples/) resolve

🤖 Generated with Claude Code

astronomyk and others added 2 commits April 3, 2026 22:43
…torial

New docs/source/effects/ section covering:
- Overview of all built-in effect types, the simulation pipeline, z-order
  system, YAML configuration, and runtime interaction
- Tutorial on creating custom effects with a non-symmetric vignetting
  flat field example, plus guidance on sharing/contributing effects

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use flowchart LR with <br/> for line breaks so the three pipeline
  phases render side by side
- Move Effect Categories to the end of the page
- Add a note box in YAML Configuration pointing to the IRDB for
  real-world examples

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.76%. Comparing base (9a4120b) to head (4ecc53b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #899   +/-   ##
=======================================
  Coverage   74.76%   74.76%           
=======================================
  Files          69       69           
  Lines        8936     8936           
=======================================
  Hits         6681     6681           
  Misses       2255     2255           

☔ View full report in Codecov by Sentry.
📢 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.

@astronomyk astronomyk requested a review from teutoburg April 3, 2026 21:19
@astronomyk
Copy link
Copy Markdown
Collaborator Author

A test to see whether it's worth get claude to work a bit on the documentation, given that we have two science meetings coming up in 6-7 weeks

Copy link
Copy Markdown
Contributor

@teutoburg teutoburg left a comment

Choose a reason for hiding this comment

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

I have my issues with this. Knowing that this was the toaster's work and not your own, I won't hold back on the criticism.

Most importantly in the broader scope, I don't think it's a good point in time to document the inner details of the effects, when those are about to change. What do I mean by change? Well, we outlined it more than two years ago at this point in #387. While I don't have time to do it now, I do think it will be done before the year is over. But I know your answer, we can always come back and change the text here, or have it changed by the toaster.

More specifically, we should be VERY careful what we write about the z-order! As we know, only the "hundreds digit" is considered by ScopeSim, the final two digits are completely ignored. When first discovered, we treated this as a bug and tried to fix it, but it turns out letting the final order in which effects are applied be defined in the YAML order allows for much better control in specific cases. In any case, z_order will be phased out before v1.0. If we really need this docs section now, we should strongly clarify how this parameter is actually handled by ScopeSim and mention that an alternative it being worked on.

Similarly for the "custom effects" page, I had for a long time now that plan to enable simply callables to be passed as simple custom effects, but alas I haven't gotten around to that so far either. I don't think we currently have the person-power to handle any PRs with new effect subclasses from outside, so I'm not sure inviting people to do that is necessarily a good idea at this point. Maybe later. Also, don't tell users to modify anything in their local ScopeSim installation. That just bad practice and asking for weird bugs that they then bother us with, because they broke their own environment. It happened last autumn. Please remove that subsection.

Also, please before clicking the "request review" button, please check yourself that YOU would be ready to merge this. A review request is not a collaboration invitation on a non-finished PR, but it's saying "here's my work, I consider it finished, please let me know if I missed anything". What I'm referring to?

  1. The CI tripped on two of the hyperlinks on those two pages, which are incorrect. This should have caught your attention.
  2. The mermaid flowchart doesn't render as intended and is not useable in it's current form, see individual comment.

I added much more in the individual review comments, let's continue there...

I originally put a paragraph here about em dashes, but have since decided to just replace those. I think I missed at least two of them, but whatever. Ignore.

Comment on lines +51 to +53
flowchart LR
subgraph Setup ["Setup Phase"]
direction TB
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.

Now, I'm assuming it was smart enough to understand that all of this flowchart doesn't fit the page width, and thus tried to get the individual parts to be displayed top-to-bottom (direction TB), but the overall flowchart left-to-right (flowchart LR). Unfortunately, that's not the way it renders on RTD. I'm getting the impression you didn't even check that before requesting my review, but whatever. I'm not sure what's causing it to not render in the intended way, but I think it's fine to just display the whole thing top-to-bottom. But certainly needs some more work, because the way it renders now on RTD (on my normal laptop screen) it's illegible.

Comment on lines +79 to +81
| Z-Order Range | Pipeline Stage | Applied To | OpticsManager Property |
|:---:|---|---|---|
| 200–299 | FOV setup | `FovVolumeList` | `fov_setup_effects` |
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.

Now, I know this renders fine as a table. Call me a boomer, but I prefer it to also look nice in raw markdown. In other words, please format the markdown table so it looks like an actual table. Takes two minutes if done manually.

Comment on lines +93 to +94
Effects are typically defined in YAML instrument packages. Each effect entry
specifies the class name and configuration parameters:
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.

If we're explaning the YAML syntax for effects, I think two important aspects are missing: Firstly, the fact that the name parameters is the name that's used to identify that effect later in the optical train. Secondly, less critical but still worth mentioning, that the description parameter only exists as a kind of explanatory comment inside the yaml file. It is utterly ignored by the YAML parser and does not show up anywhere in ScopeSim. You could even call it redundant, if it wasn't for the purpose of making the YAML definition easier to understand.

```yaml
effects:
- name: detector_qe_curve
description: Quantum efficiency of the battery of detectors
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.

I don't understand what a "battery of detectors" is supposed to be in this context.

- [Turning Effects on or off](../5_liners/effects_include.md)
- [Using bang strings and hash strings](../5_liners/bang_strings.md)

## Effect Categories
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.

I agree that this overview is useful, but we already have it, e.g. here for TER curves (and other subpages for each module)! I'm always against duplicating information, but in this case specifically, because we will certainly forget to modify this list if we change / add / remove an effect. In my (not so humble) opinion, this whole section should be removed and instead readers should be kindly pointed here: _autosummary/scopesim.effects.html

Comment on lines +319 to +320
describing your effect and sharing the code. The ScopeSim team can help
integrate it into the package.
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.

We don't have time for this, but whatever. Let's just hope nobody takes this as an invitation...

@github-project-automation github-project-automation bot moved this to 🏗 In progress in ScopeSim-development Apr 3, 2026
@teutoburg teutoburg moved this from 🏗 In progress to 👀 Awaiting Review in ScopeSim-development Apr 3, 2026
@teutoburg teutoburg added the documentation Improvements or additions to documentation label Apr 3, 2026
@teutoburg
Copy link
Copy Markdown
Contributor

Further note on Claude, which I've seen a few times now in our team in the last couple weeks: I hate how it's generating commit messages where the initial line is too long to fit on one line. I don't know if this can be configured in Claude's settings in any way, but if yes the pleeaaase do that! Looking at all of your who use it. For reference: Anything that's more than 70 (or 71, but NOT 80) characters is broken into two lines in GitHub's UI. This makes it obnoxious to look at, in the PR and afterwards, especially in the context of e.g. git blame. Please, whether done manually or by the AI, always keep your first commit message line within 70 characters, than if there needs to be more explanation, add a blank line and then do whatever you want (anything after that blank line can be longer, no problem).

Co-authored-by: Fabian H. <73600109+teutoburg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: 👀 Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants