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: widget sensitivity not changing on subcategory change #1020

Merged
merged 4 commits into from
Mar 4, 2022

Conversation

weibullguy
Copy link
Collaborator

@weibullguy weibullguy commented Mar 4, 2022

Does this PR introduce a breaking change?

  • Yes
  • No

Describe the purpose of this pull request.

To fix the problem with the widget sensitivity not changing when the subcategory was changed without running a calculation or deselecting and reselecting the changed component.

Describe how this was implemented.

Removed the _do_set_sensitive() listener method in the Panel metaclass. Removed the lines that loaded the widgets in the _do_set_sensitive() methods; the widgets should be blank anyway after selecting a new subcategory. Set each component type's _do_set_sensitive() method to be called whenever the subcategory is changed.

Describe any particular area(s) reviewers should focus on.

None

Provide any other pertinent information.

Closes #978

Pull Request Checklist

  • Code Style

    • Code is following code style guidelines.
  • Static Checks

    • Failing static checks are only applicable to code outside the scope of
      this PR.
  • Tests

    • At least one test for all newly created functions/methods?
  • Chores

    • Issue(s) have been raised for problem areas outside the scope of
      this PR. These problem areas have been decorated with an ISSUE: # comment.

@github-actions github-actions bot added bump: patch Issue or PR documents a bug fix or enhancement requiring a patch version bump. type: fix Issue or PR affects existing functionality. labels Mar 4, 2022
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 4, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 1.26%.

Quality metrics Before After Change
Complexity 1.80 ⭐ 1.72 ⭐ -0.08 👍
Method Length 75.10 🙂 72.88 🙂 -2.22 👍
Working memory 7.17 🙂 6.86 🙂 -0.31 👍
Quality 74.82% 🙂 76.08% 1.26% 👍
Other metrics Before After Change
Lines 6142 5696 -446
Changed files Quality Before Quality After Quality Change
src/ramstk/views/gtk3/design_electric/components/capacitor.py 71.08% 🙂 74.42% 🙂 3.34% 👍
src/ramstk/views/gtk3/design_electric/components/connection.py 72.36% 🙂 75.98% ⭐ 3.62% 👍
src/ramstk/views/gtk3/design_electric/components/inductor.py 72.41% 🙂 76.60% ⭐ 4.19% 👍
src/ramstk/views/gtk3/design_electric/components/integrated_circuit.py 74.03% 🙂 71.35% 🙂 -2.68% 👎
src/ramstk/views/gtk3/design_electric/components/meter.py 76.53% ⭐ 77.54% ⭐ 1.01% 👍
src/ramstk/views/gtk3/design_electric/components/miscellaneous.py 77.65% ⭐ 78.34% ⭐ 0.69% 👍
src/ramstk/views/gtk3/design_electric/components/relay.py 73.03% 🙂 77.02% ⭐ 3.99% 👍
src/ramstk/views/gtk3/design_electric/components/resistor.py 79.06% ⭐ 81.65% ⭐ 2.59% 👍
src/ramstk/views/gtk3/design_electric/components/semiconductor.py 75.69% ⭐ 78.62% ⭐ 2.93% 👍
src/ramstk/views/gtk3/design_electric/components/switch.py 72.48% 🙂 74.73% 🙂 2.25% 👍
src/ramstk/views/gtk3/hardware/panel.py 69.12% 🙂 68.46% 🙂 -0.66% 👎
src/ramstk/views/gtk3/widgets/panel.py 79.80% ⭐ 79.77% ⭐ -0.03% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
src/ramstk/views/gtk3/design_electric/components/integrated_circuit.py ICDesignElectricInputPanel.__init__ 0 ⭐ 566 ⛔ 22 ⛔ 36.63% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/hardware/panel.py HardwareGeneralDataPanel.__init__ 0 ⭐ 441 ⛔ 18 ⛔ 39.76% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/design_electric/components/connection.py ConnectionDesignElectricInputPanel.__init__ 0 ⭐ 390 ⛔ 16 ⛔ 42.20% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/design_electric/components/semiconductor.py SemiconductorDesignElectricInputPanel.__init__ 0 ⭐ 314 ⛔ 14 😞 46.16% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/design_electric/components/relay.py RelayDesignElectricInputPanel.__init__ 0 ⭐ 305 ⛔ 13 😞 47.85% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@weibullguy weibullguy self-assigned this Mar 4, 2022
@github-actions github-actions bot added the status: inprogress Issue or PR is open, milestoned, and assigned. label Mar 4, 2022
@weibullguy weibullguy added the priority: normal Issue or PR is normal priority. label Mar 4, 2022
@sonarcloud
Copy link

sonarcloud bot commented Mar 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Mar 4, 2022

Codecov Report

Merging #1020 (03fcaa8) into master (ac19638) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1020   +/-   ##
=======================================
  Coverage   94.80%   94.80%           
=======================================
  Files         144      144           
  Lines        5194     5194           
  Branches      508      508           
=======================================
  Hits         4924     4924           
  Misses        233      233           
  Partials       37       37           
Flag Coverage Δ
3.6 94.80% <ø> (ø)
3.7 94.80% <ø> (ø)
3.8 94.80% <ø> (ø)

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


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac19638...03fcaa8. Read the comment docs.

@weibullguy weibullguy merged commit dc5bf6a into master Mar 4, 2022
@weibullguy weibullguy deleted the fix/issue-978 branch March 4, 2022 18:34
@trafico-bot trafico-bot bot added the endgame: merged Pull Request has been merged successfully label Mar 4, 2022
@weibullguy weibullguy added status: closed Pull Request is complete and integrated or closed for anther reason. and removed status: inprogress Issue or PR is open, milestoned, and assigned. labels Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump: patch Issue or PR documents a bug fix or enhancement requiring a patch version bump. endgame: merged Pull Request has been merged successfully priority: normal Issue or PR is normal priority. status: closed Pull Request is complete and integrated or closed for anther reason. type: fix Issue or PR affects existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Widget Sensitivity Code to New Method in Component Input Panes
1 participant