Code Quality

Code Quality#

This page contains information on various code quality metrics that are collected during the development cycle. Some of these are autogenerated while others rely on manual scripts and updating the documentation, so these will be updating as needed and when appropriate. All plots show the corresponding commit hash when hovering over a point with the mouse pointer.

Hide code cell content
from bokeh.plotting import figure, show, output_notebook
from bokeh.models import ColumnDataSource, HoverTool, Range1d
import pandas as pd
from datetime import datetime

output_notebook()

COLORS = ['blue', 'green', 'red', 'cyan', 'magenta', 'y', 'k']

columns = ["commit_hash", "commit_hash_8char", "date", "jensen", "gauss", "gch", "cc", "emgauss", "code_coverage", "tooltip_label"]
data = [
    ("df25a9cfacd3d652361d2bd37f568af00acb2631", "df25a9cf", datetime(2021, 12, 29), 1.2691, 1.2584, 1.6432,   None,   None, 0.4344, "df25a9cf"),
    ("b797390a43298a815f3ff57955cfdc71ecf3e866", "b797390a", datetime(2022,  1,  3), 0.6867, 1.2354, 1.8026,   None,   None, 0.2993, "b797390a"),
    ("01a02d5f91b2f4a863eebe88a618974b0749d1c4", "01a02d5f", datetime(2022,  1,  4), 0.3742, 0.8174, 1.3689,   None,   None, 0.0000, "01a02d5f"),
    ("dd847210082035d43b0273ae63a76a53cb8d2e12", "dd847210", datetime(2022,  1,  6), 0.3600, 0.8285, 1.3736,   None,   None, 0.0000, "dd847210"),
    ("33779269e98cc882a5f066c462d8ec1eadf37a1a", "33779269", datetime(2022,  1, 10), 0.3596, 0.8315, 1.4128,   None,   None, 0.3690, "33779269"),
    ("12890e029a7155b074b9b325d320d1798338e287", "12890e02", datetime(2022,  1, 11), 0.3635, 0.8460, 1.4014,   None,   None, 0.3682, "12890e02"),
    ("66dafc08bd620d96deda7d526b0e4bfc3b086650", "66dafc08", datetime(2022,  1, 12), 0.3874, 0.7971, 1.4026,   None,   None, 0.3709, "66dafc08"),
    ("a325819b3b03b84bd76ad455e3f9b4600744ba14", "a325819b", datetime(2022,  1, 13), 0.3775, 0.8302, 1.3628,   None,   None, 0.3709, "a325819b"),
    ("8a2c1a610295c007f0222ce737723c341189811d", "8a2c1a61", datetime(2022,  1, 14), 0.3799, 0.8293, 1.4028,   None,   None, 0.3708, "8a2c1a61"),
    ("c6bc79b0cfbc8ce5d6da0d33b68028157d2e93c0", "c6bc79b0", datetime(2022,  1, 14), 0.3734, 0.8062, 1.3642,   None,   None, 0.3701, "c6bc79b0"),
    ("03e1f461c152e4f221fe92c834f2787680cf5772", "03e1f461", datetime(2022,  1, 18), 0.3801, 0.7928, 1.4232, 1.5449,   None, 0.3673, "PR #56"),
    ("9e96d6c412b64fe76a57e7de8af3b00c21d18348", "9e96d6c4", datetime(2022,  1, 19), 0.3844, 0.7824, 1.3674, 1.5855,   None, 0.3825, "v3.0rc1"),
    ("2a98428f9c6fb9bb4302ae09809441bf3e7162b0", "2a98428f", datetime(2022,  2, 15), 0.2396, 0.7818, 1.3971, 1.5610,   None, 0.3824, "PR #317"),
    ("9b4e85cf1b41ba7001aaba1a830b93e176f3dd43", "9b4e85cf", datetime(2022,  3,  1), 0.2508, 0.8736, 1.4966, 1.5934,   None, 0.1572, "v3.0"),
    ("d18f4d263ecabf502242592f9d60815a07c7b89c", "d18f4d26", datetime(2022,  3,  4), 0.2501, 0.8864, 1.4946, 1.6091,   None, 0.1572, "v3.0.1"),
    ("a23241bb9e45078e36a4662d48c9d3fe0c3316e4", "a23241bb", datetime(2022,  4,  6), 0.2434, 0.8850, 1.4534, 1.6367,   None, 0.1682, "v3.1"),
    ("c2006b0011a5df036c306c15e75763ec492dafda", "c2006b00", datetime(2022,  6, 22), 0.2530, 0.8685, 1.4656, 1.6127,   None, 0.1681, "v3.1.1"),
    ("0c2adf3e702b6427da946a6ba9dbedbea22738be", "0c2adf3e", datetime(2022,  9, 16), 0.2530, 0.8987, 1.4361, 1.5913,   None, 0.1502, "v3.2"),
    ("39c466000b1874e06a6f58da9c30bb877fc8d4d2", "39c46600", datetime(2022, 11, 20), 0.2565, 0.8817, 1.4675, 1.5750,   None, 0.1899, "v3.2.1"),
    ("8436fd78b002e5792f5d0dd1409332d171036d49", "8436fd78", datetime(2023,  2,  8), 0.2591, 0.8900, 1.4469, 1.5957,   None, 0.1905, "v3.2.2"),
    ("07a45b66c5facfea06c40bd82e34040c97560640", "07a45b66", datetime(2023,  2,  8), 0.2567, 0.8982, 1.4204, 1.6002,   None, 0.1972, "07a45b66"),
    ("1d84538c334a502c6ad7df48b8cc2309d6a6436d", "1d84538c", datetime(2023,  2, 22), 0.2581, 0.8890, 1.4295, 1.5990,   None, 0.0000, "1d84538c"),
    ("4d528a3d6456621a382d409b5145a877b5414b88", "4d528a3d", datetime(2023,  2, 23), 0.2559, 0.8990, 1.4357, 1.5741,   None, 0.0000, "4d528a3d"),
    ("8c637b36b66069b216cb94ae87d4c0a91e9b211e", "8c637b36", datetime(2023,  2, 27), 0.2810, 0.9040, 1.4509, 1.5997,   None, 0.0000, "8c637b36"),
    ("4d23fa6dd78d0497deb4fd62783f0b3ee4204579", "4d23fa6d", datetime(2023,  2, 27), 0.2791, 0.8976, 1.4459, 1.6015,   None, 0.0000, "4d23fa6d"),
    ("015f6874c320efee2c0d1ae76eea4a5b043d69d6", "015f6874", datetime(2023,  3,  1), 0.2748, 0.9155, 1.4673, 1.6185,   None, 0.0000, "015f6874"),
    ("26f06d449da208ce64724b1463b07ad20746cbdc", "26f06d44", datetime(2023,  3,  6), 0.2596, 0.8914, 1.4451, 1.5817,   None, 0.0000, "26f06d44"),
    ("6b9d6bb8bec6e3ea548f5858e2a8ea5986264fc8", "6b9d6bb8", datetime(2023,  3,  6), 0.2763, 0.9346, 1.4429, 1.6146,   None, 0.0000, "6b9d6bb8"),
    ("b796bd0fd92ba6b91d590f6cb60bb7ab3bca9932", "b796bd0f", datetime(2023,  3,  6), 0.2577, 0.8943, 1.4412, 1.5815,   None, 0.0000, "b796bd0f"),
    ("780aef7c7b4b9cafea3e323d536a34a4af5818b4", "780aef7c", datetime(2023,  3,  7), 0.2800, 0.9089, 1.4441, 1.6473,   None, 0.0000, "780aef7c"),
    ("9f93ad9bf85e4a0e6baf5b62ea4b3ef143729861", "9f93ad9b", datetime(2023,  3,  7), 0.2772, 0.9094, 1.4448, 1.6038,   None, 0.0000, "9f93ad9b"),
    ("16628a0ba45a675df762245694e0a7666a3478f8", "16628a0b", datetime(2023,  3,  7), 0.2783, 0.9229, 1.4380, 1.6209,   None, 0.1972, "v3.3"),
    ("01684c8559604344bd09791268131819a09770a8", "01684c85", datetime(2023,  3, 17), 0.2776, 0.8993, 1.4015, 1.6015,   None, 0.0000, "01684c85"),
    ("e9231fb893c765b723fa4c1e087a58761b6aa471", "e9231fb8", datetime(2023,  3, 20), 0.2792, 0.9129, 1.4589, 1.6123,   None, 0.0000, "e9231fb8"),
    ("219889e243ffc69c71b6f7747f5af751d5694de1", "219889e2", datetime(2023,  3, 23), 0.2796, 0.9035, 1.4460, 1.6019,   None, 0.0000, "219889e2"),
    ("6124d2a82a7a823722210bc2e8516d355ba19eb3", "6124d2a8", datetime(2023,  4,  5), 0.2743, 0.9138, 1.4387, 1.6348,   None, 0.0000, "6124d2a8"),
    ("f6e4287f712cc866893e71b1ea7a7546e4567bf9", "f6e4287f", datetime(2023,  4, 25), 0.2848, 0.9328, 1.4832, 1.6151,   None, 0.0000, "f6e4287f"),
    ("f2797fef396f2f19b02abb1f9555b678dac614f1", "f2797fef", datetime(2023,  4, 25), 0.2841, 0.8983, 1.4436, 1.6241,   None, 0.0000, "f2797fef"),
    ("b4e538f530048fec58eaca5170be82c67dbdcceb", "b4e538f5", datetime(2023,  4, 25), 0.2843, 0.9398, 1.4327, 1.6110,   None, 0.0000, "b4e538f5"),
    ("68820b715ed6b2c981aa11d29c0102e879280d79", "68820b71", datetime(2023,  4, 25), 0.2827, 0.9047, 1.4177, 1.6138,   None, 0.0000, "68820b71"),
    ("03deffeda91fa8d8ab188d57b9fa302a7be008e0", "03deffed", datetime(2023,  4, 25), 0.2876, 0.9326, 1.4489, 1.6300,   None, 0.0000, "03deffed"),
    ("0d2bfecc271d561f67050659684b4797af8ee740", "0d2bfecc", datetime(2023,  4, 25), 0.2850, 0.9106, 1.4703, 1.6243,   None, 0.0000, "0d2bfecc"),
    ("1d03a465593f56c99a64a576d185d4ed17b659f2", "1d03a465", datetime(2023,  4, 25), 0.2815, 0.9434, 1.4612, 1.6289,   None, 0.0000, "1d03a465"),
    ("78a953b7ef9a36b62e5b446c80ed68abfddbfb74", "78a953b7", datetime(2023,  5,  4), 0.2833, 0.9133, 1.4659, 1.6043,   None, 0.0000, "78a953b7"),
    ("6c4f70ffbf3d4d2922d41d0032ae1b93d8a23c99", "6c4f70ff", datetime(2023,  5,  4), 0.2860, 0.9320, 1.4547, 1.6125,   None, 0.0000, "6c4f70ff"),
    ("ab03282623d0262b20b8c132efcdcace2dace766", "ab032826", datetime(2023,  5,  6), 0.2626, 0.9049, 1.4338, 1.5987,   None, 0.0000, "ab032826"),
    ("d2f7a45af27a6b40027d6f6a0f4f0be0c6dee5d9", "d2f7a45a", datetime(2023,  5,  6), 0.2642, 0.8965, 1.4448, 1.6021,   None, 0.0000, "d2f7a45a"),
    ("98b23f3d517481b127f190f5f8b7ebfae7f8b6b2", "98b23f3d", datetime(2023,  5,  6), 0.2642, 0.9005, 1.4380, 1.6125,   None, 0.0000, "98b23f3d"),
    ("452425de723cc1640d999022389672caf9bffbd0", "452425de", datetime(2023,  5,  6), 0.2620, 0.8872, 1.4365, 1.5974,   None, 0.0000, "452425de"),
    ("85dadb1a566c9fa8dc84cb9837b98bd5d23b8d58", "85dadb1a", datetime(2023,  5,  7), 0.2625, 0.8963, 1.4596, 1.5926,   None, 0.0000, "85dadb1a"),
    ("432ee7f96c1f6cccd05a0034c86c720cdb63a3e6", "432ee7f9", datetime(2023,  5, 10), 0.2620, 0.9114, 1.4454, 1.5992,   None, 0.0000, "432ee7f9"),
    ("ebd70ecaef14c0e239337eb6e36506303378a31a", "ebd70eca", datetime(2023,  5, 10), 0.2614, 0.8961, 1.4696, 1.5936, 0.4682, 0.5035, "ebd70eca"),
    ("77fa7155d55bdf3fd43e29f58fe57feffcb107cf", "77fa7155", datetime(2023,  5, 11), 0.2609, 0.8973, 1.4581, 1.5754, 0.4617, 0.5110, "77fa7155"),
    ("d5d4b1346bd6acba9ba41b4bf546640de162a9d6", "d5d4b134", datetime(2023,  5, 12), 0.2640, 0.9075, 1.4284, 1.5979, 0.4633, 0.5059, "d5d4b134"),
    ("d5d4b1346bd6acba9ba41b4bf546640de162a9d6", "d5d4b134", datetime(2023,  5, 16), 0.2635, 0.9001, 1.4436, 1.6057, 0.4657, 0.5079, "d5d4b134"),
    ("7c879f1ce18b52d9b0a8eecf877d03e66afc975b", "7c879f1c", datetime(2023,  5, 16), 0.2581, 0.8933, 1.4327, 1.5980, 0.4616, 0.5055, "7c879f1c"),
    ("2aa9f2a55686f2ee5dc407e8e0223eb25176d906", "2aa9f2a5", datetime(2023,  5, 16), 0.2593, 0.8931, 1.4259, 1.5919, 0.4695, 0.5126, "2aa9f2a5"),
    ("5e5bb7f4e653621e7a81ff4bcaa27dbc1f759de7", "5e5bb7f4", datetime(2023,  5, 16), 0.2587, 0.8928, 1.4375, 1.6036, 0.4622, 0.4990, "v3.4"),
    ("d91953a499dfb88b457a1e7a07903debbda4058b", "d91953a4", datetime(2023,  6,  1), 0.2581, 0.9035, 1.4097, 1.5775, 0.4596, 0.4933, "d91953a4"),
    ("76742879c81c9baced49b9fc60abbf1d2eba65ff", "76742879", datetime(2023,  7,  3), 0.2586, 0.8874, 1.4236, 1.5793, 0.4638, 0.5071, "76742879"),
    ("9c73a41eaca95bb718ac79980a1799dfa1c48cf3", "9c73a41e", datetime(2023,  7,  6), 0.2604, 0.8756, 1.4599, 1.5973, 0.4620, 0.5062, "9c73a41e"),
    ("67104dd714de939be136646af68edd9643ddfcd3", "67104dd7", datetime(2023,  7,  6), 0.2961, 0.8385, 1.0538, 1.2883, 0.4449, 0.4809, "67104dd7"),
    ("e6906feebdee6bdd2103f0bd390679e6a1b0052d", "e6906fee", datetime(2023,  7,  7), 0.2968, 0.8683, 1.0873, 1.3051, 0.4458, 0.4905, "e6906fee"),
    ("8908ab47eaa8a3d7e7c9126484b524f751e41f55", "8908ab47", datetime(2023,  7, 10), 0.3004, 0.8745, 1.0658, 1.3015, 0.4201, 0.4704, "8908ab47"),
    ("063d8b58464f95520c9887ac4f575e6c1f6880d8", "063d8b58", datetime(2023,  7, 11), 0.2950, 0.8499, 1.0818, 1.3194, 0.4436, 0.4904, "063d8b58"),
    ("59e53a66aef134a3c9e912f9468ca667b599d4e5", "59e53a66", datetime(2023,  7, 27), 0.2570, 0.8940, 1.4638, 1.5852, 0.4610, 0.0000, "59e53a66"),
    ("cd14608474be8561c188d2aa7a772b8ac753fb70", "cd146084", datetime(2023,  8,  3), 0.2929, 0.8472, 1.0517, 1.3088, 0.4412, 0.0000, "cd146084"),
    ("db958c4b779ffc825689e052958020864cbcde63", "db958c4b", datetime(2023,  8, 15), 0.2973, 0.8448, 1.0831, 1.3129, 0.4524, 0.0000, "db958c4b"),
    ("8ece0f5f7d3bfd66f4f83198debf5627344af534", "8ece0f5f", datetime(2023,  8, 15), 0.2950, 0.8523, 1.0711, 1.2952, 0.4443, 0.0000, "8ece0f5f"),
    ("77ea50d9bd5d01f7110dbebf1ba689a25eee9d96", "77ea50d9", datetime(2023,  9, 11), 0.2951, 0.8540, 1.0803, 1.3073, 0.4500, 0.0000, "77ea50d9"),
    ("05b900c228d427bfa8e531527b546cdeb822cfc9", "05b900c2", datetime(2023, 10,  4), 0.2959, 0.8493, 1.0648, 1.3043, 0.4433, 0.0000, "05b900c2"),
    ("2dccbbd0ca67a274a2aeb9996f262014b3137fc0", "2dccbbd0", datetime(2023, 10, 20), 0.2971, 0.8566, 1.0850, 1.3278, 0.4528, 0.0000, "2dccbbd0"),
    ("e9c90aa521917e587dd9497d529822f359eec3e2", "e9c90aa5", datetime(2023, 10, 26), 0.2974, 0.8744, 1.0303, 1.2821, 0.4258, 0.0000, "e9c90aa5"),
    ("6c3ddb48b59d286899a8efd5989d741f86c4ade3", "6c3ddb48", datetime(2023, 10, 26), 0.2926, 0.8601, 1.0816, 1.3190, 0.4490, 0.0000, "6c3ddb48"),
    ("31fe1b69ff863f0a610aec5b22424382ec3cc933", "31fe1b69", datetime(2023, 10, 26), 0.2932, 0.8508, 1.0795, 1.3307, 0.4524, 0.0000, "v3.5"),
]

df = pd.DataFrame(data=data, columns=columns)
data_source = ColumnDataSource(df)
Loading BokehJS ...
Hide code cell source
## Run-time performance

hover_tool = HoverTool(
    tooltips=[
        # ("index", "$index"),
        ("git ref", "@tooltip_label"),
        # ("date", "@date"),
    ],
    # formatters={
    #     '@date': 'datetime',
    # },
)
p = figure(
    title="5x5 Wind Farm Timing Test",
    x_axis_type="datetime",
    tooltips=hover_tool.tooltips,
    width=600,
    height=450
)


p.line("date", "jensen", source=data_source, color=COLORS[0], legend_label="jensen")
p.circle("date", "jensen", source=data_source, line_color=COLORS[0], fill_color=COLORS[0], size=6, legend_label="jensen")
p.line("date", "gauss", source=data_source, color=COLORS[1], legend_label="gauss")
p.circle("date", "gauss", source=data_source, line_color=COLORS[1], fill_color=COLORS[1], size=6, legend_label="gauss")
p.line("date", "gch", source=data_source, color=COLORS[2], legend_label="gch")
p.circle("date", "gch", source=data_source, line_color=COLORS[2], fill_color=COLORS[2], size=6, legend_label="gch")
p.line("date", "cc", source=data_source, color=COLORS[3], legend_label="cc")
p.circle("date", "cc", source=data_source, line_color=COLORS[3], fill_color=COLORS[3], size=6, legend_label="cc")
p.line("date", "emgauss", source=data_source, color=COLORS[4], legend_label="cc")
p.circle("date", "emgauss", source=data_source, line_color=COLORS[4], fill_color=COLORS[4], size=6, legend_label="empirical gauss")

p.xaxis.axis_label = "Commit date"
p.yaxis.axis_label = "Time to solution (s)"

p.legend.location = "bottom_left"
p.legend.click_policy="mute"
p.legend.border_line_width = 1
p.legend.border_line_color = "black"
p.legend.border_line_alpha = 0.5

show(p)
Hide code cell source
## Test coverage

p = figure(
    title="Code Coverage",
    x_axis_type="datetime",
    tooltips=[("git ref", "@tooltip_label")],
    width=600,
    height=450
)

p.line("date", "code_coverage", source=data_source, color=COLORS[0])
p.circle("date", "code_coverage", source=data_source, line_color=COLORS[0], fill_color=COLORS[0], size=6)

p.xaxis.axis_label = "Commit date"
p.yaxis.axis_label = "Test coverage as a percentage of Python code"
p.y_range = Range1d(0, 1.0)

show(p)