boutproject / boutdata

GNU Lesser General Public License v3.0
0 stars 2 forks source link

Refactoring 'collect' functions/methods #40

Closed johnomotani closed 3 years ago

johnomotani commented 3 years ago

Reduces duplication of code between collect.py and BoutOutputs in data.py. Splits off some chunks of code into separate utility functions to make function bodies shorter.

This PR actually manages to increase the number of lines of code slightly, but I think that's because I black-formatted the changes...

johnomotani commented 3 years ago

This PR is targeted into the branch for PR #37. I'm not sure if it's easier to review this, or to review the combination of this and #37. The diff of this PR to master is here https://github.com/boutproject/boutdata/compare/master...squashoutput-parallelise-refactor.

codecov-commenter commented 3 years ago

Codecov Report

Merging #40 (c71e3de) into squashoutput-parallelise (b7c5ef7) will decrease coverage by 2.12%. The diff coverage is 72.86%.

Impacted file tree graph

@@                     Coverage Diff                      @@
##           squashoutput-parallelise      #40      +/-   ##
============================================================
- Coverage                     30.41%   28.29%   -2.13%     
============================================================
  Files                            16       16              
  Lines                          2653     2492     -161     
  Branches                        575      500      -75     
============================================================
- Hits                            807      705     -102     
+ Misses                         1747     1717      -30     
+ Partials                         99       70      -29     
Impacted Files Coverage Δ
boutdata/squashoutput.py 31.35% <ø> (ø)
boutdata/data.py 47.46% <61.97%> (-5.94%) :arrow_down:
boutdata/collect.py 71.99% <75.22%> (+4.54%) :arrow_up:

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 b7c5ef7...c71e3de. Read the comment docs.

johnomotani commented 3 years ago

OK, I'm going to merge this into #37 - we can continue discussion there if any more is needed...