ndexbio / ndex2-client

NDEx2 Client
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

Rename non-pythonic module names #19

Closed cthoyt closed 6 years ago

cthoyt commented 6 years ago

https://github.com/ndexbio/ndex2-client/blob/11dc2d31b4342fd8859eebad31d03d37c36233a1/nicecxModel/cx/aspects/CitationElement.py#L6

All of the modules in the ndex2.cx.aspects module use the camel case naming convention. This is standard for Java, but incredibly confusing in Python, especially since the classes contained in each have the same names, as in:

from ndex2.cx.aspects.CitationElement import CitationElement

A (possibly destructive) solution would be to rename each of these modules to have snake case so this would become

from ndex2.cx.aspects.citation_element import CitationElement

An alternative solution that wouldn't require renaming these modules would be to import the relevant classes in cx/aspects/__init__.py and expose them using __all__ so they cold be imported as

from ndex2.cx.aspects import CitationElement, SupportElement, ...
agary-ucsd commented 6 years ago

Yes, I agree that the current casing is confusing in Python. I'm intrigued by your last suggestion. I'll look into possibly adding the imports to init

agary-ucsd commented 6 years ago

ndex2 client v2.0.0 removes old cx classes in favor of plain old objects, thus removing most of the naming issues. The remaining class files have been renamed using snake case.