-
Notifications
You must be signed in to change notification settings - Fork 25
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
Reorganize #9
Reorganize #9
Conversation
Hi Pete, Thanks for your contribution! I like many of the changes, a few I'm a little less sure about. It's a good idea to wrap the test suite in a function. I'm less sure about moving it out of a test directory. That works well for this code, but this is one of several codes in our WISDEM suite and we'd like to maintain consistency. Not saying it's not worth making the change across our codes, but we'd have to reevaluate that. One reason we kept them in a test directory is for automated discovery with nose. Also some of our other modules have multiple separate test scripts and it just kept things cleaner. But keeping them in one directory might be easier for development than using The separation of the CLI to a separate script and renaming the rest to core.py seems unnecessary to me. I don't think it's a bad idea, but it does remove some of the simplicity of the script for those who only use it from the CLI. That requires users to install before running the script (or to move the script and its adjoining folder around together). We have some users who don't really use Python and they just use the script by itself and so it is kind of nice to have everything in one file that doesn't require installation. Also on importing, we avoid using * imports in favor of being explicit. |
Hi Andrew, I just removed the top level test script but kept the I think using a separate script for the CLI is necessary if you want to make this a package (to install the Moving everything to Anyway, I may be wrong about all this! Just trying to make this look a little more like the typical Python packages out there. Cheers, |
Pete, I agree that those changes would be necessary if a package was required. However, I don't think that is necessarily the case. It certainly is a fine approach, but packages are not required for distribution they are purely organizational aids. One can instead add modules directly (using py_modules) and this works perfectly fine with setup.py, PyPI, etc.. Obviously, packages are great, and we use them in our other large modules, but for super simple repository like this one with only one file and one test script (I don't think I was adding the test script in setup.py and I should have), I've seen typical Python distributions go both ways. Putting this simple script in a package works just fine, but feels a little forced to me. But that's just a preference I guess, either way is totally acceptable. Regarding using setup.py install, I definitely agree that's the way to go. That's certainly how I would recommend using it. However, what I was describing does not prevent standard usage. Many of our users are used to Fortran binaries as that is how all of the past NWTC tools have been distributed. By keeping the CLI in the airfoilprep.py file, the script could function in the same manner. You just make the script executable and then you can call I do agree that there are benefits to adding the test file directly in the src directory, but we'd need to reevaluate all of our packages before making a change like that for consistency reasons. Also, the |
Andrew, this has been closed but i wonder if there are some of the commits that Pete implemented that you want to incorporate? Pete - I see you closed the issue - thanks for your contribution; it would be nice to see if we can find some middle ground since it looks like there was some good content added. Thoughts everyone? |
This pull request moves things around and cleans things up a little:
airfoilprep
is now a package.airfoilprep.py
CLI script is now installed in the Python scripts directory.