SIO-ODF / ctdcal

A CTD calibration package in use on US GO-SHIP cruises
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

De-duplicate and remove one-liners #14

Closed mvkovatch3 closed 3 years ago

mvkovatch3 commented 4 years ago

First pass of real code pruning: removing one-liners, copy/pasted functions, and rewritten duplicates

mvkovatch3 commented 3 years ago

I was a little cruel with the "are these imports still needed?" There are tools such as isort or others that can automatically do this for you.

Yeah, I definitely could've been more thorough. Admittedly most of those files are outdated scripts, I just found/replaced all instances of whatever function I was removing. I'll clean it up and commit.

At this point in the game it's a good idea to be running a linter over the codebase for static checking, and a formatter (black, less important right now since they're still in beta.)

I'm not going to do that in this PR but will run a linter on all the code in the pruning branch. @asx- or @DocOtak any recommendations on which linter? I've only used flake8, not sure how much of a difference it makes though.

With the error in the numpy docstring, it's also a good idea to try to build autodocs: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html

Probably easier to ask @DocOtak for some help with setting up autodocs. Then you'll know if your documentation is write (haha, get it?) as Sphinx tries to Write The Docs. (A second dad joke in the same sentence.)

I got autodocs running last week on master, just merged that back in to this branch.

DocOtak commented 3 years ago

Looks like cchdo/hydro is using flake8 with some tweaks to keep it from complaining about some things that black does. I suspect I lifted those things directly from xarray