Closed Miksus closed 2 years ago
Merging #44 (b61468a) into master (766fd57) will decrease coverage by
0.25%
. The diff coverage is98.23%
.
@@ Coverage Diff @@
## master #44 +/- ##
==========================================
- Coverage 90.08% 89.83% -0.26%
==========================================
Files 81 83 +2
Lines 3652 3747 +95
==========================================
+ Hits 3290 3366 +76
- Misses 362 381 +19
Impacted Files | Coverage Δ | |
---|---|---|
rocketry/core/condition/__init__.py | 100.00% <ø> (ø) |
|
rocketry/conditions/task/task.py | 92.12% <94.82%> (-3.45%) |
:arrow_down: |
rocketry/conditions/task/utils.py | 90.47% <96.42%> (+1.28%) |
:arrow_up: |
rocketry/conditions/api.py | 97.22% <97.22%> (ø) |
|
rocketry/core/condition/base.py | 92.26% <98.73%> (+1.94%) |
:arrow_up: |
rocketry/_setup.py | 100.00% <100.00%> (ø) |
|
rocketry/args/builtin.py | 94.91% <100.00%> (+0.27%) |
:arrow_up: |
rocketry/conditions/__init__.py | 100.00% <100.00%> (ø) |
|
rocketry/conditions/func.py | 87.80% <100.00%> (+1.69%) |
:arrow_up: |
rocketry/conditions/meta.py | 95.74% <100.00%> (+0.50%) |
:arrow_up: |
... and 20 more |
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 766fd57...b61468a. Read the comment docs.
If session.task_exists is tested the code coverage goal is probably reached. The cov decreased due to removal of unneeded code (which was tested).
This is quite a massive update. Nothing already documented will change but quite a lot under the hood.
Most notable changes:
Introduction of easy to use conditions
These are convenient alternatives for those who prefer Python objects instead of the string syntax. These are exact equivalents:
and
Pick which style suits you.
Parametrizable conditions
Previously the conditions used sessions and tasks in quite an ugly way. They relied on that they are mutable and
Now instead of using
bool(condition)
, this should be used instead:condition.observe(session=session)
. The context is given when evaluating instead of embedding the context inside.In addition, this allows easier custom conditions and conditions support for passing the context out of the box similarly as parametrization in tasks work. Actually, they now share the mechanism.
Easier reference
Now these are also possible:
app.cond()
now returns the condition itself. There could be problems with pickling but conditions are not passed to processes.Also, reference in
Return
is also simpler:Note how we did not pass the task name as a string but just the function. The task name is stored in the function as
do_first.__rocketry__['name']
.