Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,11 +17,11 @@ def compute(lang):
|
|
17 |
report = f"## Summary:\n\n The `{lang}` language has {df_lang_uniq.shape[0]} extensions: \n\n"
|
18 |
|
19 |
for i, (ext, ext_fraction, gen_fraction, vend_fraction) in enumerate(zip(df_lang_uniq["extension"], df_lang_uniq["ext_fraction_per_lang"], df_lang_uniq["generated_fraction"], df_lang_uniq["vendor_fraction"])):
|
20 |
-
fractions_string = f"{ext_fraction*100:.2f}%"
|
21 |
-
if gen_fraction > 0.
|
22 |
-
fractions_string += f", autogenerated: {gen_fraction*100:.2f}%"
|
23 |
-
if vend_fraction > 0.
|
24 |
-
fractions_string += f", vendor files: {vend_fraction*100:.2f}%"
|
25 |
|
26 |
report += f"`{ext}` ({fractions_string}), \n\n"
|
27 |
report = report[:-2] + "\n\n\n\n"
|
|
|
17 |
report = f"## Summary:\n\n The `{lang}` language has {df_lang_uniq.shape[0]} extensions: \n\n"
|
18 |
|
19 |
for i, (ext, ext_fraction, gen_fraction, vend_fraction) in enumerate(zip(df_lang_uniq["extension"], df_lang_uniq["ext_fraction_per_lang"], df_lang_uniq["generated_fraction"], df_lang_uniq["vendor_fraction"])):
|
20 |
+
fractions_string = f"{max(ext_fraction, 1)*100:.2f}%"
|
21 |
+
if gen_fraction > 0.2:
|
22 |
+
fractions_string += f", autogenerated: {max(gen_fraction, 1)*100:.2f}%"
|
23 |
+
if vend_fraction > 0.2:
|
24 |
+
fractions_string += f", vendor files: {max(vend_fraction, 1)*100:.2f}%"
|
25 |
|
26 |
report += f"`{ext}` ({fractions_string}), \n\n"
|
27 |
report = report[:-2] + "\n\n\n\n"
|