DasLab / zetafold

Sandbox for secondary structure modeling
MIT License
3 stars 1 forks source link

Break unit tests into individual cases #5

Closed everyday847 closed 5 years ago

everyday847 commented 5 years ago

This way, each one gets set up on its own rather than relying on hidden state (like a sequence that might have been set for a prior test!) and they break individually rather than as a single mass.

Now:


============================================================================================================ test session starts =============================================================================================================
platform darwin -- Python 3.6.7, pytest-3.7.1, py-1.5.3, pluggy-0.7.1
benchmark: 3.1.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /Users/amw579/programs/alphafold, inifile:
plugins: benchmark-3.1.1
collected 17 items

tests_alphafold.py .................                                                                                                                                                                                                   [100%]

========================================================================================================= 17 passed in 0.33 seconds ==========================================================================================================```
everyday847 commented 5 years ago

@rhiju merge this when you can -- now you have (as described above) multiple distinct test cases that can pass and fail individually. (This required re-computing a couple partition functions -- there were places where you re-used a result from test n in test n+1, which (IMO) we should avoid to make the tests totally independent.

As a side note, one idiom you use that won't work in python3 is dict.has_key(k) -- that method no longer exists. Instead ask if k in dict.

rhiju commented 5 years ago

hi @everyday847 just getting to this! i like the PR, but I didn't review or merge before as I was in the middle of a big refactoring tear; now a lot of that reorganization (and science!) is in good shape.

Will need a little help to resolve some of the recent conflicts -- I might ask Ramya or you for a little help -- will be going through issues with Ramya this week, as I think she is on board for accelerating the code, linearizing it, and getting proteins in!

i'm probably going to move this repo

everyday847 commented 5 years ago

Great, that won't be much trouble at all; this is a largely mechanical effort. Looking forward also to your c backend :-)

On Sun, Dec 30, 2018, 7:59 PM Rhiju Das <notifications@github.com wrote:

hi @everyday847 https://github.com/everyday847 just getting to this! i like the PR, but I didn't review or merge before as I was in the middle of a big refactoring tear; now a lot of that reorganization (and science!) is in good shape.

Will need a little help to resolve some of the recent conflicts -- I might ask Ramya or you for a little help -- will be going through issues with Ramya this week, as I think she is on board for accelerating the code, linearizing it, and getting proteins in!

i'm probably going to move this repo

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rhiju/zetafold/pull/5#issuecomment-450598262, or mute the thread https://github.com/notifications/unsubscribe-auth/AExsazIc7sNnELo1mEdQVdtmz4D6Or6lks5u-WF7gaJpZM4Y2T1j .

rhiju commented 5 years ago

closing this since PR #16 seems to handle it. Thanks @everyday847 !