-
Notifications
You must be signed in to change notification settings - Fork 84
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
Operation repo refactor #1253
Operation repo refactor #1253
Conversation
# Conflicts: # fedot/core/repository/data/data_operation_repository.json # fedot/core/repository/operation_types_repository.py
Hello @kasyanovse! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
Code in this pull request still contains PEP8 errors, please write the Comment last updated at |
This reverts commit e19e5a9.
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.
занести все тэги в Enum - очень хорошая идея.
выглядит чуть более формально, чем словари в переменных класса)
в скором времени все TODO и заделы на будущее можно растащить по отдельным issues
@@ -97,7 +97,7 @@ FEDOT предоставляет высокоуровневый API, котор | |||
|
|||
.. code-block:: python | |||
|
|||
model = Fedot(problem='classification', timeout=5, preset='best_quality', n_jobs=-1) | |||
model = Fedot(problem='classification', timeout=5, preset=PresetsEnum.BEST_QUALITY, n_jobs=-1) |
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.
А один красивый импорт из fedot
?
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.
Чем проще - тем лучше. PresetsEnum.BEST_QUALITY со стороны внешнего пользователя выглядит как что-то сложное, в python-библиотеках такие решения во внешних 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.
Есть вариант вынести константу вида BEST_QUALITY
для импорта из федота. Будет что-то типа уровней логирования в logging
, заданных константами на верхнем уровне библиотеки.
if value is PresetsEnum.AUTO: | ||
value = PresetsEnum.FAST_TRAIN |
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.
я не уловил идею, почему при присваивании preset_name
значение AUTO
происходит подмена сразу на FAST_TRAIN
? видимо, здесь пока WIP, потому что в таком случае хочется использовать модели, не требующие много времени на обучение
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.
Потому что пресет авто должен в какой-то момент подменяться другим пресетом или должен везде интерпретироваться как другой пресет.
Когда появится логика, опирающаяся на этот пресет, можно будет оставить его как самостоятельную единицу, но сейчас это просто синоним фаст трейна.
Co-authored-by: George Lopatenko <81328772+Lopa10ko@users.noreply.github.com>
43ad775
to
8dc0dc3
Compare
Closed as obsolete |
This is a 🔨 code refactoring.
Summary
Рефактор тегов и пресетов:
Enum
везде, где только можно.Главная задача - утвердить или отклонить предлагаемые изменения. В связи с их большим количеством, предлагаю сначала сделать ревью этого PR, потом доработать в других PR, но в мастер влить одновременно все доработки.
В отдельных PR будет доработано:
После завершения этого цикла PR добавлять новые типы моделей и теги станет гораздо проще. До этого добавление неминуемо вело к усложнению и еще большему запутыванию системы пресетов/тегов.