JuliaImages / JuliaImages/juliaimages.github.io
Towards consistent style, part 1: a naming guide
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 33
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
JuliaImages has grown over several years through the efforts of many people; now that Julia is itself stable, I anticipate new waves of growth in the coming years. To help ensure its health and vibrancy, I think we need to establish some guidelines that will help give such a large, distributed project a unified feel. To me, step 1 of this process is to develop a naming guide and to rename some of our functions or objects accordingly. The sooner we do this the better.
A naming guide should not be arbitrary, but be based on principles. I propose we use this issue to hash out the principles. Here are a few thoughts to get the discussion rolling:
- maintain consistency with the Julia Style Guide
- operations whose primary goal is to construct something should be nouns:
- when the goal is to create a specific type, use the uppercase constructor name (e.g.,
HOG()) - when the type created depends on the inputs, use a lowercase function (e.g.,
colorview)
- when the goal is to create a specific type, use the uppercase constructor name (e.g.,
- operations that fetch a property or type parameter should be nouns (e.g.,
axes,eltype) - for functions that compute something or perform an operation, start with a verb (e.g.,
warp) - "lazy" computations should use the noun form (e.g.,
mappedarrayrather thanmaparray)
More examples of current names that are consistent with these guidelines:
testimage,lineare fine as-is (by the "constructors are nouns" convention)colorviewas a lazy computation is better than an alternative likecombinechannels- the new
build_histogramandadjust_histogram(implemented in JuliaImages/Images.jl#761, JuliaImages/Images.jl#762) are better thanimhistandhisteq(which, for now, still remain)
Some examples of current names that would change due to these guidelines:
imfilterviolates the "start with a verb" convention.filterarray,mapstencil(inspired bymapwindow) would both be acceptableimshow->showimage- while
dilateis good,tophatseems wrong, though I don't immediately have a suggestion as to how to change it
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the proposed principles and the linked Julia Style Guide, then examine the naming examples and the referenced JuliaImages/Images.jl#761 and #762. Done would require an agreed naming guide and resolved decisions about which existing names, such as imfilter and imshow, should change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100