function naming conventions

Issue #6 resolved
Sam Preston created an issue

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)

  1. Jacob Hinkle

    Yeah I'd say v.prod() is a little simpler than v.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 like sum that is already a builtin.

    Whatever we choose, we should have a wiki page on it. I will start a Coding Conventions page.

  2. Caleb Rottman

    I think this is a good idea to be consistent and change these early. I don't have any preference to capitalization though.

  3. Sam Preston 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?

  4. Jacob Hinkle

    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 as LieAd(Z,g,X). So we just prepend Lie to everything. Then we have LieAd, LieCoAd, Liead, and Liecoad. That violates CamelCase rules I guess... Another Option is to use Inf to specify the infinitesimal (lowercase) versions: LieAdInf=ad, LieCoAdInf=coad.
    • Yes I like splat() and I think the default should be non-normalized.
  5. Jacob Hinkle

    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

  6. Sam Preston 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:

  7. Log in to comment