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

Added warning for not running setup before other functions #2354

Merged
merged 2 commits into from
Apr 2, 2022

Conversation

ryanxjhan
Copy link
Contributor

@ryanxjhan ryanxjhan commented Mar 31, 2022

Related Issuse or bug

Info about Issue or bug

Fixes #2338

Describe the changes you've made

Added warning for not running setup before other functions.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Pytest

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

NA

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Screenshots

Original Updated
original screenshot updated screenshot

@ngupta23
Copy link
Collaborator

ngupta23 commented Apr 1, 2022

@Yard1 @ryanxjhan
I also feel that since the message is the same in all methods, it should be stored as a class attribute. That way, we only type it out once and reuse it in all methods. It will make maintenance easier later if we want to reword this.

@ryanxjhan
Copy link
Contributor Author

@ngupta23 Agreed. What about implementing it as a private method?

@ngupta23
Copy link
Collaborator

ngupta23 commented Apr 1, 2022

@ngupta23 Agreed. What about implementing it as a private method?

I don't have an issue with that. @Yard1 Do you see any issues?

@ngupta23 ngupta23 linked an issue Apr 1, 2022 that may be closed by this pull request
@Yard1
Copy link
Member

Yard1 commented Apr 1, 2022

The best practice here would be to use a decorator instead of editing all the methods

@ryanxjhan
Copy link
Contributor Author

Hi @ngupta23, I have implemented the changes. Adding warnings in predict_model, load_model, and save_model does not pass some edge cases in pytest. So I removed the warnings from these methods.

@ngupta23
Copy link
Collaborator

ngupta23 commented Apr 2, 2022

Hi @ngupta23, I have implemented the changes. Adding warnings in predict_model, load_model, and save_model does not pass some edge cases in pytest. So I removed the warnings from these methods.

Yes that is correct - these methods do not need the setup to be run.

Copy link
Collaborator

@ngupta23 ngupta23 left a comment

Choose a reason for hiding this comment

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

Changes look good. Falling test is unrelated to time series.
Also movement of this check to base class has been added as a separate issue for now.

@ngupta23 ngupta23 merged commit 332eb81 into pycaret:time_series Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Plotting after loading model but without running setup
3 participants