-
Notifications
You must be signed in to change notification settings - Fork 33
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
PEP8 #39
Comments
Some utilities that could help us from going insane: https://pypi.python.org/pypi/autopep8 Doesn't look like these rename functions for you. Probably a good thing. |
I have always been curious why you guys never followed convention for naming things pep8 style. I am in favor of this. |
This package was my first exposure to the Python language. I was young, naive, and fancy free. |
Oh man, there are elements that could be painful... For commonly used things, |
@rowanc1 I've been there :) This got implemented in Fatiando right after Scipy 2014 in fatiando/fatiando#115 I used autopep8 but did it one file at a time to check that all tests and scripts were still working. I wouldn't recommend running it on the entire library at once. A good way to start to put the pep8 check into a CI system and enforce it for new code. I recently started running flake8 in TravisCI to catch any incompatibilities (fatiando/fatiando#382). Another useful tool is pylint with the @lheagy I've been very liberal with breaking backward compatibility in Fatiando. I should actually make it more clear in the docs about that. One thing that mitigates this is to always record and cite the version number in research projects. The code there will still work and produce the results from the paper, just not using the latest Fatiando. For example, I was working on this paper and this one in parallel and they both use different incompatible versions. But they both still work. |
Thanks @leouieda, keeping track of versions is a very good point. This is where making use of a mailing-list and making sure release notes are easily found from the docs will be important. |
A few naming thoughts on the base class
|
Ok, so here is a bit more of a comprehensive list of suggestions, starting at the basemesh (cc @rowanc1, @dougoldenburg, @simpeg/simpeg-developers). These are just a first pass at suggestions - please add your thoughts! Thoughts on naming conventionsThese are very open to suggestions! They are some of my initial thoughts and might help give an idea where the below suggestions came from.
Suggested Changes in BaseMesh.py and TensorMesh.pyI started by examining these two files as they are among the most core to the whole package. BaseMeshProperties
Methods
BaseRectangularMeshPropertiessimilar extension to the renaming suggested above, eg.
Methods
BaseTensorMeshPropertiesI am less sure about these suggestions. Please chime in!
Methods
(there are also private methods, but this is less of a big-deal...) TensorMeshProperties
|
This will be helpful: https://github.com/ambv/black |
I've been using it for a few months and really like the freedom of not needing to explain formatting to new users or worry about it myself. That said, I'd only recommend it if you can deal with handing control of formatting completely over to the tool. The code looks way better than with autopep8, though. |
Because I know that we should.
This could probably help ease us in:
http://propertiespy.readthedocs.io/en/latest/content/renamed.html#renamed-property
I think that there are a number of handy properties that people use quite often that would need some thought:
nC, nF, vnE
etc. I think true PEP8 doesn't even like the 2 letter variable names? For some of this stuff that is used constantly, I think that is fine?faceDiv
-->face_div
Oh boy.
fatiando/fatiando#278
Thoughts @lheagy?
The text was updated successfully, but these errors were encountered: