function naming conventions
There is currently no consistent naming convention for functions in PyCA -- names are camel-case (which is my preference even if it's not python-like), but there's no standard for whether the first letter should be capitalized, and it's inconsistent for Oper functions (applyH vs. Resample) as well as member functions (Size(), NVox, vs. resize(), setSize()). There are also probably some poorly-named functions (I personally hate Vec3D's productOfElements()). Since we're changing some names anyway, should we choose a consistent scheme? Are there any function names that should be changed now while we can? My preference (and easiest choice) would be to go ahead and make non-member functions capitalized and member functions lowercase.
Comments (9)
-
-
I think this is a good idea to be consistent and change these early. I don't have any preference to capitalization though.
-
Added wiki page
-
reporter (Reply via js...@sci.utah.edu):
Okay, I'll call it a consensus then -- I'll make a branch for these changes, and as I change names I'll make entries here:
https://bitbucket.org/scicompanat/pyca/wiki/AW_Migration
On Fri, Jan 11, 2013 at 3:16 PM, Jacob Hinkle issues-reply@bitbucket.org wrote:
-
reporter Okay, the renaming is mostly done. Just a couple issues:
-
@jhinkle what should I do about ad and coad (vs. Ad and CoAd)
-
I don't really like the name ForwardApply for splatting, how about just Splat? Any other suggestions?
-
-
Great.
- This is tricky. We need implementations of Ad, ad, Ad^*, and ad^*. In order
to comply and still be convenient, how about
Z = Ad_g X
is called asLieAd(Z,g,X)
. So we just prependLie
to everything. Then we haveLieAd
,LieCoAd
,Liead
, andLiecoad
. That violates CamelCase rules I guess... Another Option is to useInf
to specify the infinitesimal (lowercase) versions:LieAdInf=ad
,LieCoAdInf=coad
. - Yes I like
splat()
and I think the default should be non-normalized.
- This is tricky. We need implementations of Ad, ad, Ad^*, and ad^*. In order
to comply and still be convenient, how about
-
In case we use Inf then we no longer need the
Lie
prefix either. I'd say I probably prefer that:Ad,CoAd,AdInf,CoAdInf
-
reporter (Reply via js...@sci.utah.edu):
Sounds good, I'll go with Ad,CoAd,AdInf,CoAdInf, and Splat. And I agree that default should be without normalization.
-Sam
On Sat, Jan 12, 2013 at 8:51 AM, Jacob Hinkle issues-reply@bitbucket.org wrote:
-
reporter - changed status to resolved
Merged in NamingConventionChanges (pull request #2: Naming Convention Changes). Closes issue
#6.→ <<cset 2adacb94b633>>
- Log in to comment
Yeah I'd say
v.prod()
is a little simpler thanv.productOfElements()
. I think we should definitely have a convention. I think now is definitely the time for changes like this, before too much python code gets built up. I am probably fine with capitalizing non-member functions. I tend to prefer lower camelCase, but for PyCA we have stuff likesum
that is already a builtin.Whatever we choose, we should have a wiki page on it. I will start a Coding Conventions page.