Creates a unified interface for task specification for python_api#484
Creates a unified interface for task specification for python_api#484josegcpa wants to merge 12 commits intowasserth:masterfrom
Conversation
…facilitate addition of new tasks
|
Thanks for this PR. I will have a look at it. |
|
I had a more detailed look at the PR. Thank you! Overally, it adds quite a few lines of code and makes the code a little bit less straight forward by introducing the Task class. I do not see the advantage of this yet. So far it has also been easy to add a new class in the python_api in my opinion. Maybe you can elaborate a bit more what you are missing at the moment. Do you want to be able to run multiple tasks without having to call the python_api multiple times? |
Hey! It actually reduces the code and repetition, it introduces more code lines because it introduces PEP 8 compliant formatting, I should've been clearer about this. As for the why: Eventually, the point was to i) further specify the The main point of specifying multiple tasks/roi_subsets is to reuse crops as some tasks have fairly overlapping crops and there is no need to perform the same computation 2x. This reduces compute time, it is helpful when being billed for compute. But I fully understand if this is out of the scope of the project! It is not so much an addition to the functionalities so feel free to disregard. |
|
Thank you very much for these additional explanations! I will have to think about it. |
Hey! Big fan of the project here :-)
This PR significantly factorises how tasks are specified and creates a simple interface to add new tasks without adding too much clutter to
totalsegmentator.python_api. This is part of a larger effort to support multi-task specification using the CLI as it is quite useful across multiple applications. Let me know if this is OK and if this is desired or not.I tried running all of the tests but some files appear to be missing (at least for
tests/test_end_to_end.py) - let me know if I missed something.EDIT: I also bumped the version management to use
uvas, in my experience, it features smoother version/package versioning