Skip to content

Ensure PropertyLayer.from_data() does not have side effects#3122

Merged
quaquel merged 3 commits intomesa:mainfrom
quaquel:property_data_bugfix
Jan 13, 2026
Merged

Ensure PropertyLayer.from_data() does not have side effects#3122
quaquel merged 3 commits intomesa:mainfrom
quaquel:property_data_bugfix

Conversation

@quaquel
Copy link
Copy Markdown
Member

@quaquel quaquel commented Jan 12, 2026

Currently, ' PropertyLayer.from_data()uses the numpy array directly. However, this means that any subsequent changes tolayer.data` will also change the original dataframe. This can be a bug (currently affecting Sugarscape). An additional test for this bug is also included.

@quaquel quaquel added the bug Release notes label label Jan 12, 2026
@github-actions
Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +1.0% [+0.7%, +1.3%] 🔵 -0.7% [-1.2%, -0.3%]
BoltzmannWealth large 🔵 +0.8% [+0.4%, +1.2%] 🔵 -0.7% [-1.4%, +0.1%]
Schelling small 🔵 -0.0% [-1.0%, +1.0%] 🔵 -0.0% [-0.5%, +0.5%]
Schelling large 🔵 +1.3% [-0.3%, +3.6%] 🔵 -2.7% [-3.0%, -2.4%]
WolfSheep small 🔵 +0.1% [-0.0%, +0.2%] 🔵 -1.1% [-1.3%, -0.9%]
WolfSheep large 🔵 -0.3% [-0.6%, +0.0%] 🔵 -1.5% [-2.6%, +0.1%]
BoidFlockers small 🔵 -0.4% [-0.6%, -0.2%] 🔵 -0.9% [-1.1%, -0.7%]
BoidFlockers large 🔵 -0.5% [-0.8%, -0.1%] 🔵 -0.5% [-0.8%, -0.2%]

Copy link
Copy Markdown
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

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

Thanks!

@quaquel quaquel merged commit 0d4119e into mesa:main Jan 13, 2026
14 checks passed
@quaquel quaquel deleted the property_data_bugfix branch January 13, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants