Skip to content

Fix Tupan test failures with numpy ≥2.4.0 (fixes #1256)#1258

Open
elkogerville wants to merge 6 commits intoamusecode:mainfrom
elkogerville:tupan
Open

Fix Tupan test failures with numpy ≥2.4.0 (fixes #1256)#1258
elkogerville wants to merge 6 commits intoamusecode:mainfrom
elkogerville:tupan

Conversation

@elkogerville
Copy link
Copy Markdown
Collaborator

Fixes #1256

Problem:
Tupan tests fail with numpy ≥2.4.0 due to incompatible dtype handling in commit_particles. The method was assigning 0-dimensional np.ndarray objects to ParticleSystem attributes instead of scalars.

Solution: Refactored particle management to use amuse.datamodel.particle module.

  • new_particle: Changed to instantiate Particle objects and accumulate them in a Particles object (instead of creating single-element ParticleSystem instances)
  • commit_particles: Convert the accumulated Particles object to a ParticleSystem before passing to Tupan

Test Status:
All uncommented tests pass. Tests xtest04, xtest08, xtest10 remain commented because they test unimplemented features (stopping conditions, get_gravity_at_point).

Additional Changes:

  • Removed redundant get_eta and set_eta from Tupan methods as they are already defined as parameters.
  • Refactored TestTupan::test02 as it was testing parameters that do not exist.
  • Removed Tupan being listed as a dependency of Tupan in the pyproject.toml

@elkogerville elkogerville requested a review from a team as a code owner April 22, 2026 16:37
@elkogerville elkogerville moved this from Backlog to Open PRs in Development Board Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Open PRs

Development

Successfully merging this pull request may close these issues.

Tupan tests fail with numpy >=2.4.0

1 participant