Skip to content

Analyza#5

Open
Alevember wants to merge 4 commits intomainfrom
analyza
Open

Analyza#5
Alevember wants to merge 4 commits intomainfrom
analyza

Conversation

@Alevember
Copy link
Copy Markdown
Collaborator

zadani 24.03

@@ -1,17 +1,14 @@
import marimo
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename marimo ntb to : scalar_field_diff.py

for i in range(grid_size):
for j in range(grid_size):
# Booleovská maska pro výběr bodů, které spadají přesně do aktuálního čtverce (okna)
mask = (x >= i*dx) & (x < (i+1)*dx) & (y >= j*dy) & (y < (j+1)*dy)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make function for this kind of mask.


# Refaktorovat kód -> výpočty a složitější grafy do samostatného modulu/ modulů.

class MeanCalculator:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move ploting functions to separate file plots.py

return plot1 + plot2

def multiscale_analysis(x: np.ndarray, y: np.ndarray, q_a_vals: np.ndarray, q_b_vals: np.ndarray) -> Tuple[plt.Figure, plt.Figure]:
grid_sizes = [2, 4, 8]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REmove, with replacement of matplotlib plots.


# Refaktorovat kód -> výpočty a složitější grafy do samostatného modulu/ modulů.

class MeanCalculator:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create three classes one for each mean type with common interface:

@DataClass
class Geometric:
name: str

 def mean(X):
          return ....

# … přepínání typu průměru
grid_slider = mo.ui.slider(start=2, stop=30, step=2, value=10, label="Velikost buněk (interaktivní)")
mean_dropdown = mo.ui.dropdown(options=["Aritmetický", "Geometrický", "Harmonický"], value="Aritmetický", label="Typ průměru")
return grid_slider, mean_dropdown
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mean_dict = {'aritmetic' : Aritmetic, ...}
mean_class : Union[Aritmetic, Geometric, Harmonic]= mean_dict[mean_dropdown]
mean_obj = mean_class()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants