Skip to content

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

Merged
elkogerville merged 6 commits into
amusecode:mainfrom
elkogerville:tupan
May 12, 2026
Merged

Fix Tupan test failures with numpy ≥2.4.0 (fixes #1256)#1258
elkogerville merged 6 commits into
amusecode: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
Copy link
Copy Markdown
Member

@LourensVeen LourensVeen left a comment

Choose a reason for hiding this comment

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

Looks good! The failing framework test is unrelated, so this is good to merge.

@github-project-automation github-project-automation Bot moved this from Open PRs to Done in Development Board May 12, 2026
@elkogerville elkogerville merged commit af37bfe into amusecode:main May 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Tupan tests fail with numpy >=2.4.0

2 participants