Skip to content

Contribution rules

GreatYYX edited this page Apr 19, 2017 · 3 revisions

Code style

  1. https://www.python.org/dev/peps/pep-0008/
  2. Naming rules:
  • class: camel case
  • variable: lower_case_under_scores
  • constant: UPPER_CASE_UNDER_SCORES
  • private member / variable: starts with under score
  • string: single quote
  1. Annotation:

Structure

  • Functional module should not have states.
  • Create test cases in tests folder and use pytest to run them.
  • Add dependencies to requirements.txt.
  • Create dev_test folder in root path, use it to write code snippet and do local tests.
  • If some of the private function will only be used within a method, make this private function to a inner function of the method.

Utilities

  • Invoke self._get_abs_path() on all file path string to get the absolute path.

Workflow

tk = rltk.init()

iter1 = get_iterator(file_path, id_path)
iter2 = get_iterator(file_path, id_path)

tk.q_gram_blocking(iter1, iter2, size_range=(2,5), output_path)
tk.lsh_blocking(...)

tk.compute_features(blocking_path, iter1, iter2, feature_config, feature_output_path)
model = tk.train_model(train_data, iter1, iter2, feature_config, model_config)
Clone this wiki locally