CADWRDeltaModeling / schimpy

Python package for SCHISM
https://cadwrdeltamodeling.github.io/schimpy/
MIT License
9 stars 6 forks source link

Sourcery refactored master branch #29

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 27.00 😞 26.72 😞 -0.28 👍
Method Length 131.73 😞 130.92 😞 -0.81 👍
Working memory 14.27 😞 14.36 😞 0.09 👎
Quality 44.37% 😞 44.64% 😞 0.27% 👍
Other metrics Before After Change
Lines 16217 16022 -195
Changed files Quality Before Quality After Quality Change
setup.py 60.38% 🙂 62.44% 🙂 2.06% 👍
versioneer.py 52.26% 🙂 52.23% 🙂 -0.03% 👎
schimpy/_version.py 59.38% 🙂 59.42% 🙂 0.04% 👍
schimpy/base_io.py 84.97% ⭐ 86.36% ⭐ 1.39% 👍
schimpy/batch_metrics.py 35.05% 😞 35.29% 😞 0.24% 👍
schimpy/cencoos_download.py 15.80% ⛔ 15.80% ⛔ 0.00%
schimpy/clip_dems.py 41.33% 😞 41.23% 😞 -0.10% 👎
schimpy/combine_consume.py 46.07% 😞 46.56% 😞 0.49% 👍
schimpy/combine_flux.py 60.18% 🙂 60.56% 🙂 0.38% 👍
schimpy/contour_smooth.py 53.55% 🙂 52.78% 🙂 -0.77% 👎
schimpy/convert_sav_class_to_number.py 54.36% 🙂 53.76% 🙂 -0.60% 👎
schimpy/create_vgrid_lsc2.py 36.53% 😞 36.73% 😞 0.20% 👍
schimpy/cruise.py 48.65% 😞 48.04% 😞 -0.61% 👎
schimpy/cut_mesh.py 77.07% ⭐ 77.13% ⭐ 0.06% 👍
schimpy/gen_elev2D.py 43.13% 😞 43.11% 😞 -0.02% 👎
schimpy/geo_tools.py 56.50% 🙂 56.01% 🙂 -0.49% 👎
schimpy/gr3.py 37.16% 😞 40.70% 😞 3.54% 👍
schimpy/grid_opt.py 66.95% 🙂 67.61% 🙂 0.66% 👍
schimpy/hotstart_inventory.py 80.69% ⭐ 80.69% ⭐ 0.00%
schimpy/hrr3.py 48.32% 😞 48.60% 😞 0.28% 👍
schimpy/interpolate_structure.py 77.02% ⭐ 78.58% ⭐ 1.56% 👍
schimpy/lsc2.py 34.73% 😞 35.27% 😞 0.54% 👍
schimpy/material_poly.py 58.55% 🙂 58.94% 🙂 0.39% 👍
schimpy/metricsplot.py 56.95% 🙂 58.28% 🙂 1.33% 👍
schimpy/model_time.py 41.75% 😞 43.53% 😞 1.78% 👍
schimpy/namelist.py 56.71% 🙂 54.97% 🙂 -1.74% 👎
schimpy/nudging.py 18.91% ⛔ 19.03% ⛔ 0.12% 👍
schimpy/params.py 65.74% 🙂 65.73% 🙂 -0.01% 👎
schimpy/plot_default_formats.py 61.11% 🙂 62.93% 🙂 1.82% 👍
schimpy/polygons.py 84.29% ⭐ 84.88% ⭐ 0.59% 👍
schimpy/prepare_schism.py 55.60% 🙂 55.76% 🙂 0.16% 👍
schimpy/profile_plot.py 32.51% 😞 34.12% 😞 1.61% 👍
schimpy/read_output_xyt.py 65.73% 🙂 65.87% 🙂 0.14% 👍
schimpy/schism_hotstart.py 30.27% 😞 30.82% 😞 0.55% 👍
schimpy/schism_input.py 96.35% ⭐ 97.08% ⭐ 0.73% 👍
schimpy/schism_linestring.py 64.24% 🙂 64.13% 🙂 -0.11% 👎
schimpy/schism_mesh.py 52.28% 🙂 53.00% 🙂 0.72% 👍
schimpy/schism_nudging.py 19.55% ⛔ 19.67% ⛔ 0.12% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
schimpy/schism_nudging.py nudging.gen_nudge_roms 161 ⛔ 2942 ⛔ 49 ⛔ 0.05% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
schimpy/nudging.py nudging.gen_nudge_3dfield 147 ⛔ 2929 ⛔ 45 ⛔ 0.09% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
schimpy/batch_metrics.py BatchMetrics.plot 121 ⛔ 1022 ⛔ 34 ⛔ 0.51% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
schimpy/schism_hotstart.py VariableField.interp_from_mesh 87 ⛔ 902 ⛔ 31 ⛔ 1.11% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
schimpy/lsc2.py gen_sigma 100 ⛔ 1323 ⛔ 27 ⛔ 1.57% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. 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!

Help us improve this quality report!