-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added compatibility with MDAnalysis 2.4 #36
Conversation
- Removed the `get_propka` function (next version must be 2.0.0) - PropkaTraj constructor accepts atom indices for selections - Pandas Index with a dtype of float64 instead of Float64Index, per deprecation warning from Pandas - Removed removed tests for `get_propka` and changed the baseanalysis test names to be being the standard - Expanded parameters for `test_single_frame_regression` - Removed MDAnalysis version constraint in setup.py
@orbeckst do you know why this linter might be failing? it does not fail for me locally and I'm using the same version of pylint... |
no idea, sorry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just decide to only support Python ≥ 3.8? If so, the setup.py metadata needs to be up-to-date (and we could remove six
etc). We can then also set MDAnalysis>=2
.
I am confused why select
can be a list/array of indices in addition to a selection str. I can't remember when we added that but in any case, it's unlike any of the other typical MDA analysis functions so given that we do 2.0.0 #37 anyway, i suggest we remove this functionality and make it as simple as possible.
propkatraj/propkatraj.py
Outdated
@@ -5,7 +5,7 @@ | |||
|
|||
from __future__ import print_function, division | |||
|
|||
from six import string_types, StringIO, raise_from | |||
from six import StringIO, raise_from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could get rid of six and just support Python >=3.8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... but that can be another issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If CI is 3.8+ then we should just make that move now.
propkatraj/propkatraj.py
Outdated
if not isinstance(select, str): | ||
self.ag = atomgroup.atoms[select].atoms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? Can select
be a index array??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc string says that it can only be a string. If you want it to also be an index array then you need to change the docs and a versionchanged.
However, MDAnalysis analysis functions never use index arrays: either a selection or an AtomGroup. I'd probably just remove the ability to pass anything except a selection string and keep it simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'm also opposed to using an index array unless there's a good reason for it.
propkatraj/tests/test_regression.py
Outdated
@@ -52,32 +53,8 @@ def pka_from_file(filename): | |||
return resnums, pkas | |||
|
|||
|
|||
@pytest.mark.parametrize('selection', ['protein', 'array', 'list']) | |||
@pytest.mark.parametrize('selection', ['protein', 'ag', 'array', 'list']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly have no idea why we are testing anything except a selection string. As far as I am concerned, I would just test "protein" and perhaps "protein and resid 1-10".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like line 79 was erroneously removed and this one (which was intended for the old method) was kept instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IAlibay I figured that I'd do the union of the two parameter sets. I'll switch it to just protein
and ag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have a look at the pylint failure later today
propkatraj/propkatraj.py
Outdated
if not isinstance(select, str): | ||
self.ag = atomgroup.atoms[select].atoms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'm also opposed to using an index array unless there's a good reason for it.
propkatraj/tests/test_regression.py
Outdated
@@ -52,32 +53,8 @@ def pka_from_file(filename): | |||
return resnums, pkas | |||
|
|||
|
|||
@pytest.mark.parametrize('selection', ['protein', 'array', 'list']) | |||
@pytest.mark.parametrize('selection', ['protein', 'ag', 'array', 'list']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like line 79 was erroneously removed and this one (which was intended for the old method) was kept instead.
…nstall requirement
Remove dependence on six
- instead of original 'protein' use 'default' - added 'protein' to replace 'ag' - New selections can be added move conveniently now, but the use of `PSF_FRAME_ZERO_PKA` gets in the way. Selecting a file from a dictionary based on the selection string would fix this.
That should be easy enough to fix, we should push a self install upstream to the cookiecutter bits. |
I raised an issue for the cookiecutter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good, just some issues surrounding MDA and Python versions.
@IAlibay Is the current state of this good for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIth use of .results
(which is good), the docs also need to be changed
- doc string
- example notebook
- document attributes - fix sphinx rst
self.failed_times = [] | ||
self.results.pkas = [] | ||
self.results.num_failed_frames = 0 | ||
self.results.failed_frames_log = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove failed_frames_log and just use failed_frames?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops misunderstood:frames vs times, will fix
self.num_failed_frames += 1 | ||
self.failed_frames_log.append(self._ts.frame) | ||
self.failed_times.append(self._ts.time) | ||
self.results.num_failed_frames += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
superfluous?
Can we remove failed_frames_log and just use failed_frames?
@ianmkenney sorry, lots of doc updates, please squash eventually or just squash the whole PR |
@IAlibay do the proposed changes work for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I thought I had pushed the request changes a couple hours ago, but for some reason it's not done it...
PYLINTRC: .pylintrc | ||
run: | | ||
pylint propkatraj | ||
pypi_check: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some empty line consistency issues all over this yaml 🤣 it's not technically incorrect so I won't block over it, but I don't know how I'm the only one feeling anxious looking at the formatting..
propkatraj/propkatraj.py
Outdated
perc_failure = (self.results.num_failed_frames / self.n_frames) \ | ||
* 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8 implicit line continuation vs explicit?
Tbh here please do just break PEP8 and put it on one line, line comprehension >>> adhering to 79 chars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm typically on board with that, I don't particularly like the column maximum requirement, especially for an indentation based language. I will gladly switch it back.
setup.py
Outdated
@@ -25,27 +19,25 @@ | |||
classifiers=['Development Status :: 6 - Mature', | |||
'Environment :: Console', | |||
'Intended Audience :: Science/Research', | |||
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', | |||
'License :: OSI Approved :: GNU General Public License v2+ (GPLv2+)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'License :: OSI Approved :: GNU General Public License v2+ (GPLv2+)', | |
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', |
See: https://github.com/pypa/trove-classifiers/blob/main/src/trove_classifiers/__init__.py#L276
packages=['propkatraj'], | ||
scripts=[], | ||
license='GPLv3', | ||
long_description=open('README.md').read(), | ||
long_description_content_type='text/markdown; variant=GFM', | ||
install_requires=['six', 'numpy', 'pandas', 'MDAnalysis<2.0.0', 'propka==3.1'] | ||
python_requires='>=3.8', | ||
install_requires=['numpy', 'pandas', 'MDAnalysis>=2.0.0', 'propka==3.1'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: propka3.1, I can't fully remember. My suggestion is that after this PR we open a separate one that unpins and see what happens.
If I remember correctly 3.2 is broken, then we fixed things upstream and 3.3 works, see: #20. Probably in the next PR just try to pin directly to 3.3 and see if that runs fine, then we can do >=3.3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds reasonable.
- PEP8 requirement ignored in favor of clarity - setup.py license: v2+ -> v2 or later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Are we happy to squash merge? |
Squash away |
get_propka
function (next version must be 2.0.0)get_propka
and changed the baseanalysis test names to be being the standardtest_single_frame_regression