Closed danielSoler93 closed 7 years ago
I can't reproduce this bug with Python 2.7 nor Python 3.5. Can you provide more details on that, please? Which Python version are you using? Anyway, try with latest master (git pull
should do).
Same issue with latests master.
FAILED :(
Traceback (most recent call last):
File "/home/daniel/anaconda3/envs/py27/bin/ommprotocol", line 9, in
TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'int'
ommprotocol v0.1.3+8.g68e67c1 Python 2.7.12 conda env: my_conda_env.txt
Let me know if you need anything else.
Nah, nothing else. Python 2.x does not support float or int division for timedeltas. I'll fix this (possible workaround here) and report back.
Can you please create a .py file and run the attached code? It should print 245
to stdout.
#!/usr/bin/env python
from __future__ import print_function
from datetime import datetime
from time import sleep
t0 = datetime.now()
sleep(5)
total = 1500
steps = 30
time = datetime.now() - t0
delta = (total - steps)*time/steps
print(delta.seconds)
Runned on the same env as before with python and pychimera commands and everything works fine
So...? Does that mean it is magically fixed?
It is working on python pychimera and IDLE of chimera but when executing file and importing from eggs is not working...
When printing out on screen:
Traceback (most recent call last): File "/home/daniel/anaconda3/envs/py27/bin/ommprotocol", line 9, in
load_entry_point('ommprotocol', 'console_scripts', 'ommprotocol')()
File "/home/daniel/repos/ommprotocol/ommprotocol/init.py", line 19, in run_protocol
protocol(handler, cfg)
File "/home/daniel/repos/ommprotocol/ommprotocol/md.py", line 91, in protocol
pos, vel, box = stage.run()
File "/home/daniel/repos/ommprotocol/ommprotocol/md.py", line 314, in run
self.simulate()
File "/home/daniel/repos/ommprotocol/ommprotocol/md.py", line 344, in simulate
self.simulation.step(steps)
File "/home/daniel/anaconda3/envs/py27/lib/python2.7/site-packages/simtk/openmm/app/simulation.py", line 132, in step
self._simulate(endStep=self.currentStep+steps)
File "/home/daniel/anaconda3/envs/py27/lib/python2.7/site-packages/simtk/openmm/app/simulation.py", line 219, in _simulate
reporter.report(self, state)
File "/home/daniel/repos/ommprotocol/ommprotocol/io.py", line 584, in report
delta = (self.total_steps-steps)*time/steps
TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'int'
Version --> ommprotocol v0.1.3+0.g24fde72.dirty