Pyro
Unit Size

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 2,624 units with 25,278 lines of code in units (64.6% of code).
    • 3 very long units (318 lines of code)
    • 32 long units (2,104 lines of code)
    • 242 medium size units (6,990 lines of code)
    • 469 small units (6,846 lines of code)
    • 1,878 very small units (9,020 lines of code)
1% | 8% | 27% | 27% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
py1% | 8% | 27% | 27% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Logical Component
primary logical decomposition
examples4% | 18% | 29% | 22% | 25%
pyro<1% | 6% | 26% | 28% | 37%
profiler0% | 0% | 51% | 11% | 37%
tutorial0% | 0% | 34% | 0% | 65%
Legend:
101+
51-100
21-50
11-20
1-10
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
def main()
in examples/dmm/dmm.py
108 24 1
def _monotonic_rational_spline()
in pyro/distributions/transforms/spline.py
107 16 12
def model_generic()
in examples/mixed_hmm/model.py
103 12 1
def backtest()
in pyro/contrib/forecast/evaluate.py
97 24 16
def main()
in examples/air/main.py
92 26 1
def main()
in examples/baseball.py
90 1 1
def sample()
in pyro/infer/mcmc/nuts.py
90 24 2
def main()
in examples/contrib/timeseries/gp_models.py
86 22 1
def run_expt()
in examples/mixed_hmm/experiment.py
79 20 1
def main()
in examples/neutra.py
75 3 1
def evaluate()
in examples/contrib/epidemiology/sir.py
74 21 3
def fit_svi()
in pyro/contrib/epidemiology/compartmental.py
74 22 9
def _sample_posterior_from_trace()
in pyro/infer/discrete.py
73 33 5
def compute_bin_probs()
in pyro/contrib/epidemiology/util.py
70 6 2
def fit_mcmc()
in pyro/contrib/epidemiology/compartmental.py
67 23 2
def backward()
in pyro/distributions/diag_normal_mixture.py
65 1 2
def __init__()
in examples/air/air.py
64 7 23
def main()
in examples/hmm.py
64 10 1
def _build_tree()
in pyro/infer/mcmc/nuts.py
62 15 8
def _quantized_model()
in pyro/contrib/epidemiology/compartmental.py
60 15 1
def loss_and_grads()
in pyro/infer/renyi_elbo.py
60 22 5
def main()
in examples/svi_horovod.py
59 26 1
def __setattr__()
in pyro/nn/module.py
58 16 3
def conditional()
in pyro/contrib/gp/util.py
57 14 9
def __init__()
in pyro/distributions/hmm.py
57 12 8
def main()
in examples/sparse_regression.py
56 13 1
def _sequential_gaussian_filter_sample()
in pyro/distributions/hmm.py
56 6 3
def _loss()
in pyro/infer/rws.py
54 22 5
def compute_posterior_stats()
in examples/sparse_regression.py
53 16 9
def check_model_guide_match()
in pyro/util.py
53 40 3
def predictive()
in pyro/infer/mcmc/util.py
53 13 4
def einsum()
in pyro/ops/contract.py
52 14 3
def naive_ubersum()
in pyro/ops/contract.py
52 29 3
def predict()
in examples/sir_hmc.py
51 7 4
def main()
in examples/vae/ss_vae_M2.py
51 23 1
def __init__()
in pyro/contrib/forecast/forecaster.py
50 9 13
def __init__()
in pyro/nn/auto_reg_nn.py
49 5 9
def __getattr__()
in pyro/nn/module.py
49 23 2
def forward()
in pyro/contrib/gp/models/sgpr.py
49 7 4
def _compute_model_factors()
in pyro/infer/traceenum_elbo.py
49 22 2
def main()
in examples/contrib/gp/sv-dkl.py
47 13 1
def main()
in examples/vae/vae.py
47 16 1
def main()
in examples/capture_recapture/cjs.py
47 16 1
def _differentiable_loss_parts()
in pyro/infer/trace_mmd.py
46 11 5
def model()
in examples/contrib/forecast/bart.py
45 3 3
def __init__()
in examples/vae/utils/custom_mlp.py
45 11 12
def _predictive()
in pyro/infer/predictive.py
45 16 4
def load_bart_od()
in pyro/contrib/examples/bart.py
44 8 0
def _contract_component()
in pyro/ops/contract.py
44 12 4
def predict()
in examples/contrib/epidemiology/sir.py
43 5 3