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

Use Results class for WaterBridge analysis #3287

Merged
merged 96 commits into from
May 10, 2021

Conversation

RMeli
Copy link
Member

@RMeli RMeli commented May 7, 2021

Fixes #3270

Changes made in this Pull Request:

  • results.network
  • results.table
  • results.timeseries

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

RMeli and others added 30 commits August 7, 2019 18:41
Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • timeseries should become a result
  • generate_tables() should return table (and for 2.x, continue storing it in .table) — not really related to results but now is the right time to make such a change

Otherwise looking good.

Additional eyes (especially @xiki-tempula and @IAlibay ) would be appreciated.

@PicoCentauri and @joaomcteixeira might want to take a look to see what kind of data structures are coming mdacli's way...

package/CHANGELOG Outdated Show resolved Hide resolved
package/CHANGELOG Outdated Show resolved Hide resolved
@@ -1751,14 +1767,14 @@ def generate_table(self, output_format=None):
"""Generate a normalised table of the results.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add explanations

Parameters
----------
output_format : {'sele1_sele2', 'donor_acceptor'}
     The output format of the `table` can be changed a fashion similar to
     :attr:`WaterBridgeAnalysis.results.timeseries` by changing the labels
     of the columns of the participating atoms.

Returns
-------
table : numpy.recarray
     A "tidy" table with one hydrogen bond per row, labeled according to 
    `output_format` and containing information of atom_1, atom_2, distance,
    and angle.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's an explanation of the format of table then it could go here, at least in a short version.

package/CHANGELOG Show resolved Hide resolved
Comment on lines 1825 to 1831
@property
def table(self):
wmsg = ("The `table` attribute was deprecated in MDAnalysis 2.0.0 "
"and will be removed in MDAnalysis 3.0.0. Please use "
"`results.table` instead")
warnings.warn(wmsg, DeprecationWarning)
return self.results.table
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove — I don't think that we normally wrap attributes that are to be removed. Or do we, @IAlibay ?

Otherwise you need to store self.table in self._table and then use the property that you have here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've missed part of the conversation here, what's the difference between this and say network below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table will not be made a results.table. Instead we want to completely remove it for 3.0.0 (so that users will just use generate_table() to create it when they need it.

If you think we should issue a deprecation warning for the use of the attribute then we can do it. (I would then create self._results and have the table property just return that so that we don't trigger the warning when we set table in generate_table().)

Alternatively, we just put in a deprecation in the docs/CHANGELOG and be done.

Copy link
Member

@IAlibay IAlibay May 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we just put in a deprecation in the docs/CHANGELOG and be done.

Sounds sensible to me.

testsuite/MDAnalysisTests/analysis/test_wbridge.py Outdated Show resolved Hide resolved
Copy link
Contributor

@xiki-tempula xiki-tempula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work. A few questions.

@@ -1520,35 +1559,12 @@ def analysis(current, output, *args, **kwargs):

timeseries = property(_generate_timeseries)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is always instant.

@RMeli RMeli marked this pull request as ready for review May 10, 2021 09:34
Copy link
Contributor

@xiki-tempula xiki-tempula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the work.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor doc issues

package/CHANGELOG Outdated Show resolved Hide resolved
package/CHANGELOG Outdated Show resolved Hide resolved
@orbeckst orbeckst added this to the 2.0 milestone May 10, 2021
@orbeckst
Copy link
Member

Thank you @RMeli and @xiki-tempula . I updated and merged the CHANGELOG. We're now just waiting for CI.

@IAlibay please feel free to merge if you get to it before I do.

@IAlibay
Copy link
Member

IAlibay commented May 10, 2021

Looks like #2942 will fix the current failures seen here @orbeckst, I'll leave it up to you if you want to wait until that is merged or just merge this one ahead of that.

(I do note that test coverage is somewhat low on the diff here, but I guess we can deal with this in a separate PR).

@orbeckst
Copy link
Member

I checked the diff coverage https://app.codecov.io/gh/MDAnalysis/mdanalysis/compare/3287/diff and don't see a problem. Happy to merge.

@orbeckst orbeckst merged commit d0fc581 into MDAnalysis:develop May 10, 2021
@RMeli RMeli deleted the waterbridge-results branch May 11, 2021 08:31
@RMeli
Copy link
Member Author

RMeli commented May 11, 2021

Thanks @orbeckst and @xiki-tempula for the insightful comments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update hydrogenbonds.WaterBridgeAnalysis to use .results
5 participants