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

fix #551: up and gain_scale_factor are set by StressModel #573

Merged
merged 5 commits into from May 4, 2023

Conversation

dbrakenhoff
Copy link
Member

@dbrakenhoff dbrakenhoff commented Mar 21, 2023

Short Description

As discussed:

  • users should not set up or gain_scale_factor in response function init, added trap to raise TypeError if they are passed to init.
  • these attributes are set by StressModels using rfunc.update_rfunc_settings()
  • users can set these attributes in an rfunc instance using rfunc.update_rfunc_settings()

Once again a question in relation to deprecation warnings. I can modify the trap to generate a warning instead of raising an error if up is passed to the response function, do we want that, or since we never intended this behavior is it okay to just make the change? I vote for the latter option.

Commits

  • up and gain_scale_factor arguments removed from RfuncBase init
  • attributes have default values up=None and gain_scale_factor=1.0
  • attributes are updated by StressModels using update_rfunc_settings()
  • expose method update_rfunc_settings for external use (e.g. for setting up and gain_scale_factor for synthetically generated time series).

Checklist before PR can be merged:

- up and gain_scale_factor arguments removed from RfuncBase init
- attributes have default values up=None and gain_scale_factor=1.0
- attributes are updated by StressModels using update_rfunc_settings()
- expose method update_rfunc_settings for external use (e.g. for setting up and gain_scale_factor for synthetically generated time series).
@dbrakenhoff dbrakenhoff self-assigned this Mar 21, 2023
@dbrakenhoff dbrakenhoff added the bug Indicates an unintended behavior or coding error label Mar 21, 2023
@dbrakenhoff dbrakenhoff added this to the 1.1 milestone Mar 21, 2023
@dbrakenhoff dbrakenhoff linked an issue Mar 21, 2023 that may be closed by this pull request
- remove up and gain_scale_factor from dict and set using update_rfunc_settings
- fix test the same way
@codacy-production
Copy link

Coverage summary from Codacy

Merging #573 (51b148c) into dev (1379345) - See PR on Codacy

Coverage variation Diff coverage
+0.25% (target: +0.00%) 84.62%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1379345) 4910 3565 72.61%
Head commit (51b148c) 4918 (+8) 3583 (+18) 72.86% (+0.25%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#573) 26 22 84.62%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@raoulcollenteur raoulcollenteur merged commit aac3f9d into dev May 4, 2023
8 checks passed
@raoulcollenteur raoulcollenteur deleted the 551-arguments-response-function branch May 4, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unintended behavior or coding error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] up argument ignored in response function
2 participants