-
Notifications
You must be signed in to change notification settings - Fork 7
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
v0.1 refactor #95
Comments
Those look good to me! I might just add "write the Getting Started docs page"? |
Good call. The docs need a lot of love but that seems like an appropriate piece to include in this effort. |
The cleaner the API the shorter that page will be, too!
|
@pgkirsch this sounds fantastic! What are your thoughts on using a code formatter like |
Thanks @whoburg! |
* Combine lse_implict and lse_scaled into a single module * Consolidate test module too
* FitCS --> FitConstraintSet * fit_constraintset.py --> constraint_set.py
* Remove mixedCase variable and function names
* Move xfoil_wrapper.py to xfoil/wrapper.py * Move XFoilFit class into xfoil/constraint_set.py
* bverbose removed * alpha0 as kwarg * mixedcase var * comments and whitespace
* Added ex 6.3 to docs/source/examples/ * Deleted gpfit/examples/ dir * Consolidated ex 6.3 into t_examples (deleted t_ex6_3.py)
@whoburg I ran black on the code. It certainly brings nice uniformity and saves time spent mindlessly formatting code. There are a few things I don't love though. It also does makes some weird changes like:
Sure, that original line probably isn't great style and the black change can be fixed by assigning Lastly, rather than making the code more concise, it increased the total lines of code in the main directory very slightly from 906 to 941 (despite allowing lines up 88 chars long). Anyway don't mean to complain too much, it's clearly a powerful tool and I'm on board with continuing to use it. I just wanted to flag a few minor things that gave me pause. (cc @bqpd) |
Yeah the best use I've seen of black is to pretty-print long data entries for adding quick tests: just copy-paste in one line, then run black to line-break etc.; its style differs from our matlab-flavoured conventions quite a bit for arithmetic! |
(also it would've been super useful back when we were first linting everything!) |
* Docstrings * Whitespace (fewer blank lines in functions) * Removed some cruft comments
* Better citation * Remove Getting Started (for now) * Add another example * Update conf
* Removed spaces around *, /, ** * Fixed some of the more egregious line break situations * Removed a stub unit test
* Use of solution warnings API for out-of-bounds warnings * Use of NamedVariables environment * Unit tests for FitConstraintSet
Just coming back here to say that I've fully come around on black and would support using it not only in gpfit but also in gpkit, maybe once the great pylint refactor of 2024 is merged 👀 |
I propose we create a 0.0 release of GPfit and then perform a pretty wholesale refactor of the code. Here is the list of changes I would like to make:
__future__
imports)get_params
ba_init
FitCS
fit.py
andfit_constraintset.py
xfoil.py
)lse_scaled
andlse_implicit
into one moduleFit should be a class not a functionEliminateplot_fit.py
andprint_fit.py
(they should be class methods)Write the Getting Started docs pageThere is a little overlap with #73 but would be good to include those items too!
@bqpd @whoburg any objections or things you want to add?
The text was updated successfully, but these errors were encountered: