Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 896 Bytes

File metadata and controls

24 lines (17 loc) · 896 Bytes

Personal understanding of good-practise

  • Use function annotations.
  • Use logging module.(Define stream or file logging)
  • Use Makefile with mypy, pylint , unittest.
  • Unittest should use mocking instead of real objects, basically prevent doing any integration test.
  • Multiprocessing over multithreading in cpu intensive tasks.
  • Using Deque instead of Queue.
  • Using numpy arrays as compared to lists due to continous memory allocation.
  • Using Dictionaries more often.
  • Iteration over Recursion.

Parallel-Processing

  • Better to use ProcessPoolExecutor over manually handling processes.
  • Use locks when dealing with files in multiprocessing/multithreading

Python Style Guide

Pathlib vs os.path