Conversation
jbrezmorf
reviewed
Mar 31, 2026
| @@ -1,17 +1,14 @@ | |||
| import marimo | |||
Contributor
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
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: |
Contributor
There was a problem hiding this comment.
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] |
Contributor
There was a problem hiding this comment.
REmove, with replacement of matplotlib plots.
|
|
||
| # Refaktorovat kód -> výpočty a složitější grafy do samostatného modulu/ modulů. | ||
|
|
||
| class MeanCalculator: |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
mean_dict = {'aritmetic' : Aritmetic, ...}
mean_class : Union[Aritmetic, Geometric, Harmonic]= mean_dict[mean_dropdown]
mean_obj = mean_class()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
zadani 24.03