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

In place behaviour of sbreak #666

Open
lcarver opened this issue Oct 4, 2023 · 2 comments
Open

In place behaviour of sbreak #666

lcarver opened this issue Oct 4, 2023 · 2 comments
Assignees

Comments

@lcarver
Copy link
Contributor

lcarver commented Oct 4, 2023

Hello,

I encountered this behaviour during the tutorial.

ring = at.load_mat('./dba.mat', mat_key='RING')

The following line does not do anything:
ring_tmp.sbreak(0.2, at.Marker('hello'))
and there is nothing here for copy=True or copy=False

at.sbreak does not exist so we cannot do:
at.sbreak(ring_tmp, 0.2, at.Marker('hello'))

Instead the working syntax was:
ring_tmp = ring_tmp.sbreak(0.2, at.Marker('hello'))

which seems a bit in contradiction to other lattice modification functions where the in_place modifications can be used.

@swhite2401
Copy link
Contributor

sbreak modifies the lattice structure. An in place modification does not make much sense and therefore a new ring is returned.
sbreak is a member function of the class Lattice_object so it is only accessible through it and in my opinion this should remains like this.

The only improvement I can see would be to put an example usage in the help. Would that be suitable for you?

@lcarver
Copy link
Contributor Author

lcarver commented Oct 4, 2023

Yes I think it would make it clearer. I am happy to do the PR (within the next few days)

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

No branches or pull requests

3 participants