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 exception in sdt reader index calculation #647

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

s-weigand
Copy link
Member

  • index is calculated correctly + test
  • differentiate between raw_data (np.ndarray) and data (xr.Dataset|xr.DataArray)
  • warning raised at the correct stacklevel

Testing

Passing the tests is mandatory.

Closing issues

closes #646

- index is calculated correctly + test
- differentiate between raw_data (np.ndarray) and data(xr.Dataset|xr.DataArray)
- warning raised at the correct stacklevel
@s-weigand s-weigand requested a review from a team as a code owner April 22, 2021 15:52
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Apr 22, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 10.83 🙂 10.83 🙂 0.00
Method Length 120.67 😞 127.00 😞 6.33 👎
Working memory 14.17 😞 15.17 ⛔ 1.00 👎
Quality 42.51% 😞 40.59% 😞 -1.92% 👎
Other metrics Before After Change
Lines 131 135 4
Changed files Quality Before Quality After Quality Change
glotaran/builtin/io/sdt/sdt_file_reader.py 34.38% 😞 33.09% 😞 -1.29% 👎
glotaran/builtin/io/sdt/test/test_file_readers.py 63.64% 🙂 60.08% 🙂 -3.56% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/builtin/io/sdt/sdt_file_reader.py SdtDataIo.load_dataset 15 🙂 234 ⛔ 16 ⛔ 33.09% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/builtin/io/sdt/test/test_file_readers.py test_read_sdt 0 ⭐ 129 😞 13 😞 60.08% 🙂 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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@sonarqubecloud
Copy link

Kudos, SonarCloud 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 Apr 22, 2021

Codecov Report

Merging #647 (e786e56) into main (f4e2645) will increase coverage by 0.1%.
The diff coverage is 50.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #647     +/-   ##
=======================================
+ Coverage   78.7%   78.8%   +0.1%     
=======================================
  Files         69      69             
  Lines       3689    3689             
  Branches     673     673             
=======================================
+ Hits        2905    2909      +4     
+ Misses       655     653      -2     
+ Partials     129     127      -2     
Impacted Files Coverage Δ
glotaran/builtin/io/sdt/sdt_file_reader.py 62.1% <50.0%> (+10.8%) ⬆️

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 f4e2645...e786e56. Read the comment docs.

Copy link
Member

@jsnel jsnel left a comment

Choose a reason for hiding this comment

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

LGTM

@jsnel jsnel merged commit 800ac63 into glotaran:main Apr 22, 2021
@s-weigand s-weigand deleted the fix-sdtreader-index branch April 23, 2021 07:53
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.

🐛 Sdt reader index calculation is broken
2 participants