craceplot 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. craceplot/__init__.py +60 -0
  2. craceplot/_containers/__init__.py +0 -0
  3. craceplot/_containers/_core.py +1602 -0
  4. craceplot/_containers/_draw.py +104 -0
  5. craceplot/_inst/examples/acotsp/crace-3240078.stdout +838 -0
  6. craceplot/_inst/examples/acotsp/crace.stderr +8 -0
  7. craceplot/_inst/examples/acotsp/crace.test +216 -0
  8. craceplot/_inst/examples/acotsp/crace.train +622 -0
  9. craceplot/_inst/examples/cats200/crace-2814581.stdout +1665 -0
  10. craceplot/_inst/examples/cats200/crace.stderr +10 -0
  11. craceplot/_inst/examples/cats200/crace.test +1010 -0
  12. craceplot/_inst/examples/cats200/crace.train +655 -0
  13. craceplot/_plots/__init__.py +8 -0
  14. craceplot/_plots/_core.py +80 -0
  15. craceplot/_plots/parameters.py +1805 -0
  16. craceplot/_plots/quality.py +1406 -0
  17. craceplot/_scripts/__init__.py +4 -0
  18. craceplot/_scripts/_main.py +132 -0
  19. craceplot/_scripts/_utils.py +66 -0
  20. craceplot/_scripts/main +3 -0
  21. craceplot/_scripts/open_guide +12 -0
  22. craceplot/_settings/_description.py +168 -0
  23. craceplot/_settings/_options.json +299 -0
  24. craceplot/_utils/__init__.py +0 -0
  25. craceplot/_utils/_base.py +196 -0
  26. craceplot/_utils/_const.py +8 -0
  27. craceplot/_utils/_crace.py +42 -0
  28. craceplot/_utils/_format.py +191 -0
  29. craceplot/_vergit.py +2 -0
  30. craceplot/_version.py +24 -0
  31. craceplot/_vignettes/guide.ipynb +18943 -0
  32. craceplot-0.1.0.dist-info/METADATA +369 -0
  33. craceplot-0.1.0.dist-info/RECORD +61 -0
  34. craceplot-0.1.0.dist-info/WHEEL +5 -0
  35. craceplot-0.1.0.dist-info/entry_points.txt +2 -0
  36. craceplot-0.1.0.dist-info/licenses/LICENSE.md +21 -0
  37. craceplot-0.1.0.dist-info/top_level.txt +2 -0
  38. docs/_config.yml +51 -0
  39. docs/_static/css/custom.css +168 -0
  40. docs/_static/js/navbar.js +40 -0
  41. docs/_toc.yml +5 -0
  42. docs/index.md +4 -0
  43. docs/references/404.md +14 -0
  44. docs/references/authors.md +46 -0
  45. docs/references/citiation.bib +17 -0
  46. docs/references/functions/index.md +5 -0
  47. docs/references/functions/param_boxplot.ipynb +19 -0
  48. docs/references/index.md +44 -0
  49. docs/references/license.md +21 -0
  50. docs/references/others/favicon.ico +0 -0
  51. docs/references/others/favicon_io/about.txt +6 -0
  52. docs/references/others/favicon_io/android-chrome-192x192.png +0 -0
  53. docs/references/others/favicon_io/android-chrome-512x512.png +0 -0
  54. docs/references/others/favicon_io/apple-touch-icon.png +0 -0
  55. docs/references/others/favicon_io/favicon-16x16.png +0 -0
  56. docs/references/others/favicon_io/favicon-32x32.png +0 -0
  57. docs/references/others/favicon_io/site.webmanifest +1 -0
  58. docs/references/others/logo.png +0 -0
  59. docs/references/others/logo1.png +0 -0
  60. docs/references/plots/acotsp-parallelcoord-all.png +0 -0
  61. docs/requirements.txt +5 -0
@@ -0,0 +1,8 @@
1
+ # craceplot._plot.__init__.py
2
+
3
+ from .parameters import *
4
+ from .parameters import __all__ as _p_all
5
+ from .quality import *
6
+ from .quality import __all__ as _q_all
7
+
8
+ __all__ = [*_p_all, *_q_all]
@@ -0,0 +1,80 @@
1
+ import pandas as pd
2
+
3
+ # __all__ = ['bold', 'underline', 'reset', 'register', 'enforce_types', 'add_slice', 'add_ins', 'safe_copy']
4
+
5
+ def init_plot_style(size=1.0):
6
+ import matplotlib as mpl
7
+ import seaborn as sns
8
+
9
+ mpl.rcdefaults()
10
+ sns.set_theme(
11
+ style="white",
12
+ context="paper",
13
+ font_scale=size,
14
+ rc={
15
+ # "font.size": size,
16
+ "axes.grid": True,
17
+ "axes.facecolor": "white",
18
+ "figure.facecolor": "white",
19
+ "savefig.facecolor": "white",
20
+ "axes.edgecolor": "black",
21
+ "xtick.color": "black",
22
+ "ytick.color": "black",
23
+ }
24
+ )
25
+
26
+ def add_elites(data: pd.DataFrame, slice: pd.DataFrame, final: list, select: list=None):
27
+ """add slice information to selected data"""
28
+ new = pd.DataFrame()
29
+ tmp = []
30
+
31
+ if select is None:
32
+ if 'elites' not in slice.columns.values:
33
+ print("'slice' object has no attribute 'elites'")
34
+ return data
35
+
36
+ for idx, row in enumerate(slice.itertuples(), start=1):
37
+ sel = data[
38
+ data['configuration_id'].isin(row.elites) &
39
+ (data['end_time'] <= row.end_time)
40
+ ].copy()
41
+ sel['slice_elites'] = idx
42
+ tmp.append(sel)
43
+
44
+ last_end_time = slice.iloc[-1].end_time
45
+ last_idx = idx + 1
46
+ last = data[
47
+ data['configuration_id'].isin(final) &
48
+ (data['end_time'] > last_end_time)
49
+ ].copy()
50
+ last['slice_elites'] = last_idx
51
+ tmp.append(last)
52
+
53
+ else:
54
+ for idx, group in enumerate(select, start=1):
55
+ if isinstance(group, int): group = [group]
56
+ for cid in group:
57
+ sel = data.loc[data['configuration_id'] == cid].copy()
58
+ sel['group'] = idx
59
+ tmp.append(sel)
60
+
61
+ new = pd.concat(tmp, ignore_index=True)
62
+ return new
63
+
64
+ def add_ins(data: pd.DataFrame):
65
+ """add ins information to selected data"""
66
+
67
+ n_ins = data.groupby(['configuration_id']).size().reset_index(name='n_ins')
68
+ new = data[['configuration_id']].drop_duplicates()
69
+ new = pd.merge(new, n_ins, on=['configuration_id'], how='left')
70
+
71
+ return new
72
+
73
+ def add_best(data: pd.DataFrame):
74
+ """add minimal quality for each instance based on all configurations"""
75
+ sel_data = data[['configuration_id', 'instance_id', 'quality']].dropna()
76
+ min_qual = sel_data.groupby(['instance_id'], as_index=False).min()
77
+ min_qual['configuration_id']=0
78
+ new = pd.concat([sel_data, min_qual], ignore_index=True)
79
+
80
+ return new