Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
340 commits
Select commit Hold shift + click to select a range
eb3df53
Started implementing a sim_format.py ABC
rdesparbes Dec 16, 2023
9b08acf
ParticleDict is now a dataclass
rdesparbes Dec 17, 2023
22e5a9c
Renamed ParticleDict as ParticleState
rdesparbes Dec 17, 2023
e798b05
Using ParticleState instead of Dict[str, Any]
rdesparbes Dec 17, 2023
5f32387
Improved error message for assert_is_subset
rdesparbes Dec 17, 2023
474c686
Modified tests to support str representations of int and float
rdesparbes Dec 17, 2023
7f8cca7
Fixed the pickle of wind_simulation.sim, where references to "self" w…
rdesparbes Dec 17, 2023
4b4765f
Simulation.to_dict() is now using GUI.input2dict() for particle settings
rdesparbes Dec 17, 2023
acea746
Created sim_gui_settings.py
rdesparbes Dec 17, 2023
7109ac8
Integrated use of GUI.get_sim_settings()
rdesparbes Dec 17, 2023
983a300
Renamed input2dict methods
rdesparbes Dec 17, 2023
941adae
Added _parse_particle_settings method
rdesparbes Dec 17, 2023
d6673ba
Added GUI.set_particle_settings()
rdesparbes Dec 17, 2023
0d162f6
Integrated ParticleSettings for loading
rdesparbes Dec 17, 2023
ad1707d
The radius is no longer written as a string in the pickles, but as on…
rdesparbes Dec 17, 2023
fa14350
Removed the test_simulation_load_then_write_generates_subset test, as…
rdesparbes Dec 17, 2023
6430981
Extracted parse_radius method
rdesparbes Dec 17, 2023
84fbe1e
Removed cast to str when writing pickles
rdesparbes Dec 17, 2023
32909c7
Added GUI.set_sim_settings
rdesparbes Dec 17, 2023
e4ae211
Integrated GUI.set_sim_settings()
rdesparbes Dec 17, 2023
41b8b84
Integrated Simulation._set_sim_settings()
rdesparbes Dec 17, 2023
56c4a0b
Removed sim_pickle.AttributeType
rdesparbes Dec 17, 2023
b0166ca
Saving attributes of the Simulation instead of those of the GUI
rdesparbes Dec 17, 2023
c56878b
Started moving the pickle format out of simulation.py
rdesparbes Dec 17, 2023
09d5d1f
Integration of controller_state.py
rdesparbes Dec 18, 2023
7653b15
Fixed link_lengths loading problem
rdesparbes Dec 27, 2023
30d2317
Moved some methods from particle.py to particle_data.py
rdesparbes Jan 1, 2024
7573bef
Removed some arguments from function signatures
rdesparbes Jan 1, 2024
3b7ba93
Renamed "interact" parameters to "reach"
rdesparbes Jan 1, 2024
0089659
Extracted _manage_link method
rdesparbes Jan 1, 2024
d36fa3a
Fixed emptying of link_indices_lengths
rdesparbes Jan 1, 2024
0001a50
Extracted a method to compute a Link
rdesparbes Jan 1, 2024
2134912
Added .0 to make float obvious
rdesparbes Jan 1, 2024
dd33160
Extracted compute magnitude strategies
rdesparbes Jan 1, 2024
19a2911
Integrated ComputeMagnitudeStrategy
rdesparbes Jan 1, 2024
14f60fa
Moved the strategy initialization where self._sim appears
rdesparbes Jan 1, 2024
ff859dc
Removed never-occurring Optional
rdesparbes Jan 1, 2024
2c7a990
Simplified _compute_repel_r()
rdesparbes Jan 1, 2024
b2faf64
Removed optimization in the radii compute magnitude strategy
rdesparbes Jan 1, 2024
74cd2c9
Removed tuple of "are_reaching"
rdesparbes Jan 2, 2024
af4edfc
Fixed attract bug introduced in dfbd3a73325ffdc16cbc87d15874e0dc0c3d4de3
rdesparbes Jan 2, 2024
e4185dc
Added setters in the GUI to avoid dynamic setattr
rdesparbes Jan 2, 2024
6615336
Added SimulationState type annotation in extra_window.py
rdesparbes Jan 2, 2024
9e92c00
WIP: Removed inheritance between simulation and simulation_state.py. …
rdesparbes Jan 2, 2024
1eff9e0
WIP: Added distance method to ParticleData
rdesparbes Jan 2, 2024
746e5ea
WIP: Fixed a bug with OpenCV that occurred when adding a particle
rdesparbes Jan 2, 2024
267959f
Fixed the "mouse_mode" and a "running" bug
rdesparbes Jan 2, 2024
8f032c5
Added a GUI.register_sim method to fix the fact that the sim settings…
rdesparbes Jan 3, 2024
4c85a2a
Renamed private methods that are now public
rdesparbes Jan 3, 2024
2b1f87b
Split SimulationState in two
rdesparbes Jan 3, 2024
90b493a
Fixed typo in interact_with_all
rdesparbes Jan 4, 2024
ada160c
Introduced x_min, y_min, x_max, y_max properties
rdesparbes Jan 4, 2024
cdac7a9
Extracted a _collide method
rdesparbes Jan 4, 2024
2e302a4
Simplified link management. Small change in behavior with repel_r
rdesparbes Jan 4, 2024
3c413da
Creating the Link only if it must be stored
rdesparbes Jan 4, 2024
e1034b5
Removed _update_attributes, as it is now handled as callbacks
rdesparbes Jan 5, 2024
9b54cee
Simplified FPS management
rdesparbes Jan 6, 2024
7a44e84
Moved mr to simulation_data.py
rdesparbes Jan 6, 2024
3815ec1
Moved "code" to simulation_data.py
rdesparbes Jan 6, 2024
245e566
Introduced SimulationData to sim_pickle.py
rdesparbes Jan 6, 2024
1f2ba85
sim_pickle.py does not depend on SimulationState anymore
rdesparbes Jan 6, 2024
48ecca0
Added comments in SimulationData to indicate where the data is being …
rdesparbes Jan 6, 2024
0ee62e4
Split buttons definition and callback setting
rdesparbes Jan 6, 2024
4544caa
Split the GUI in two components
rdesparbes Jan 6, 2024
f7f0d2b
Fixed a bug where the new velocity was assigned to a non-existing att…
rdesparbes Jan 7, 2024
c1bc559
Fixed some typing errors
rdesparbes Jan 7, 2024
52a2628
Removed unused code
rdesparbes Jan 7, 2024
55b0f46
Fixed smells according to pylint
rdesparbes Jan 7, 2024
60ae04a
Replaced eval in _change_color_entry by a regex
rdesparbes Jan 7, 2024
3ce9e2d
Using color_var as a reference instead of color_entry
rdesparbes Jan 7, 2024
736d131
Extracted a _parse_color method
rdesparbes Jan 7, 2024
45662f9
Removed "random" from the logic of the app
rdesparbes Jan 7, 2024
63ea58d
Added an empty_simulation.py script to make manual tests on simple data
rdesparbes Jan 7, 2024
80d389e
Fixed load/link button bug
rdesparbes Jan 7, 2024
8bec594
Using _set_entry where needed
rdesparbes Jan 7, 2024
b897925
Removed Literal["scroll"] in sim_pickle.py
rdesparbes Jan 7, 2024
5f62191
Removed Literal["repel"]
rdesparbes Jan 7, 2024
f445f11
Removed del statement for _link
rdesparbes Jan 7, 2024
f3b8e2c
Moved link and unlink to ParticleData
rdesparbes Jan 7, 2024
50b08be
Refactored the _paste method
rdesparbes Jan 7, 2024
1d45d7e
Removed acceleration attribute
rdesparbes Jan 7, 2024
b8c3011
Extracted mutations on sim to Simulation
rdesparbes Jan 9, 2024
56a8449
Fixed bug when comparing dataclasses with np.ndarray (use .any() or .…
rdesparbes Jan 9, 2024
b3a8cf4
Fixed bug visible in "soft_body.sim" introduced in 3b6fbd7b6a9c5b6d1a…
rdesparbes Jan 10, 2024
b6bb14e
Extracted method to compute delta velocity
rdesparbes Jan 12, 2024
355d7de
Removed zeros case from _compute_delta_velocity
rdesparbes Jan 12, 2024
a55ec63
Introduced particle_interaction.py
rdesparbes Jan 12, 2024
e043f30
Moved Link to simulation_state.py
rdesparbes Jan 12, 2024
de8371f
Reduced indentation in Particle._compute_force()
rdesparbes Jan 12, 2024
abd566d
Fixed a bug where velocity and position were updated twice when "self…
rdesparbes Jan 12, 2024
817b0f1
Uniformized speed and position computation between mouse and not mouse
rdesparbes Jan 12, 2024
150f5ae
ParticleInteraction now holds a force instead of an acceleration
rdesparbes Jan 12, 2024
8997a56
Moved collision setting outside Particle
rdesparbes Jan 12, 2024
70f9d7d
Changed condition to avoid overflow/underflows when drawing links in cv2
rdesparbes Jan 12, 2024
3343b06
Renamed _apply_force
rdesparbes Jan 12, 2024
c262ff0
Removed _to_acceleration
rdesparbes Jan 13, 2024
12a9687
Moved collision force sum outside Particle
rdesparbes Jan 13, 2024
e549b2a
Extracted fix_overlap method
rdesparbes Jan 13, 2024
0fa6538
Added a Rectangle class
rdesparbes Jan 13, 2024
467b6d3
Moved ComputeMagnitudeStrategy creation outside of Particle
rdesparbes Jan 13, 2024
b4b7c8d
Moved _sim.paused outside of Particle
rdesparbes Jan 13, 2024
19bda6e
The force parameter of update() is now Optional
rdesparbes Jan 13, 2024
e923255
Fixed a bug in the original implementation where the speed of the sim…
rdesparbes Jan 13, 2024
f590771
Fixed a bug in the original implementation where the speed of the sim…
rdesparbes Jan 13, 2024
d15c3ce
Fixed a bug in the original implementation where the inertia was not …
rdesparbes Jan 13, 2024
18e1e00
Introduced early return in _mouse_p_part
rdesparbes Jan 13, 2024
a15119b
Removed intrication between "MOVE" and "SELECTED" workflows
rdesparbes Jan 13, 2024
5909699
Fixed inversion in _is_in_range and selection bug introduced in 202e9…
rdesparbes Jan 13, 2024
6f480bb
Split "MOVE" and "SELECT" workflows again
rdesparbes Jan 13, 2024
f454296
Fixed some type annotations
rdesparbes Jan 13, 2024
cea1cec
Split _mouse_p_old method in two
rdesparbes Jan 13, 2024
2f22371
Introduced early return in _mouse_p_* methods
rdesparbes Jan 13, 2024
2627bb8
Inlined _mouse_p_select
rdesparbes Jan 13, 2024
6541bfa
Inlined _mouse_p_move
rdesparbes Jan 13, 2024
6cb36c4
Make use of _iter_in_range
rdesparbes Jan 13, 2024
113fe87
Introduced a Circle class
rdesparbes Jan 13, 2024
0d6cde4
Fixed a bug where filling GUI from particle raised AttributeError for…
rdesparbes Jan 14, 2024
20d71e0
Fixed a bug where the "repel" link length was not converted to None w…
rdesparbes Jan 14, 2024
b6e1b5b
Removed dependency between simulation.py and sim_pickle.py
rdesparbes Jan 14, 2024
e7f9bd2
Removed gridres argument in GUI
rdesparbes Jan 14, 2024
eda764a
Moved some instance attributes outside gui_widgets.py
rdesparbes Jan 14, 2024
464e72d
Added a test for SimulationState.add_group()
rdesparbes Jan 14, 2024
ca4c2dc
Made GUI.add_group private and homogenized naming for create_group ca…
rdesparbes Jan 14, 2024
4167d9a
Fixed a bug from the original version where creating a particle with …
rdesparbes Jan 14, 2024
07c34c9
Renamed create_group to create_group callback
rdesparbes Jan 14, 2024
243770e
Removed unused GUI.group_indices
rdesparbes Jan 14, 2024
d551163
Moved link_colors to Simulation
rdesparbes Jan 14, 2024
1062fab
Make use of GUI._set_entry in GUI._register_sim
rdesparbes Jan 14, 2024
0ef631d
Fixed a bug where the background color was set as the part color in t…
rdesparbes Jan 14, 2024
24d3cfa
Extracted a color.py module
rdesparbes Jan 14, 2024
2568535
Unplugged bg_color[1]
rdesparbes Jan 14, 2024
9d5212f
Using RGB only for bg_color
rdesparbes Jan 14, 2024
a17dd78
Setting color_var instead of entry
rdesparbes Jan 14, 2024
c0c8420
Removed Simulation.focus attribute
rdesparbes Jan 14, 2024
3cea1b0
Added some methods to simulation_state.py
rdesparbes Jan 14, 2024
47ea4d2
Removed the Simulation.grid attribute
rdesparbes Jan 14, 2024
5037353
Fixed validation errors due to IntVar injected in textvariable
rdesparbes Jan 14, 2024
21a5d5b
Restored focus as an attribute because of threading issues
rdesparbes Jan 14, 2024
5d623a8
Updating mouse position before simulating a step for better accuracy
rdesparbes Jan 14, 2024
6159321
Removed gridres from the constructor of GUIWidgets
rdesparbes Jan 14, 2024
03f57f5
Introduced generics to reduce coupling with the Particle class
rdesparbes Jan 19, 2024
36d988d
Moved methods of Particle that do not rely on Simulation into Particl…
rdesparbes Jan 19, 2024
70bded6
Extracted a method to parse the radius
rdesparbes Jan 19, 2024
b4c6fba
Fixed _collisions injected in Particle constructor
rdesparbes Jan 19, 2024
0167a51
Removed unused "mouse" from pickle
rdesparbes Jan 19, 2024
1c3ad80
Fixed the fact that "mouse" was not a proper field (type annotation m…
rdesparbes Jan 19, 2024
2f29e6f
Removed _sim as a Particle attribute
rdesparbes Jan 19, 2024
da99e30
Introduced ParticleProperties and ParticleBuilder
rdesparbes Jan 20, 2024
d1d7454
Fixed unlock_selection
rdesparbes Jan 20, 2024
3e7a07c
Fixed some pylint issues
rdesparbes Jan 20, 2024
6592517
Fixed a bug where the radius of the particle was not loaded. Replaced…
rdesparbes Jan 20, 2024
903a7a4
Created a conversion.py module
rdesparbes Jan 20, 2024
8b04457
Moved remaining methods of Particle in simulation_state.py
rdesparbes Jan 20, 2024
e7fc932
ParticleFactory.color is not optional anymore
rdesparbes Jan 20, 2024
575097f
ParticleData is now equal to Particle
rdesparbes Jan 20, 2024
e3fc0db
Removed ParticleData
rdesparbes Jan 20, 2024
7747d4d
Removed unnecessary TypeVars
rdesparbes Jan 20, 2024
f7b3c51
Removed some duplication for Particle/Factory conversions
rdesparbes Jan 20, 2024
cc3ef71
Fixed a bug in replace_particle and removed reminiscences of the fact…
rdesparbes Jan 21, 2024
b609b21
Moved painting part outside the Simulation class
rdesparbes Jan 21, 2024
f5ba28c
Created update_mouse_pos in SimulationState
rdesparbes Jan 21, 2024
1a60550
Moved simulate_step to SimulationState
rdesparbes Jan 21, 2024
b91a271
Renamed link_colors to link
rdesparbes Jan 21, 2024
e42767c
Moved reset of _collisions right after using its values
rdesparbes Jan 21, 2024
87f1ec7
Fixed a bug where the force applied to the particles when they superp…
rdesparbes Jan 21, 2024
760a6a0
Renamed repel_r to link_length
rdesparbes Jan 21, 2024
bec9f3a
Added type ignores for the "create_rectangle" mypy errors
rdesparbes Jan 21, 2024
a8c469f
Replace the default "scroll" radius of the GUI by a valid value of 1
rdesparbes Jan 21, 2024
621309d
Removed pyinput as a dependency
rdesparbes Jan 21, 2024
5c79623
Removed some parameters from the GUI.update method
rdesparbes Jan 21, 2024
0fb423c
Removed gui.canvas.get_focus() and unused attribute _link_lengths
rdesparbes Jan 21, 2024
d34efe0
Moved copy/cut/paste mechanics to SimulationState
rdesparbes Jan 21, 2024
db44d01
Using a queue to store errors instead of a simple optional variable
rdesparbes Jan 21, 2024
2f49432
Added tests for the group management
rdesparbes Jan 21, 2024
0e457dc
Moved graphical bindings ogf the GUI to gui_widgets.py
rdesparbes Jan 21, 2024
c39e4d0
Moved rotate_2d to the geometry.py module
rdesparbes Jan 21, 2024
08c2c44
Moved some fields of SimulationData back to SimulationState
rdesparbes Jan 21, 2024
8aa7cc8
Moved early return for optimisation
rdesparbes Jan 21, 2024
027424e
Renamed fix_overlap to compute_collision
rdesparbes Jan 21, 2024
d71873f
Fixed a bug where the direction used for the collision computation wa…
rdesparbes Jan 21, 2024
0d34e4a
Fixed a bug introduced in the previous commit d71873fa37c151e21687b31…
rdesparbes Jan 23, 2024
1700f82
Added a test for "simulate_step()"
rdesparbes Jan 23, 2024
d256b88
Made the vector transformations isotropic for the temperature and the…
rdesparbes Jan 23, 2024
898a7be
Extracted a _compute_forces_and_links method
rdesparbes Jan 23, 2024
887dc71
Added a test for simulate_step when no edges
rdesparbes Jan 23, 2024
aafc299
Added a test for bouncing
rdesparbes Jan 23, 2024
3762402
Made some attributes/methods private in simulation_state.py
rdesparbes Jan 23, 2024
91d5c97
Added more examples for two particles' behavior testing
rdesparbes Jan 23, 2024
3e92b42
Added a test for pause
rdesparbes Jan 23, 2024
ae049a4
Fixed a bug in _compute_delta_velocity when there is no forces
rdesparbes Jan 23, 2024
e4ee344
Added a test example for collisions
rdesparbes Jan 23, 2024
2f36d0b
Handling pause outside the loop
rdesparbes Jan 25, 2024
86eb7fd
Removed Particle._collisions
rdesparbes Jan 27, 2024
15fe57e
Made Particle.compute_collisions symmetrical
rdesparbes Jan 27, 2024
d902826
Using interactions to group links and forces
rdesparbes Jan 27, 2024
9c60069
Added dependencies in pyproject.toml
rdesparbes Jan 27, 2024
f648259
Added tpe annotations in SimulationState._compute_links
rdesparbes Jan 27, 2024
f22ec91
Split _compute_links in two methods
rdesparbes Jan 27, 2024
3d5fc70
Moved Particle.compute_collision outside _update_interactions
rdesparbes Jan 27, 2024
7d44b35
Introduced InteractionTransformer
rdesparbes Jan 27, 2024
0349428
Moved Link related stuff outside SimulationState
rdesparbes Jan 27, 2024
75f1688
Moved some InteractionTransformers outside SimulationState
rdesparbes Jan 27, 2024
c287ebf
Added pylint in the dev dependencies
rdesparbes Jan 27, 2024
720a174
Made some GUI attributed private
rdesparbes Jan 27, 2024
68c85b2
Replaced hardcoded "place(x, y)" coordinates by tkinter pack() calls
rdesparbes Jan 27, 2024
4cb935a
Moved modules in different directories
rdesparbes Jan 27, 2024
e477d6b
Added tests for GUI.copy_selected_btn
rdesparbes Jan 28, 2024
2f460f6
Extracted some methods from GUI._copy_from_selected
rdesparbes Jan 28, 2024
3013b67
Only iterating over parameters that are not already eliminated
rdesparbes Jan 28, 2024
1b07437
Improved performance by removing frozen=True
rdesparbes Jan 30, 2024
8becc4d
Improved performance by replacing np.linalg.norm by math.dist
rdesparbes Jan 30, 2024
3cc4de5
Explicit link_colors
rdesparbes Jan 30, 2024
3299d09
Using "math.hypot" instead of "np.linalg.norm" for speedup
rdesparbes Jan 30, 2024
3efd0c1
Determining ComputeMagnitudeStrategy outside the loop
rdesparbes Feb 4, 2024
de3f7a4
Extracted particle_widget.py and simulation_widget.py from gui_widget…
rdesparbes Feb 4, 2024
f7f7339
Extracted bar_widget.py from gui_widgets.py
rdesparbes Feb 4, 2024
b455241
Using DoubleVar to interact with Spinboxes
rdesparbes Feb 4, 2024
89a094f
Moved get_double_var to utils.py
rdesparbes Feb 4, 2024
bb120a8
Replaced entries by variables in simulation_widget.py
rdesparbes Feb 4, 2024
45508df
Added get_string_var() in variable.py
rdesparbes Feb 4, 2024
2dd4330
Using a StringVar for groups_entry
rdesparbes Feb 4, 2024
c3c6b8a
Removed unnecessary cast to int
rdesparbes Feb 4, 2024
8205a9a
Removed unused _set_entry() method
rdesparbes Feb 4, 2024
ef4fe4b
Implemented a simple event system to handle callbacks from the simula…
rdesparbes Feb 6, 2024
520347f
Added a friendlier error message if an "eventclass" is missing
rdesparbes Feb 6, 2024
ff4b535
Fixed a bug where the mouse mode rectangle was not updated when openi…
rdesparbes Feb 6, 2024
63322f4
Using event to update the mouse mode display
rdesparbes Feb 6, 2024
b08f9e2
Using events to handle groups
rdesparbes Feb 7, 2024
f98015e
Fixed type annotation in PickSettings
rdesparbes Feb 7, 2024
bfc9730
Using events for the code_window.py
rdesparbes Feb 7, 2024
b3614cf
Fixed duplicated test
rdesparbes Feb 7, 2024
043cd86
Replace BarWidget.configure_pause by an event
rdesparbes Feb 7, 2024
5e73d94
Added docstring to the event.py module
rdesparbes Feb 7, 2024
4165c8b
_Event is private anew
rdesparbes Feb 7, 2024
afec2ed
Refactored tests
rdesparbes Feb 7, 2024
9a3ebd1
Introduces Protocol to make mypy --strict pass
rdesparbes Feb 7, 2024
fe002e6
Made some arguments optional in the widgets
rdesparbes Feb 10, 2024
2a8222d
Added a docstring for interaction_transformer.py
rdesparbes Feb 10, 2024
3f1f851
Renamed particle_settings to particle_factory
rdesparbes Feb 10, 2024
0f4e68f
Removed "group1" from SimulationState
rdesparbes Feb 10, 2024
863defd
Moved mouse mode actions to SimulationState
rdesparbes Feb 10, 2024
8eecdcb
Removed mouse x, y from function signatures
rdesparbes Feb 10, 2024
8ff2327
Moved all event registrations to the GUI class
rdesparbes Feb 24, 2024
f81d8a0
Removed direct dependency to tk in Simulation
rdesparbes Feb 24, 2024
ad8b42c
Introduced a SimulationGUI Protocol
rdesparbes Feb 24, 2024
e121cac
Split SaveManager in two
rdesparbes Feb 24, 2024
87e58ad
Renamed particle_settings to particle_factory
rdesparbes Feb 24, 2024
1703787
Fixed a bug when adding a particle with group name "" (empty string)
rdesparbes Feb 26, 2024
0cb9420
Replaced integer by floats to make intent clear
rdesparbes Apr 10, 2024
c03bb8b
Removed "type-ignore" clauses that are not needed anymore
rdesparbes Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.mypy_cache/
/particle_simulator.egg-info/
22 changes: 0 additions & 22 deletions Particle Simulator/particle_simulator/__init__.py

This file was deleted.

53 changes: 0 additions & 53 deletions Particle Simulator/particle_simulator/grid.py

This file was deleted.

551 changes: 0 additions & 551 deletions Particle Simulator/particle_simulator/gui.py

This file was deleted.

278 changes: 0 additions & 278 deletions Particle Simulator/particle_simulator/particle.py

This file was deleted.

Loading