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

refactor: move ramstk_measurement to sub-package #997

Merged
merged 5 commits into from
Feb 22, 2022

Conversation

weibullguy
Copy link
Collaborator

@weibullguy weibullguy commented Feb 22, 2022

Does this PR introduce a breaking change?

  • Yes
  • No

Describe the purpose of this pull request.

To move tables in common database to sub-packages under commondb.

Describe how this was implemented.

Created measurement sub-package. Moved ramstk_measurement.py to sub-package as record.py. Created table.py. Updated ramstk_measurement test suite.

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

None

Provide any other pertinent information.

Partially implements #846

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

    • Problem areas outside the scope of this PR have an # ISSUE: comment
      decorating the code block. These # ISSUE: comments are automatically
      converted to issues on successful merge. Alternatively, you can manually
      raise an issue for each problem area you identify.

@github-actions github-actions bot added the type: refactor Issue or PR dealing with refactoring of RAMSTK code. label Feb 22, 2022
@weibullguy weibullguy self-assigned this Feb 22, 2022
@github-actions github-actions bot added the status: inprogress Issue or PR is open, milestoned, and assigned. label Feb 22, 2022
@weibullguy weibullguy added the priority: normal Issue or PR is normal priority. label Feb 22, 2022
@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #997 (f20a43b) into master (d2139e9) will decrease coverage by 0.04%.
The diff coverage is 78.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #997      +/-   ##
==========================================
- Coverage   94.91%   94.86%   -0.05%     
==========================================
  Files         170      172       +2     
  Lines        5249     5260      +11     
  Branches      502      502              
==========================================
+ Hits         4982     4990       +8     
- Misses        232      235       +3     
  Partials       35       35              
Flag Coverage Δ
3.6 ?
3.7 94.86% <78.37%> (-0.05%) ⬇️
3.8 94.86% <78.37%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
src/ramstk/__main__.py 0.00% <0.00%> (ø)
src/ramstk/analyses/allocation.py 98.61% <ø> (ø)
src/ramstk/analyses/fha.py 100.00% <ø> (ø)
src/ramstk/analyses/statistics/bounds.py 64.70% <0.00%> (ø)
src/ramstk/exim/imports.py 87.23% <ø> (ø)
src/ramstk/models/__init__.py 100.00% <ø> (ø)
src/ramstk/models/commondb/__init__.py 100.00% <ø> (ø)
src/ramstk/models/commondb/database.py 100.00% <ø> (ø)
src/ramstk/db/base.py 84.39% <80.00%> (-2.32%) ⬇️
...rc/ramstk/analyses/milhdbk217f/models/capacitor.py 100.00% <100.00%> (ø)
... and 8 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 d2139e9...f20a43b. Read the comment docs.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 22, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.41%.

Quality metrics Before After Change
Complexity 2.16 ⭐ 2.17 ⭐ 0.01 👎
Method Length 80.76 🙂 82.54 🙂 1.78 👎
Working memory 5.68 ⭐ 5.79 ⭐ 0.11 👎
Quality 76.55% 76.14% -0.41% 👎
Other metrics Before After Change
Lines 9079 8995 -84
Changed files Quality Before Quality After Quality Change
src/ramstk/main.py 75.40% ⭐ 74.48% 🙂 -0.92% 👎
src/ramstk/analyses/allocation.py 77.08% ⭐ 74.26% 🙂 -2.82% 👎
src/ramstk/analyses/fha.py 82.71% ⭐ 82.44% ⭐ -0.27% 👎
src/ramstk/analyses/milhdbk217f/models/capacitor.py 74.06% 🙂 74.06% 🙂 0.00%
src/ramstk/analyses/milhdbk217f/models/inductor.py 74.17% 🙂 74.17% 🙂 0.00%
src/ramstk/analyses/milhdbk217f/models/resistor.py 67.44% 🙂 67.44% 🙂 0.00%
src/ramstk/analyses/milhdbk217f/models/semiconductor.py 71.58% 🙂 71.58% 🙂 0.00%
src/ramstk/analyses/statistics/bounds.py 75.52% ⭐ 75.52% ⭐ 0.00%
src/ramstk/db/base.py 70.71% 🙂 71.30% 🙂 0.59% 👍
src/ramstk/exim/imports.py 75.52% ⭐ 75.49% ⭐ -0.03% 👎
src/ramstk/models/init.py % % %
src/ramstk/models/commondb/init.py % % %
src/ramstk/models/commondb/database.py 80.33% ⭐ 80.32% ⭐ -0.01% 👎
src/ramstk/models/programdb/validation/record.py 82.61% ⭐ 82.61% ⭐ 0.00%
src/ramstk/views/gtk3/assistants/export.py 72.30% 🙂 72.26% 🙂 -0.04% 👎
src/ramstk/views/gtk3/reliability/panel.py 65.95% 🙂 65.96% 🙂 0.01% 👍
tests/analyses/test_allocation.py 86.89% ⭐ 86.89% ⭐ 0.00%
tests/models/programdb/test_program_manager.py 85.89% ⭐ 85.89% ⭐ 0.00%

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/reliability/panel.py ReliabilityResultsPanel.__init__ 0 ⭐ 462 ⛔ 21 ⛔ 37.59% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/analyses/milhdbk217f/models/semiconductor.py calculate_part_stress_lambda_b 12 🙂 202 😞 14 😞 40.14% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/reliability/panel.py ReliabilityInputPanel.__init__ 0 ⭐ 401 ⛔ 17 ⛔ 41.06% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/analyses/milhdbk217f/models/semiconductor.py calculate_part_stress 7 ⭐ 260 ⛔ 13 😞 42.69% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/db/base.py BaseDatabase.do_connect 5 ⭐ 208 ⛔ 15 😞 44.98% 😞 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!

@sonarcloud
Copy link

sonarcloud bot commented Feb 22, 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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@weibullguy weibullguy merged commit f23787d into master Feb 22, 2022
@trafico-bot trafico-bot bot added the endgame: merged Pull Request has been merged successfully label Feb 22, 2022
@weibullguy weibullguy deleted the refactor/move_ramstkmeasurement_subpackage branch February 22, 2022 20:48
@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 Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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: refactor Issue or PR dealing with refactoring of RAMSTK code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant