Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Anselmoo
Copy link
Owner

@Anselmoo Anselmoo commented Jan 12, 2023

Add a pkl file converter and visualizer for RIXS data

All PR-Submissions:


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open
    Pull Requests for the same
    update/change?

New ✨✨ Feature-Submissions:


Changes to ⚙️ Core-Features:


  • Have you added an explanation of what your changes do and why you'd like
    us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 12, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.09 ⭐ 3.21 ⭐ -0.88 👍
Method Length 54.61 ⭐ 58.30 ⭐ 3.69 👎
Working memory 6.18 ⭐ 5.98 ⭐ -0.20 👍
Quality 77.92% 78.99% 1.07% 👍
Other metrics Before After Change
Lines 1874 2452 578
Changed files Quality Before Quality After Quality Change
spectrafit/__init__.py 100.00% ⭐ 100.00% ⭐ 0.00%
spectrafit/report.py 65.94% 🙂 65.93% 🙂 -0.01% 👎
spectrafit/tools.py 77.76% ⭐ 78.15% ⭐ 0.39% 👍
spectrafit/plugins/converter.py 98.02% ⭐ 96.30% ⭐ -1.72% 👎
spectrafit/plugins/data_converter.py 84.66% ⭐ 83.23% ⭐ -1.43% 👎
spectrafit/plugins/file_converter.py 76.85% ⭐ 79.70% ⭐ 2.85% 👍
spectrafit/plugins/test/test_converter.py 87.12% ⭐ 83.62% ⭐ -3.50% 👎
spectrafit/test/test_report.py 88.57% ⭐ 88.47% ⭐ -0.10% 👎
spectrafit/test/test_tools.py 86.26% ⭐ 86.54% ⭐ 0.28% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
spectrafit/report.py fit_report_as_dict 33 ⛔ 345 ⛔ 14 😞 20.13% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
spectrafit/report.py _extracted_gof_from_results 19 😞 213 ⛔ 12 😞 36.66% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
spectrafit/tools.py PostProcessing.make_residual_fit 4 ⭐ 152 😞 11 😞 56.83% 🙂 Try splitting into smaller methods. Extract out complex expressions
spectrafit/plugins/test/test_converter.py TestPklConverter.test_export_data 3 ⭐ 224 ⛔ 7 🙂 60.38% 🙂 Try splitting into smaller methods
spectrafit/plugins/file_converter.py FileConverter.save 5 ⭐ 145 😞 8 🙂 62.76% 🙂 Try splitting into smaller methods

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!

@github-actions github-actions bot added dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation maintenance Maintenance & Security pre-commit python Pull requests that update Python code labels Jan 12, 2023
@Anselmoo Anselmoo marked this pull request as ready for review January 12, 2023 20:21
@Anselmoo Anselmoo added the enhancement New feature or request label Jan 12, 2023
@github-actions github-actions bot added the github-actions Pull requests that update Github_actions code label Jan 12, 2023
@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Merging #543 (8abffb3) into main (cb14280) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #543      +/-   ##
==========================================
+ Coverage   99.48%   99.54%   +0.07%     
==========================================
  Files          32       34       +2     
  Lines        2657     3021     +364     
==========================================
+ Hits         2643     3007     +364     
  Misses         14       14              
Impacted Files Coverage Δ
spectrafit/__init__.py 100.00% <100.00%> (ø)
spectrafit/plugins/converter.py 100.00% <100.00%> (ø)
spectrafit/plugins/data_converter.py 100.00% <100.00%> (ø)
spectrafit/plugins/file_converter.py 100.00% <100.00%> (ø)
spectrafit/plugins/pkl_converter.py 100.00% <100.00%> (ø)
spectrafit/plugins/pkl_visualizer.py 100.00% <100.00%> (ø)
spectrafit/plugins/test/test_converter.py 100.00% <100.00%> (ø)
spectrafit/report.py 96.12% <100.00%> (ø)
spectrafit/test/test_report.py 100.00% <100.00%> (ø)
spectrafit/test/test_tools.py 100.00% <100.00%> (ø)
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Add a pkl file converter and visualizer for RIXS data

fix: ♻️ Define  constant instead of duplicating

fix: ♻️ Replace `_ReadableFileobj` by `Any`

`_ReadableFileobj` cannot be access due to the __all__ command in pickle

fix: ♻️ Refactors and Type-Fixes

fix: ♻️ Replace `G` by `graph`

fix: 💚 Removed `python 3.7`

fix: 🐛 Change `int` to `str`

docs: 📝 Add comment about `home-dir` for docker

test: ⬆️ increase coverage

test: ⬆️ increase coverage

fix: ✏️ Fix typo for args

test: 🚀 Increase coverage

test: ⬆️ Increase coverage by testing `_convert`

test: ⬆️ Increase coverage

fix: 🧪 Missing coverage of `print_confidence_interval`
@sonarqubecloud
Copy link

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

@Anselmoo Anselmoo merged commit 80e0474 into main Jan 14, 2023
@Anselmoo Anselmoo deleted the Anselmoo/issue540 branch January 14, 2023 12:35
@Anselmoo Anselmoo mentioned this pull request Jan 14, 2023
2 tasks
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 documentation Improvements or additions to documentation enhancement New feature or request github-actions Pull requests that update Github_actions code maintenance Maintenance & Security pre-commit python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Working with RIXS planes [Docs]: Add home directory to suggested docker command

1 participant