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

[MNT] isolate pytorch-optimizer as soft dependency #1641

Merged
merged 16 commits into from
Sep 4, 2024
Merged

Conversation

fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Aug 31, 2024

Isolates pytorch-optimizer as soft dependency in a new soft dep set all_extras. #1616

The imports happen only in BaseModel, when resolving aliases for optimizer.

Isolation consists of two steps:

  • replacing resolution of the alias with a request to install the package, and removing from resolution scope if not installed
  • replacing the default optimizer "ranger" with "adam" if pytorch-optimizer is not installed (left at "ranger" if installed)

Deprecation messages and actions are added, to changne the default to "adam" from 1.2.0, in order to minimize the number of dependencies in default parameter settings

@fkiraly fkiraly added dependencies Pull requests that update a dependency file maintenance Continuous integration, unit testing & package distribution labels Aug 31, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 45.00000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 90.14%. Comparing base (95fa06c) to head (38daba9).

Files with missing lines Patch % Lines
pytorch_forecasting/models/base_model.py 45.00% 11 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1641      +/-   ##
==========================================
+ Coverage   90.10%   90.14%   +0.04%     
==========================================
  Files          32       32              
  Lines        4768     4780      +12     
==========================================
+ Hits         4296     4309      +13     
+ Misses        472      471       -1     
Flag Coverage Δ
cpu 90.14% <45.00%> (+0.04%) ⬆️
pytest 90.14% <45.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fkiraly fkiraly merged commit bb6c8a2 into master Sep 4, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file maintenance Continuous integration, unit testing & package distribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants