JuliaDynamics / Agents.jl

Agent-based modeling framework in Julia
https://juliadynamics.github.io/Agents.jl/stable/
MIT License
725 stars 117 forks source link

Deprecate adding agent by add_agent!(a::Agent, ....) #871

Closed Tortar closed 1 year ago

Tortar commented 1 year ago

By #861

Still need to fix 4 tests and improve warnings messages

codecov-commenter commented 1 year ago

Codecov Report

Merging #871 (7c3b30a) into main (ecbfe14) will decrease coverage by 0.54%. The diff coverage is 25.00%.

@@            Coverage Diff             @@
##             main     #871      +/-   ##
==========================================
- Coverage   72.56%   72.02%   -0.54%     
==========================================
  Files          42       42              
  Lines        2737     2745       +8     
==========================================
- Hits         1986     1977       -9     
- Misses        751      768      +17     
Files Changed Coverage Δ
src/core/space_interaction_API.jl 92.30% <ø> (-0.34%) :arrow_down:
src/deprecations.jl 2.32% <0.00%> (-1.25%) :arrow_down:
src/simulations/paramscan.jl 94.28% <ø> (ø)
src/simulations/sample.jl 100.00% <100.00%> (ø)
src/spaces/discrete.jl 98.78% <100.00%> (-0.02%) :arrow_down:

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

:loudspeaker: Have feedback on the report? Share it here.

Datseris commented 11 months ago

The way this was conveyd in the changelog is inappropriate. The crucial information to convey is the breaking change that one cannot manually mess with, or set, agent ids. This has to be its own dedicated entry that starts with this infiromation.

Please create a bullet point that writes:

Manually setting or altering the ids of agents is no longer allowed. The agent id is now considered a read-only field, and is set internally by Agents.jl to enable hidden optimizations in the future. As a consequence, add_agent!(agent::AbstractAgent, pos::ValidPos, model::ABM) and add_agent!(agent::AbstractAgent, model::ABM) have been deprecated. See issue #861 for more.

The fact that add_agent! now allows keyword propagation is a completely separate topic and hence should be its own bullet point.

Tortar commented 11 months ago

you are totally right, will do that when I also solve the flocking example