Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add helper function, might be nice for parametrized tests #1203

Merged

Conversation

dneise
Copy link
Member

@dneise dneise commented Dec 10, 2019

just a tiny helper function breakout with a test.

I thought it might be nice to have parametrized tests (which I just learned about :-) to include any new subclass automatically.

so go from something like this:

@pytest.mark.parametrize(
"method", ["TailcutsImageCleaner", "MARSImageCleaner", "FACTImageCleaner"]
)

to this:

@pytest.mark.parametrize(
    "method", ImageCleaner.non_abstract_subclasses().keys()
)

In addition, I thought it might be nice to allow people to learn about the available subclasses in a python session. Unless there is already a way, which I forgot about ...

@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #1203 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1203      +/-   ##
==========================================
+ Coverage   86.15%   86.15%   +<.01%     
==========================================
  Files         182      182              
  Lines       11546    11550       +4     
==========================================
+ Hits         9947     9951       +4     
  Misses       1599     1599
Impacted Files Coverage Δ
ctapipe/core/tests/test_component.py 97.52% <100%> (+0.02%) ⬆️
ctapipe/core/component.py 95.65% <100%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d9de9aa...82b2738. Read the comment docs.

@dneise dneise merged commit b8d1dcc into cta-observatory:master Dec 10, 2019
@maxnoe maxnoe deleted the helper_component_non_abstract_subclasses branch December 10, 2019 15:05
@maxnoe maxnoe restored the helper_component_non_abstract_subclasses branch December 10, 2019 15:05
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.

None yet

3 participants