Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes required for removing ParticlesBase #59

Conversation

szymonlopaciuk
Copy link
Contributor

@szymonlopaciuk szymonlopaciuk commented Feb 28, 2024

Description

  1. Remove the particles_class argument from some methods that no longer require it, following the proposed changes to xtrack and xpart (Move particles to xtrack, remove ParticlesPurelyLongitudinal xtrack#449).
  2. Put materials on a context different from context_default. This is needed, as otherwise whenever xcoll is imported, the materials are allocated on the default context. This is not in itself wrong, but causes a problem for the test run of xtrack, where emptiness of the default context is checked (as a means of detecting memory leaks -- this was a problem in the past). Rather than disabling the check, we can allocate the materials on a different context, as a means of specifying that these are valid allocations. Maybe a better solution can be found, but for now this seems the best.

Closes # .

Checklist

Mandatory:

  • I have added tests to cover my changes
  • All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

This is needed, as otherwise whenever xcoll is imported, the
materials are allocated on the default context. This is not in
itself a problem, but causes a problem for the test run of xtrack,
where emptiness of the default context is checked (as a means of
detecting memory leaks -- this was a problem in the past).
Rather than disabling the check, we can allocate the materials on
a different context, as a means of specifying that these are valid
allocations. Maybe a better solution can be found, but for now
this seems the best.

Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
@freddieknets freddieknets changed the base branch from main to release/v0.3.3 February 28, 2024 09:15
@freddieknets freddieknets merged commit 408b8fd into xsuite:release/v0.3.3 Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants