Skip to content

Commit 88d0ddb

Browse files
committed
feat: add uml diagrams
Signed-off-by: Vimal Kumar <[email protected]>
1 parent ca9e4d7 commit 88d0ddb

File tree

17 files changed

+1243
-0
lines changed

17 files changed

+1243
-0
lines changed

docs/developer/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### 0. Temporarily add `__init__.py` to all directories
2+
3+
```
4+
find ./src -type d -exec touch {}/__init__.py \;
5+
```
6+
7+
### 1. Generate `classes.plantuml` and `packages.plantuml` using the following commands
8+
```
9+
pyreverse --colorized --output plantuml --module-names y --show-stdlib --show-associated 2 --show-ancestors 1 --verbose -d umls/server/ --source-roots ./src/ ./src/server/
10+
pyreverse --colorized --output plantuml --module-names y --show-stdlib --show-associated 2 --show-ancestors 1 --verbose -d umls/estimate/ --source-roots ./src/ ./src/estimate/
11+
pyreverse --colorized --output plantuml --module-names y --show-stdlib --show-associated 2 --show-ancestors 1 --verbose -d umls/train/ --source-roots ./src/ ./src/train/
12+
pyreverse --colorized --output plantuml --module-names y --show-stdlib --show-associated 2 --show-ancestors 1 --verbose -d umls/train/trainer/ --source-roots ./src/ ./src/train/trainer/
13+
```
14+
15+
### 2. Use [plantuml](https://plantuml.com/download) to convert planuml files to `svg` files
16+
NeoVim plugin `neovim-soil` was used to generate svg files from plantuml files
Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
@startuml classes
2+
set namespaceSeparator none
3+
class "._SpecialForm" as ._SpecialForm #44BB99 {
4+
}
5+
class "_socket.socket" as _socket.socket #grey {
6+
{abstract}bind()
7+
{abstract}close()
8+
{abstract}connect()
9+
{abstract}connect_ex()
10+
{abstract}detach()
11+
{abstract}fileno()
12+
{abstract}getblocking()
13+
{abstract}getpeername()
14+
{abstract}getsockname()
15+
{abstract}getsockopt()
16+
{abstract}gettimeout()
17+
{abstract}listen()
18+
{abstract}recv()
19+
{abstract}recv_into()
20+
{abstract}recvfrom()
21+
{abstract}recvfrom_into()
22+
{abstract}recvmsg()
23+
{abstract}recvmsg_into()
24+
{abstract}send()
25+
{abstract}sendall()
26+
{abstract}sendmsg()
27+
{abstract}sendmsg_afalg()
28+
{abstract}sendto()
29+
{abstract}setblocking()
30+
{abstract}setsockopt()
31+
{abstract}settimeout()
32+
{abstract}shutdown()
33+
}
34+
class "estimate.estimator.EstimatorServer" as estimate.estimator.EstimatorServer #77AADD {
35+
socket
36+
socket_path
37+
accepted(connection)
38+
start()
39+
}
40+
class "estimate.estimator.PowerRequest" as estimate.estimator.PowerRequest #77AADD {
41+
datapoint
42+
energy_source
43+
filter : str
44+
metrics
45+
output_type
46+
system_features
47+
trainer_name : str
48+
}
49+
class "estimate.model.curvefit_model.CurveFitModel" as estimate.model.curvefit_model.CurveFitModel #99DDFF {
50+
comp_type
51+
fe_list : list
52+
features
53+
feauture_group
54+
model
55+
models : dict
56+
name
57+
output_type
58+
get_power(request)
59+
}
60+
class "estimate.model.keras_model.KerasModel" as estimate.model.keras_model.KerasModel #99DDFF {
61+
comp_type
62+
fe_list : list
63+
features
64+
model
65+
models : dict
66+
name
67+
output_type
68+
get_power(request)
69+
}
70+
class "estimate.model.model.Model" as estimate.model.model.Model #99DDFF {
71+
abs_mae : NoneType
72+
abs_mae_val : NoneType
73+
abs_max_corr : NoneType
74+
abs_model : NoneType
75+
abs_mse : NoneType
76+
abs_mse_val : NoneType
77+
avg_mae : NoneType
78+
estimator
79+
mae : NoneType
80+
mae_val : NoneType
81+
mape : NoneType
82+
model_name
83+
mse : NoneType
84+
mse_val : NoneType
85+
reconstructed_mae : NoneType
86+
reconstructed_mse : NoneType
87+
append_prediction(data, predicted_col_func)
88+
feature_check(features)
89+
get_power(data)
90+
is_valid_model(filters)
91+
print_log(message)
92+
}
93+
class "estimate.model.scikit_model.ScikitModel" as estimate.model.scikit_model.ScikitModel #99DDFF {
94+
comp_type
95+
fe_list : list
96+
features
97+
model
98+
models : dict
99+
name
100+
output_type
101+
get_power(request)
102+
}
103+
class "estimate.model.xgboost_model.XgboostModel" as estimate.model.xgboost_model.XgboostModel #99DDFF {
104+
comp_type
105+
fe_list : list
106+
features
107+
model
108+
models : dict
109+
name
110+
output_type
111+
get_power(request)
112+
}
113+
class "pandas.core.accessor.CachedAccessor" as pandas.core.accessor.CachedAccessor #BBCC33 {
114+
}
115+
class "pandas.core.arraylike.OpsMixin" as pandas.core.arraylike.OpsMixin #BBCC33 {
116+
}
117+
class "pandas.core.base.IndexOpsMixin" as pandas.core.base.IndexOpsMixin #BBCC33 {
118+
T
119+
array
120+
dtype
121+
empty
122+
is_monotonic
123+
is_monotonic_decreasing
124+
is_monotonic_increasing
125+
is_unique
126+
nbytes
127+
ndim
128+
shape
129+
size
130+
to_list
131+
}
132+
class "pandas.core.base.PandasObject" as pandas.core.base.PandasObject #BBCC33 {
133+
}
134+
class "pandas.core.frame.DataFrame" as pandas.core.frame.DataFrame #BBCC33 {
135+
T
136+
agg
137+
axes
138+
boxplot
139+
columns
140+
hist
141+
index
142+
name
143+
plot
144+
shape
145+
sparse
146+
style
147+
values
148+
}
149+
class "pandas.core.generic.NDFrame" as pandas.core.generic.NDFrame #BBCC33 {
150+
attrs
151+
axes
152+
backfill
153+
dtypes
154+
empty
155+
flags
156+
index
157+
kurtosis
158+
ndim
159+
pad
160+
product
161+
shape
162+
size
163+
values
164+
}
165+
class "pandas.core.indexes.base.Index" as pandas.core.indexes.base.Index #BBCC33 {
166+
asi8
167+
get_level_values
168+
has_duplicates
169+
is_monotonic
170+
is_monotonic_decreasing
171+
is_monotonic_increasing
172+
isnull
173+
name
174+
names : property
175+
nlevels
176+
notnull
177+
shape
178+
str
179+
values
180+
}
181+
class "pandas.core.indexes.multi.MultiIndex" as pandas.core.indexes.multi.MultiIndex #BBCC33 {
182+
array
183+
codes
184+
levshape
185+
lexsort_depth
186+
names : property
187+
nlevels
188+
rename
189+
sortorder : int | None
190+
values
191+
}
192+
class "pandas.core.indexes.range.RangeIndex" as pandas.core.indexes.range.RangeIndex #BBCC33 {
193+
dtype
194+
inferred_type
195+
is_unique
196+
size
197+
start
198+
step
199+
stop
200+
}
201+
class "sklearn.base.RegressorMixin" as sklearn.base.RegressorMixin #AAAA00 {
202+
score(X, y, sample_weight)
203+
}
204+
class "socket.socket" as socket.socket #grey {
205+
family
206+
type
207+
accept()
208+
close()
209+
detach()
210+
dup()
211+
get_inheritable()
212+
makefile(mode, buffering)
213+
sendfile(file, offset, count)
214+
set_inheritable(inheritable)
215+
}
216+
class "xgboost.core.Booster" as xgboost.core.Booster #EEDD88 {
217+
best_iteration
218+
best_score
219+
feature_names
220+
feature_types
221+
handle : NoneType, Optional[ctypes.c_void_p]
222+
}
223+
class "xgboost.sklearn.XGBModel" as xgboost.sklearn.XGBModel #EEDD88 {
224+
base_score : Optional[float]
225+
best_iteration
226+
best_score
227+
booster : Optional[str]
228+
callbacks : Optional[List[TrainingCallback]]
229+
coef_
230+
colsample_bylevel : Optional[float]
231+
colsample_bynode : Optional[float]
232+
colsample_bytree : Optional[float]
233+
device : Optional[str]
234+
early_stopping_rounds : Optional[int]
235+
enable_categorical : bool
236+
eval_metric : Optional[Union[str, List[str], Callable]]
237+
evals_result_
238+
feature_importances_
239+
feature_names_in_
240+
feature_types : Optional[FeatureTypes]
241+
gamma : Optional[float]
242+
grow_policy : Optional[str]
243+
importance_type : Optional[str]
244+
interaction_constraints : Optional[Union[str, Sequence[Sequence[str]]]]
245+
intercept_
246+
kwargs : dict
247+
learning_rate : Optional[float]
248+
max_bin : Optional[int]
249+
max_cat_threshold : Optional[int]
250+
max_cat_to_onehot : Optional[int]
251+
max_delta_step : Optional[float]
252+
max_depth : Optional[int]
253+
max_leaves : Optional[int]
254+
min_child_weight : Optional[float]
255+
missing : float
256+
monotone_constraints : Optional[Union[Dict[str, int], str]]
257+
multi_strategy : Optional[str]
258+
n_estimators : Optional[int]
259+
n_features_in_
260+
n_jobs : Optional[int]
261+
num_parallel_tree : Optional[int]
262+
objective : Optional[SklObjective]
263+
random_state : Optional[Union[np.random.RandomState, int]]
264+
reg_alpha : Optional[float]
265+
reg_lambda : Optional[float]
266+
sampling_method : Optional[str]
267+
scale_pos_weight : Optional[float]
268+
subsample : Optional[float]
269+
tree_method : Optional[str]
270+
validate_parameters : Optional[bool]
271+
verbosity : Optional[int]
272+
}
273+
class "xgboost.sklearn.XGBRegressor" as xgboost.sklearn.XGBRegressor #EEDD88 {
274+
}
275+
pandas.core.base.IndexOpsMixin --|> pandas.core.arraylike.OpsMixin
276+
pandas.core.frame.DataFrame --|> pandas.core.arraylike.OpsMixin
277+
pandas.core.frame.DataFrame --|> pandas.core.generic.NDFrame
278+
pandas.core.generic.NDFrame --|> pandas.core.base.PandasObject
279+
pandas.core.indexes.base.Index --|> pandas.core.base.IndexOpsMixin
280+
pandas.core.indexes.base.Index --|> pandas.core.base.PandasObject
281+
pandas.core.indexes.multi.MultiIndex --|> pandas.core.indexes.base.Index
282+
socket.socket --|> _socket.socket
283+
xgboost.sklearn.XGBRegressor --|> sklearn.base.RegressorMixin
284+
xgboost.sklearn.XGBRegressor --|> xgboost.sklearn.XGBModel
285+
_socket.socket --* estimate.estimator.EstimatorServer : socket
286+
pandas.core.accessor.CachedAccessor --* pandas.core.frame.DataFrame : plot
287+
pandas.core.accessor.CachedAccessor --* pandas.core.frame.DataFrame : sparse
288+
pandas.core.accessor.CachedAccessor --* pandas.core.indexes.base.Index : str
289+
pandas.core.frame.DataFrame --* estimate.estimator.PowerRequest : datapoint
290+
pandas.core.frame.DataFrame --* pandas.core.frame.DataFrame : index
291+
pandas.core.indexes.base.Index --* pandas.core.frame.DataFrame : columns
292+
pandas.core.indexes.base.Index --* pandas.core.frame.DataFrame : columns
293+
pandas.core.indexes.base.Index --* pandas.core.frame.DataFrame : index
294+
pandas.core.indexes.base.Index --* pandas.core.frame.DataFrame : index
295+
pandas.core.indexes.multi.MultiIndex --* pandas.core.frame.DataFrame : index
296+
pandas.core.indexes.range.RangeIndex --* pandas.core.frame.DataFrame : index
297+
pandas.core.indexes.range.RangeIndex --* pandas.core.generic.NDFrame : index
298+
socket.socket --* estimate.estimator.EstimatorServer : socket
299+
xgboost.core.Booster --* xgboost.sklearn.XGBModel : _Booster
300+
xgboost.sklearn.XGBRegressor --* estimate.model.xgboost_model.XgboostModel : model
301+
@enduml

docs/developer/estimate/classes.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@startuml packages
2+
set namespaceSeparator none
3+
package "estimate" as estimate #77AADD {
4+
}
5+
package "estimate.archived_model" as estimate.archived_model #77AADD {
6+
}
7+
package "estimate.estimator" as estimate.estimator #77AADD {
8+
}
9+
package "estimate.model" as estimate.model #99DDFF {
10+
}
11+
package "estimate.model.curvefit_model" as estimate.model.curvefit_model #99DDFF {
12+
}
13+
package "estimate.model.estimate_common" as estimate.model.estimate_common #99DDFF {
14+
}
15+
package "estimate.model.keras_model" as estimate.model.keras_model #99DDFF {
16+
}
17+
package "estimate.model.model" as estimate.model.model #99DDFF {
18+
}
19+
package "estimate.model.scikit_model" as estimate.model.scikit_model #99DDFF {
20+
}
21+
package "estimate.model.xgboost_model" as estimate.model.xgboost_model #99DDFF {
22+
}
23+
package "estimate.model_server_connector" as estimate.model_server_connector #77AADD {
24+
}
25+
estimate --> estimate.model
26+
estimate.archived_model --> estimate.model_server_connector
27+
estimate.estimator --> estimate.archived_model
28+
estimate.estimator --> estimate.model
29+
estimate.estimator --> estimate.model_server_connector
30+
estimate.model.curvefit_model --> estimate.model.estimate_common
31+
estimate.model.keras_model --> estimate.model.estimate_common
32+
estimate.model.model --> estimate.model.curvefit_model
33+
estimate.model.model --> estimate.model.scikit_model
34+
estimate.model.model --> estimate.model.xgboost_model
35+
estimate.model.scikit_model --> estimate.model.estimate_common
36+
estimate.model.xgboost_model --> estimate.model.estimate_common
37+
@enduml

0 commit comments

Comments
 (0)