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

p0c setter gives an error #14

Open
giadarol opened this issue Jun 16, 2019 · 1 comment
Open

p0c setter gives an error #14

giadarol opened this issue Jun 16, 2019 · 1 comment

Comments

@giadarol
Copy link
Contributor

Here an example:

In [7]: ps_part.p0c = 7000*1e9
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-7-6b6e194dff1d> in <module>()
----> 1 ps_part.p0c = 7000*1e9

~/Desktop/WeakStrongDevelopment/pysixtrack/pysixtrack/particles.py in p0c(self, p0c)
    282         new = self._f1(self.mass0, p0c)
    283         self._update_ref(*new)
--> 284         self._update_particles(*new)
    285 
    286     energy0 = property(lambda self: self._energy0)

~/Desktop/WeakStrongDevelopment/pysixtrack/pysixtrack/particles.py in _update_particles(self, mass0, beta0, gamma0, p0c, energy0)
    328             Energy = self.Energy
    329             Pc = self.Pc
--> 330             mratio = mass / mass0
    331             self._mratio = mratio
    332             self._chi = self._qratio / mratio

NameError: name 'mass' is not defined

@rdemaria
Copy link
Owner

Review whole logic of updates...

rdemaria pushed a commit that referenced this issue Jun 18, 2019
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

2 participants