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

WIP: multipucker #1611

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

WIP: multipucker #1611

wants to merge 2 commits into from

Conversation

hainm
Copy link
Contributor

@hainm hainm commented Jun 25, 2022

No description provided.

@PhiMykah
Copy link

PhiMykah commented Jan 5, 2024

@hainm I had some time so I started implementation of multipucker on the multipucker branch this on this fork. Before starting a pull request, I was curious about what to do with the frame_indices parameter with multipucker, and what tests to implement. I am unsure what tests I can perform that have expected results. Any other comments or suggestions are appreciated. Thank you!

@hainm
Copy link
Contributor Author

hainm commented Jan 5, 2024

I was curious about what to do with the frame_indices parameter with multipucker

Please see super_dispatch code. I think if frame_indices is not None, the code will slice the given traj
saying multipucker(traj, frame_indices=[1,3,5]) will return value fro only 3 frames.

@hainm
Copy link
Contributor Author

hainm commented Jan 5, 2024

and what tests to implement. I am unsure what tests I can perform that have expected results.

Traditionally we reuse the cpptraj's command in its testing folder to make sure to reproduce exact values

Please let me know if you have other questions. Cheers.

@hainm
Copy link
Contributor Author

hainm commented Jan 5, 2024

@PhiMykah Please see cpptraj's command for multipucker here: https://github.com/Amber-MD/cpptraj/blob/master/test/Test_MultiPucker/RunTest.sh

(and find many tests for many others here: https://github.com/Amber-MD/cpptraj/tree/master/test)

@PhiMykah
Copy link

@hainm Hello! I am doing some multipucker testing, and currently I am having issues with running pyranoid puckertypes. I ran test_multipucker.py found here using unittest, and received the following error regarding the pyranoid test:

/.../source/pytraj/pytraj/all_actions.py:3207: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 mode='r' encoding='utf-8'>
  c_dslist, _ = do_action(traj, command, c_action.Action_MultiPucker)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/.../source/pytraj/pytraj/all_actions.py:3207: ResourceWarning: unclosed file <_io.TextIOWrapper name=5 mode='r' encoding='utf-8'>
  c_dslist, _ = do_action(traj, command, c_action.Action_MultiPucker)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
..E
======================================================================
ERROR: test_multipucker_pyranoid (__main__.TestMultipucker.test_multipucker_pyranoid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/.../source/pytraj/tests/test_analysis/test_multipucker.py", line 60, in test_multipucker_pyranoid
    data_pyranoid = pt.multipucker(traj=traj, name='Pyranoid',
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../source/pytraj/pytraj/utils/get_common_objects.py", line 314, in inner
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/.../source/pytraj/pytraj/all_actions.py", line 3207, in multipucker
    c_dslist, _ = do_action(traj, command, c_action.Action_MultiPucker)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../source/pytraj/pytraj/analysis/c_action/__init__.py", line 25, in do_action
    act = action_class(command=command, top=top, dslist=c_dslist)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pytraj/analysis/c_action/c_action.pyx", line 84, in pytraj.analysis.c_action.c_action.Action.__init__
  File "/.../source/pytraj/pytraj/utils/decorators.py", line 59, in _inner
    return func(self, *args, **kwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "pytraj/analysis/c_action/c_action.pyx", line 180, in pytraj.analysis.c_action.c_action.Action.setup
RuntimeError: Failed to setup action. Use pytraj._verbose() to turn on the error report.

----------------------------------------------------------------------
Ran 3 tests in 0.012s

FAILED (errors=1)

I also have the pytraj verbose log. I am positive that it is likely the result of a syntactical issue, but I am unsure where to look for it, and what in particular is causing the setup action to fail. Any ideas? Thanks in advance for your help!

@hainm
Copy link
Contributor Author

hainm commented Jan 11, 2024

@PhiMykah I am testing your branch now...

@hainm
Copy link
Contributor Author

hainm commented Jan 11, 2024

@PhiMykah I found the issue. It's because of this

puckertype=['pyranoid','C1','C2','C3','C4','C5','05'],

In your code, '05' is zero and five. It should be "O" (as in Oxygen) and "5" (O5)
image

@PhiMykah
Copy link

In your code, '05' is zero and five. It should be "O" (as in Oxygen) and "5" (O5)

I see it now, Thank you! I had a feeling it was something with syntax 😅

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