neomatrix369 / nlp_profiler

A simple NLP library allows profiling datasets with one or more text columns. When given a dataset and a column name containing text data, NLP Profiler will return either high-level insights or low-level/granular statistical information about the text in that column.
Other
241 stars 37 forks source link

Refactor: split the original generate_features.py module #29

Closed neomatrix369 closed 3 years ago

neomatrix369 commented 3 years ago

Refactor: split the original generate_features.py and extract the parallelisation aspect into a module of it's own

Related to issue #28, and partially resolves it (reduces complexity)

neomatrix369 commented 3 years ago

@sourcery-ai in the above report it would be helpful to find out what those recommended/suggested changes are, which areas in the code these changes can be brought about

The before and after changes report/comparison maybe a bit counter-intuitive if compared to the changes made in the code base

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

This PR has an average code quality of 85.18%

Quality metrics Before After Change
Complexity 1.00 ⭐
Method Length 37.00 ⭐
Working memory 7.00 πŸ™‚
Quality % 85.18% ⭐ %
Other metrics Before After Change
Lines 27
Changed files Quality Before Quality After Quality Change
nlp_profiler/generate_features/init.py 85.18% ⭐

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

File Function Complexity Length Working Memory Quality Recommendation
nlp_profiler/generate_features/init.py generate_features 2 ⭐ 62 πŸ™‚ 11 😞 70.70% πŸ™‚ Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

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.

codecov-io commented 3 years ago

Codecov Report

Merging #29 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #29   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        21    +1     
  Lines          358       360    +2     
  Branches        51        51           
=========================================
+ Hits           358       360    +2     
Impacted Files Coverage Ξ”
nlp_profiler/generate_features/__init__.py 100.00% <100.00%> (ΓΈ)
...erate_features/parallelisation_methods/__init__.py 100.00% <100.00%> (ΓΈ)

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 5ad0271...193f97a. Read the comment docs.

neomatrix369 commented 3 years ago

Merging, for now, will use the @sourcery-ai generated PRs as guidance to refractor further