-
Notifications
You must be signed in to change notification settings - Fork 88
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
Refactor pipeline generation as builder #509 #597
Conversation
Hello @gkirgizov! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2022-03-22 11:03:46 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def pipeline_contains_one(pipeline: Pipeline, op: OpT) -> bool: | ||
def is_the_op(node: Node): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше в нотации писать, что op operation_name: str
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это же относится и к другим сокращениям) Расширь их тоже плиз
def get_suitable_operations_for_task(task_type: TaskTypesEnum, data_type: DataTypesEnum, repo='model'): | ||
return OperationTypesRepository(repo).suitable_operation(task_type=task_type, data_type=data_type)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мб тут можно переиспользовать operations_for_task
из fedot/api/help.py, или get_operations_for_task
из fedot/core/repository/operation_types_repository.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В этих методах не указывается data_type параметр, что, вероятно, повлияет на результат. Да и все-таки это прямое использование публичного api репозитория, не вижу чего-то криминального в этом. Но, конечно, могу чего-то не знать.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А, ок, без проблем. Отмечал, чтобы самому не запутаться, что поправил, а что нет.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А, ок, без проблем. Отмечал, чтобы самому не запутаться, что поправил, а что нет.
Ты простой оставляй коммент по каждому, тогда будет легко понять что done а что нет.
Может PIpelineBuilder его отправить вообще в Pipelines? Он же не только в API может быть применен |
Вот да, мне тоже кажется, что ему где-то еще место. Перенесу в Pipelines. |
Codecov Report
@@ Coverage Diff @@
## master #597 +/- ##
==========================================
+ Coverage 86.23% 86.65% +0.41%
==========================================
Files 145 149 +4
Lines 10959 11080 +121
==========================================
+ Hits 9451 9601 +150
+ Misses 1508 1479 -29
Continue to review full report at Codecov.
|
В данном случае с вашими с Колей комментариями согласен. Просто на будущее - я бы хотел взять курс на растаскивание api_utils на отдельные субмодули в рамках большого и структурированного API в ближайшее время (понятно, что не к этому PR). Потому что API заметно усложнился с того момента, как появился "api_utils". Можно будет его потом как-то более прозрачно структурировать, чем надежный подход "всё в кучу" |
|
||
@staticmethod | ||
def for_task(task: Task): | ||
task2assumptions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай без цифр лучше обойдемся без необходимости)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это ж сокращение в смысле task_to_assumptions
но ок, переименую
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай я ещё поиграю в душного деда - вместо task_to_assumptions
лучше подошло бы assumption_by_task
, потому что ниже ты получаешь подходящего строителя именно по имеющейся задаче
aa9f3a5
to
ebe1c26
Compare
ebe1c26
to
95a8175
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Всё кул, осталось сделать rebase на мастер ветку и можно мержить
95a8175
to
17b529b
Compare
А претензии PEP8 можешь поправить ещё плиз? |
Extract TaskAssumptions as a kind of data-class containing actual readable assumptions. Extract PreprocessingBuilder which is almost independent of the task. Handles gaps and categorical data. PrimaryAssumptionsBuilder handles case of InputData, logger and available operations. MultiModalData assumptions case is reduced to InputData case. Can now be easily customized if needed. Also now handles available operations. Actual Pipeline building is handled by PipelineBuilder underneath.
For case when SupplementaryData has no computed column_types
Also fix review comments in builders, rename interfaces
This reverts commit 1265b35
And drop initial_assumptions.py.
Also fix tests according to review comments. Restructure them a bit.
This also changes semantics of PipelineBuilder from 'one-shot' to reusable, as they now return copies. This change is required for simplifying TaskAssumptions.
- In case when no PipelineBuilder satisfies OperationsFilter -- return only a single fallback alternative instead of many. - Add dependency on OperationTypesRepository to TaskAssumptions to build valid fallback pipeline in TSForecastingAssumptions.
17b529b
to
b97359a
Compare
Refactor Assumptions Pipeline building process
Primary changes: