Skip to content

Teach set_params to work with nested list and tuple #1201

Merged
merged 4 commits into from
Apr 5, 2023

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented Apr 3, 2023

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Proposed Changes

Teach set_params to work with list and tuples.

Closing issues

@Mr-Geekman Mr-Geekman added this to the AutoML 2.0 milestone Apr 3, 2023
@Mr-Geekman Mr-Geekman self-assigned this Apr 3, 2023
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

@github-actions github-actions bot temporarily deployed to pull request April 3, 2023 11:33 Inactive
@Mr-Geekman Mr-Geekman mentioned this pull request Apr 3, 2023
4 tasks
@codecov-commenter
Copy link

codecov-commenter commented Apr 3, 2023

Codecov Report

❗ No coverage uploaded for pull request base (automl-2.0@447a032). Click here to learn what that means.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@              Coverage Diff              @@
##             automl-2.0    #1201   +/-   ##
=============================================
  Coverage              ?   87.70%           
=============================================
  Files                 ?      177           
  Lines                 ?    10477           
  Branches              ?        0           
=============================================
  Hits                  ?     9189           
  Misses                ?     1288           
  Partials              ?        0           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Mr-Geekman Mr-Geekman changed the title Fix set_params with sequence Teach set_params to work with nested list and tuple Apr 3, 2023
@github-actions github-actions bot temporarily deployed to pull request April 3, 2023 17:00 Inactive
Copy link
Contributor

@martins0n martins0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 just one thing


current_key = keys[0]
new_structure: Any
if isinstance(structure, Dict):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not very important but you use Dict from typing in one place and standart tuple in other - inconsistency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this scheme from def _parse_value we also have different cases for Dict, List, tuple where. I can't use Tuple from typing, it isn't working with isinstance as Dict and List.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for mypy where is some problem with it. In code it works fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it in both functions to use dict, list, tuple in all cases instead of typing classes.

@github-actions github-actions bot temporarily deployed to pull request April 5, 2023 07:27 Inactive
@Mr-Geekman Mr-Geekman merged commit e919876 into automl-2.0 Apr 5, 2023
@Mr-Geekman Mr-Geekman deleted the fix-set-params-with-sequence branch April 5, 2023 08:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants