3. Discussion: how can we break out the context map generation? #3
Labels
No labels
Conceptual
Enhancement
Fix
No milestone
No project
No assignees
10 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ASPP/2025-plovdiv-scientific-patterns#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Right now, the context map generation logic is in the Walker constructor. This works but is ugly and not very extensible. How could we solve this?
Exercise instructions:
Go to the notebook
walker/Step_3_break_out_the_context_map_initialization
and follow the instructions. Comment here what you think the solution could look like. Also feel free to comment on other group's suggestions.Make sure to include your suggested code snippet(s)
Open the notebook “Step_1_classes_exercise” and follow the instructionsto 3. Discussion: how can we break out the context map generation?Context map is separate class with the constructor taking size and map_type
We create a different funtion for each plot type within the context_maps module
I would like the functionality of the creation of the context map and the walker to be separated. Like so:
We suggest:
`from context_map import create_context_map
context_map = create_context_map(size, 'hills')
walker = Walker(sigma_i=3, sigma_j=4)`
The independent module
context_maps
provides various functions to build various maps.After instantiating our walker we will build a map outside the
Walker
class.The class method
sample_next_step
andplot_trajectory
takes a built map of certain size as argument.We could externalize the context map construction into a separate module called
context_map
, containg functions that take care of the individual map types.Imports would change to
Input arguments for the functions would be size, the interface of
Walker
would be unchanged.Committed as pesudocode in the notebook
@martinco wrote in #3 (comment):
I dont think you passed the context map :/