Miksus / rocketry

Modern scheduling library for Python
https://rocketry.readthedocs.io
MIT License
3.25k stars 105 forks source link

add __str__ to TaskRunnable in conds #149

Closed egisxxegis closed 1 year ago

egisxxegis commented 1 year ago

This pull request adds str method to TaskRunnable, found in rocketry.conditions.task.task.TaskRunnable. By adding str method to TaskRunnable, we solve issue of AttributeError in issue (to be updated: I will create an issue) and let cast TaskRunnable to string.

egisxxegis commented 1 year ago

Link to issue: issue

Miksus commented 1 year ago

Thanks for the contribution, I think that looks good. Mind you creating a test case for this? I can also do it in case the test suites seem confusing, probably have time on Saturday for it.

Sorry for the delay in response.

egisxxegis commented 1 year ago

I have just added the test, and additionally added __str__ for TimeCondWrapper (because the test was failing). I am adding two screenshots of current pytest results (I suspect it has nothing to do with added __str__ methods).

pull1 ... pull2

codecov-commenter commented 1 year ago

Codecov Report

Base: 94.90% // Head: 95.05% // Increases project coverage by +0.14% :tada:

Coverage data is based on head (da8f881) compared to base (41b48bd). Patch coverage: 84.61% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #149 +/- ## ========================================== + Coverage 94.90% 95.05% +0.14% ========================================== Files 80 80 Lines 4454 4467 +13 ========================================== + Hits 4227 4246 +19 + Misses 227 221 -6 ``` | [Impacted Files](https://codecov.io/gh/Miksus/rocketry/pull/149?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli) | Coverage Δ | | |---|---|---| | [rocketry/conditions/api.py](https://codecov.io/gh/Miksus/rocketry/pull/149/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli#diff-cm9ja2V0cnkvY29uZGl0aW9ucy9hcGkucHk=) | `97.34% <60.00%> (-1.03%)` | :arrow_down: | | [rocketry/conditions/task/task.py](https://codecov.io/gh/Miksus/rocketry/pull/149/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli#diff-cm9ja2V0cnkvY29uZGl0aW9ucy90YXNrL3Rhc2sucHk=) | `98.03% <100.00%> (+4.16%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Miksus commented 1 year ago

Yep, I think so too :)

The tests are a bit dependent on how fast your system is. It's pretty hard to do tests that test race conditions without relying on execution times. And that means the tests can depend on how fast your system is.

The most important thing is that the tests work well on the CI.

But I think it looks good. Thanks for the contribution and the effort you saw to fix this!