Skip to content

Commit

Permalink
python: Remove unused code, simplify conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Aug 9, 2020
1 parent 424aec8 commit 8baa00a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
7 changes: 0 additions & 7 deletions samples/chamber_game.py
Expand Up @@ -294,15 +294,9 @@
fix=[True, True, True])

# MINIMIZE ENERGY

energy = system.analysis.energy()
#print("Before Minimization: E_total = {}".format(energy['total']))
espressomd.minimize_energy.steepest_descent(system, f_max=100, gamma=30.0,
max_steps=10000,
max_displacement=0.01)
energy = system.analysis.energy()
#print("After Minimization: E_total = {}".format(energy['total']))

p_startpos = system.part[:].pos

# THERMOSTAT
Expand Down Expand Up @@ -413,7 +407,6 @@ def T_to_g(temp):

zoom_eq = 5.0
zoom_v = 0.0
zoom_a = 0.0
zoom = zoom_eq
zoom_dt = 0.01

Expand Down
2 changes: 1 addition & 1 deletion samples/lj-demo.py
Expand Up @@ -528,7 +528,7 @@ def midi_thread():
# rotate clockwise
mayavi_rotation_angle += mayavi_rotation_angle_step * \
data2
elif data2 >= 65:
else:
# rotate counterclockwise
mayavi_rotation_angle -= mayavi_rotation_angle_step * \
(data2 - 64)
Expand Down
2 changes: 1 addition & 1 deletion samples/save_checkpoint.py
Expand Up @@ -41,7 +41,7 @@
checkpoint.register_signal(signal.SIGINT)

# test for user data
myvar = "some script variable"
myvar = "some script variable" # lgtm[py/multiple-definition]
checkpoint.register("myvar")
myvar = "updated value" # demo of how the register function works

Expand Down
4 changes: 2 additions & 2 deletions src/config/featuredefs.py
Expand Up @@ -50,8 +50,6 @@ class defs:
def __init__(self, filename):
# complete set of all defined features
allfeatures = set()
# allfeatures minus externals and derived
features = set()
# list of implications (pairs of feature -> implied feature)
implications = list()
# list of requirements (pairs of feature -> requirement expr)
Expand Down Expand Up @@ -131,8 +129,10 @@ def __init__(self, filename):
raise SyntaxError("<feature> requires <expr>", line)
requirements.append((feature, rest, toCPPExpr(rest)))

# allfeatures minus externals and derived
features = allfeatures.difference(derived)
features = features.difference(externals)

self.allfeatures = allfeatures
self.features = features
self.requirements = requirements
Expand Down
6 changes: 1 addition & 5 deletions src/python/object_in_fluid/oif_classes.py
Expand Up @@ -460,9 +460,6 @@ def copy(self, origin=None, particle_type=-1, particle_mass=1.0,
rotate=None):
mesh = Mesh(system=self.system)
mesh.ids_extremal_points = self.ids_extremal_points
rotation = np.array([[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]])

if rotate is not None:
# variables for rotation
Expand All @@ -474,8 +471,7 @@ def copy(self, origin=None, particle_type=-1, particle_mass=1.0,
sc = np.sin(rotate[2])
rotation = np.array(
[[cb * cc, sa * sb * cc - ca * sc, sc * sa + cc * sb * ca],
[cb * sc, ca * cc + sa * sb *
sc, sc * sb * ca - cc * sa],
[cb * sc, ca * cc + sa * sb * sc, sc * sb * ca - cc * sa],
[-sb, cb * sa, ca * cb]])

for point in self.points:
Expand Down

0 comments on commit 8baa00a

Please sign in to comment.