rs-station / reciprocalspaceship

Tools for exploring reciprocal space
https://rs-station.github.io/reciprocalspaceship/
MIT License
28 stars 11 forks source link

About the methods naming like "compute_xxx" and "label_xxx" #167

Closed minhuanli closed 2 years ago

minhuanli commented 2 years ago

This is not a real issue but more like some thoughts from my own user experience, so apparently not urgent at all.

I am wondering if it is more helpful to change some methods name from "compute_xxx" to "xxx_compute", or add an alias like that. For example, the "compute_multiplicity" to "multiplicity_compute".

This would be helpful for new users who tend to use auto-completion searching for related methods (Or maybe I am the only one doing this). A keyword plus a tab could direct them to the correct methods if exist, and no need to open the documentation.

Also this could be a good way to let them get access to all related methods of a core concept. For example, currently there are two methods dealing with absences: "remove_absences" and "label_absences". The new naming style like "absences_label" and "absences_remove" could make users immediately know there are two related methods when they type "absences" and try to auto-complete.

JBGreisman commented 2 years ago

Personally, I like methods to be expressed with active verbs when possible: "compute_multiplicity", etc. While I am all for the sentiment of a more robust tab-complete, I don't think we should sacrifice the interpretability of methods to support that. I think that methods like "multiplicity_compute" would be difficult/non-intuitive to parse.

I also hesitate to over-populate the namespace -- I think that often makes it challenging to fully tab-complete through available methods.

minhuanli commented 2 years ago

You have convinced me!