Closed LukasBeiske closed 3 months ago
Attention: Patch coverage is 98.80952%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 92.62%. Comparing base (
3952e5a
) to head (c3046f5
). Report is 23 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
src/ctapipe/core/traits.py | 96.87% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Also missing are tests for setting quantities from the command line and in config files. For the CLI, you have to implement from_string
I think, but probably just passing to u.Quantity
is enough, maybe that's already the default.
Also missing are tests for setting quantities from the command line and in config files. For the CLI, you have to implement
from_string
I think, but probably just passing tou.Quantity
is enough, maybe that's already the default.
I implemented from_string
at first, but after testing it, it seems that everything works even without it. The test checks, if setting via a string works
Do you think additional test for config files and cmd are still needed? I think this is what happens in both cases, no?
Would be nice to make sure, can be as simple as:
class MyTool(Tool):
energy = AstroQuantity(physical_type=u.physical.energy).tag(config=True)
tool = MyTool()
run_tool(tool, ["--MyTool.energy='5 TeV'"])
assert tool.energy == 5 * u.TeV
and maybe add a test that the error message is nice on invalid input
Project ID: cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs
@kosack I think this is ready, you requested changes so merger is currently blocked. Could you please check that your requested changes were implemented?
Having a configurable trait containing an
astropy.units.Quantity
is useful for the irf tool and will probably be useful for other high-level tools, too.