Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Trust a JupyterLab Notebook

By default, IPython (kernel of Jupyter/Lab notebook) disables executation of untrusted code without explicit user input. If you have notebook whose output containings JavaScript (e.g., JS-based visualiation) and code wasn't run by you (e.g., the notebook is shared by someone else), the JS-based output won't be shown …

Runtime Paths in Python

__file__ is the path of the Python script. Note that if you make a sybolic link to a Python script and run the symbolic link, then __file__ is the path of the symbolic link. Of course, you can use os.path.realpath to get real path of files.

pathlib.Path …

Good Ways to Do Scientific Computing

  1. Break down the work into smaller modules and develop pipelines (consists of module) for the work. Be sure to save (important) intermediate results so that you can resume failed modules withouting reruning succeeded ones.

  2. Manage your project in GitHub and use issues to manage tasks to do and their priorities …