Skip to content
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

Implement API Parameter Facade #23

Closed
gkirgizov opened this issue Sep 13, 2022 · 1 comment · Fixed by #251
Closed

Implement API Parameter Facade #23

gkirgizov opened this issue Sep 13, 2022 · 1 comment · Fixed by #251
Labels
architecture (re)design of existing or new framework subsystem discuss Requires or would benefit from a discussion

Comments

@gkirgizov
Copy link
Collaborator

gkirgizov commented Sep 13, 2022

While doing aimclub/FEDOT#852 I came up with a design of a better Parameter system. The idea is to make Facade for all different parameter dataclasses. This will allow isolate external API from changes to actual parameter dataclasses.

Requirements:

  • Facade should work on sub-categories (now we have 3: infrastructural ComposerRequirements, PipelineComposerRequirements, GraphOptimizerParameters)
  • Unique names check (parameters from different categories shouldn't have same names)
  • Support for new categories without additional work (imagine some CustomOptimizerParams)
  • Facade must support init from flat dictionary of parameters (e.g. user povides different parameters from diffeernt categories in a single dictionary) --- btw this will allow refactoring ApiParams with its logic of divide_parameters
  • Updates to underlying fields in dataclasses should be hidden behind common facade of get/set (by reimplemented getattr/setattr/hasattr)
  • Strictness feature: only params explicitly marked as "mutable" can be modified; others are frozen by default
    e.g. possibly implement this by a decorator on dataclass fields @mutable_param
  • Unique names check (parameters from different categories shouldn't have same names)

Usages could look like:

  • Init with categories specified as kwargs (should work for arbitrary kwargs, custom_optimizer_params is an example).:
ParameterRepository(requirements=ComposerRequirements(),
                                   optimizer_parameters=GraphOptimizerParameters(),    
                                   custom_optimizer_params=SomeDataclassWithUserParams())
  • para_repo.init_from_parameters(api_params: dict) should automatically distribute all parameters to appropriate subcategories
  • 2 ways for accessing parameters should work: for example, for pop_size both param_repo.pop_size & param_repo.optimizer_parameters.pop_size
@gkirgizov gkirgizov added the architecture (re)design of existing or new framework subsystem label Sep 13, 2022
@gkirgizov gkirgizov transferred this issue from aimclub/FEDOT Jan 25, 2023
@gkirgizov gkirgizov added the discuss Requires or would benefit from a discussion label Jan 25, 2023
@maypink
Copy link
Collaborator

maypink commented Dec 11, 2023

seems like this issue was written for FEDOT, not GOLEM

@maypink maypink linked a pull request Dec 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture (re)design of existing or new framework subsystem discuss Requires or would benefit from a discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants