Skip to content

Instantly share code, notes, and snippets.

@asitang
asitang / labcas-download.py
Created October 13, 2021 18:17
LabCAS Download Script
# encoding: utf-8
#
# Sample LabCAS Download script
#
# To run this, you'll need Python 3 with the `requests` package. The easiest
# way to do this is with a "virtual environment" by running:
#
# $ python3 -m venv venv
# $ cd venv
# $ bin/pip install --quiet --upgrade pip requests
@asitang
asitang / DAG_in_Plotly.py
Last active February 11, 2021 16:09
A minimalistic Topological layout for DAGs using NetworkX and Plotly
import networkx as nx
import plotly.graph_objects as go
def plotly_DAG(nx_dag, node_description_dict):
"""
nx_dag: a networkX directed acyclic graph
node_description_dict: a nested dictionary that contains node attributes to show on hover
eg. {
'node_A':{'property_1':'value_A_1', 'property_2':'value_A_2'},
'node_B':{'property_1':'value_B_1', 'property_2':'value_B_2'}