Open taylorbell57 opened 4 months ago
Attention: Patch coverage is 71.16883%
with 222 lines
in your changes missing coverage. Please review.
Project coverage is 54.95%. Comparing base (
a939236
) to head (a6b88ac
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm going to approve and merge Aarynn's PR now, so I'm reminding myself here that I will need to move the non-Eureka defaults from the following lines https://github.com/kevin218/Eureka/blob/ab7a32aaa2b0f18221fa42e478e1f1c19997b8b1/src/eureka/S4_generate_lightcurves/s4_genLC.py#L107-L139 to the S4MetaClass
Alright, that tweak after Aarynn's PR is now taken care of and this PR is ready for review again
As a general comment, I think we can pare down the S1 and S2 templates by removing many of the skip_pipeline_step keywords that never change.
This draft PR introduces the
S1MetaClass
which is a child of the originalreadECF.MetaClass
object.This new class holds Stage 1 specific defaults for different instruments. This will allow for cleaner ECFs where values can be left at their defaults without specifying them in the ECF. For cases where a value is must be specified because there is no safe default value, an
AttributeError
will be raised (if desired, I can catch those exceptions and re-raise them with an explicit reminder to set those variables in their ECF). I also only raise these exceptions when I must (e.g., only require the specification ofsuperbias_file
ifcustom_bias
is True).This new addition will also allow for cleaner code with fewer instances of
if hasattr(meta, ...)
scattered throughout the code. I make frequent use ofgetattr
within this new class which allows attributes to be set to a default value if the value hasn't been previously set while minimizing the lines of code. As I continue on to additional stages, I will move any default values scattered throughout the code to their stage-specificMetaClass
which will further tidy the code. This will also make maintenance and backwards compatibility easier as new ECF settings can just have their defaults specified in a single, stage-specific location.I'd like @kevin218's feedback (just a quick "Format looks fine, please continue", or "I don't like this format, let's discuss") at this stage before I work through all six stages to check that you're happy with the overall format in which I'm writing these classes. I know I'm not flake8 compliant right now, I'll fix that before I mark the PR as ready for review.