Naming conventions for kashima.mapper
This document defines a minimal and explicit naming policy for functions, classes,
modules, and variables in kashima.mapper. Goals:
- Clearly separate public API vs internal helpers.
- Preserve backward compatibility.
- Avoid chaotic naming and mixed-language identifiers.
1. Public API surface
The public API of kashima.mapper is defined by what is exported in
kashima/mapper/__init__.py. Today it includes:
1.1 Public classes
MapConfigEventConfigFaultConfigStationConfigUSGSCatalogGCMTCatalogEventMap
1.2 Public functions and constants
buildMapbuildCatalogbuildUSGSCatalogbuildGCMTCatalogbuildISCCatalogbuildGEMActiveFaultsbuildUSGSQuaternaryFaultsbuildEFSM20FaultsdownloadAllCatalogsupdateAllCatalogsupdateUSGSCatalogupdateGCMTCatalogupdateISCCatalogupdateGEMActiveFaultsupdateUSGSQuaternaryFaultsupdateEFSM20Faultsget_cache_dirclear_cacheget_auxiliary_file_pathauxiliary_file_existscalculate_zoom_levelEARTH_RADIUS_KMTILE_LAYERS
These entries define the stable surface of kashima.mapper. Renaming work
must not break these imports. BaseMap, BlastConfig, and BlastCatalog are
not part of the active mapper API from version 3.2.0 onward.
2. Rules for public functions
- Keep the historical camelCase style for high-level public functions:
buildMap,buildCatalog,downloadAllCatalogs,updateAllCatalogs, etc.
-
If
snake_caseequivalents are introduced in the future, they must be aliases and not replacements. Hypothetical example:def build_map(*args, **kwargs): """snake_case alias for buildMap (compatibility).""" return buildMap(*args, **kwargs) - Documentation (README and docs/) must always refer to public functions by their exact names.
3. Rules for classes
- All public classes (including config classes) use PascalCase.
- Internal classes should also use PascalCase.
4. Modules and internal helpers
- Module names should use short English
snake_case:- Good:
event_map.py,site_marker.py,local_faults.py
- Good:
- Internal functions use
snake_caseand should use a_prefix when private to a module. - Avoid overly long or informal names.
- Internal code identifiers should be English.
5. Variables and parameters
- User-facing parameters should use readable, stable
snake_case. - Internal variables should also use
snake_case; standard abbreviations are OK when clear (df,gdf,bbox).
6. Constants
- Global constants use ALL_CAPS with
_. - Shared constants should live in one place and be imported where needed.
7. Refactor strategy
- Inventory: review
kashima/mapper/__init__.pyand classify symbols. - Module-by-module internal refactors: rename only internal helpers first.
- Documentation: update README/docs if aliases are introduced or names are deprecated.
This document is the reference for naming changes starting from kashima 1.7.0.