REFACTOR:

Fitter class refactored. Include getter and setter
ADD:
test/ dir with code tests
This commit is contained in:
2026-04-08 21:48:19 -03:00
parent bcd8f25a62
commit d053ebf02c
5 changed files with 529 additions and 291 deletions

View File

@@ -21,13 +21,16 @@ def stacked_plot(data):
data = np.squeeze(data)
mean_dp = np.mean(np.abs(data), axis=1)
fig = make_subplots(rows=2, cols=1, row_heights=[0.3, 0.7], shared_xaxes=True,
vertical_spacing=0.01)
fig = make_subplots(
rows=2, cols=1, row_heights=[0.3, 0.7], shared_xaxes=True, vertical_spacing=0.01
)
fig.add_trace(go.Scatter(y=mean_dp, name='Mean Power'), row=1, col=1)
fig.add_trace(go.Heatmap(z=np.abs(data).T, showscale=False, name='Heat Map'), row=2, col=1)
fig.add_trace(go.Scatter(y=mean_dp, name="Mean Power"), row=1, col=1)
fig.add_trace(
go.Heatmap(z=np.abs(data).T, showscale=False, name="Heat Map"), row=2, col=1
)
fig.update_layout(title='Mean DP Power and 2D Map', autosize=True)
fig.update_layout(title="Mean DP Power and 2D Map", autosize=True)
fig.update_xaxes(visible=False, row=2, col=1)
fig.update_yaxes(visible=False, row=2, col=1)
@@ -98,6 +101,8 @@ def plot_cdfs(data_list, labels):
fig = go.Figure()
for data, label in zip(data_list, labels):
sorted_data, cdf = calculate_cdf(data)
fig.add_trace(go.Scatter(x=sorted_data, y=cdf, mode='lines', name=label))
fig.update_layout(title='CDF of Data', xaxis_title='Value', yaxis_title='CDF', autosize=True)
fig.add_trace(go.Scatter(x=sorted_data, y=cdf, mode="lines", name=label))
fig.update_layout(
title="CDF of Data", xaxis_title="Value", yaxis_title="CDF", autosize=True
)
return fig