Skip to content

Conversation

GermanHydrogen
Copy link
Contributor

@GermanHydrogen GermanHydrogen commented Dec 27, 2023

This is an alternative suggestion to implementing the exception handling in the image processor base class.
Doing this in the base class would introduce two new attributes suppress_exception: bool which toggles the exception handling and error_header: Optional[str] which defines the error header flat. This introduces the problem that the error_header attribute can be set without the suppress_exception attribute being true, which could lead to errors in config management.
The alternative decorator approach removes the need for the first attribute.
A config with this could look like this

[...]
pipeline:

  - class: pyobs.images.processors.detection.SepSourceDetection
  - class: pyobs.image.processors.ExceptionHandler
      processor:
        class: pyobs.images.processors.astrometry.AstrometryDotNet
          url: ...
          radius: 5
      error_header: "WCSERR"
[...]

I'm open to feedback.

@thusser
Copy link
Member

thusser commented Dec 27, 2023

Hmm, not a bad idea... But that moves error handling in the config file, which I find weird... The config also gets a lot more complex with this. What about adding that functionality to the ImageProcessor base class?

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.

2 participants