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

Update for external mdahole2 mdakit #4464

Merged
merged 9 commits into from
Mar 4, 2024
Merged

Update for external mdahole2 mdakit #4464

merged 9 commits into from
Mar 4, 2024

Conversation

IAlibay
Copy link
Member

@IAlibay IAlibay commented Feb 23, 2024

Fixes #4414

Changes made in this Pull Request:

  • Switches all imports in the hole2 analysis module to use the mdakit mdahole2.

PR Checklist

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

Developers certificate of origin


📚 Documentation preview 📚: https://mdanalysis--4464.org.readthedocs.build/en/4464/

Copy link

github-actions bot commented Feb 23, 2024

Linter Bot Results:

Hi @IAlibay! Thanks for making this PR. We linted your code and found the following:

Some issues were found with the formatting of your code.

Code Location Outcome
main package ⚠️ Possible failure
testsuite ⚠️ Possible failure

Please have a look at the darker-main-code and darker-test-code steps here for more details: https://github.com/MDAnalysis/mdanalysis/actions/runs/8043270736/job/21965086091


Please note: The black linter is purely informational, you can safely ignore these outcomes if there are no flake8 failures!

Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.66%. Comparing base (3a5339c) to head (af1b08d).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4464      +/-   ##
===========================================
+ Coverage    93.38%   93.66%   +0.28%     
===========================================
  Files          171      180       +9     
  Lines        21744    22270     +526     
  Branches      4014     3902     -112     
===========================================
+ Hits         20305    20859     +554     
- Misses         952      959       +7     
+ Partials       487      452      -35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@IAlibay IAlibay marked this pull request as ready for review February 24, 2024 06:59
Copy link
Member

@RMeli RMeli left a comment

Choose a reason for hiding this comment

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

LGTM. The only (non-blocking) question I have is: it is really worth it to add an additional external dependency for something that is deprecated?

package/MDAnalysis/analysis/hole2/__init__.py Outdated Show resolved Hide resolved
Comment on lines 23 to 25
This module is deprecated in favour of the mdakit
`mdahole2 <https://www.mdanalysis.org/mdahole2/>`_ and
will be removed in MDAnalysis 3.0.0.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This module is deprecated in favour of the mdakit
`mdahole2 <https://www.mdanalysis.org/mdahole2/>`_ and
will be removed in MDAnalysis 3.0.0.
This module is deprecated in favour of the mdakit
`mdahole2 <https://www.mdanalysis.org/mdahole2/>`_ and
will be removed in MDAnalysis 3.0.0.

Is this indentation correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it doesn't matter all that too much with sphinx, but I've added it, thanks!

@@ -44,6 +44,7 @@ dependencies = [
'mda-xdrlib',
'waterdynamics',
'pathsimanalysis',
'mdahole2',
Copy link
Member

Choose a reason for hiding this comment

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

This is going to be annoying to package upstream, but it's a "me" problem.

Copy link
Member

@orbeckst orbeckst Feb 25, 2024

Choose a reason for hiding this comment

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

(EDIT: This comment refers to @RMeli 's comment of downstream pain in packaging)

Because you need to make hole2 available in spack?

Copy link
Member

Choose a reason for hiding this comment

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

I thought so, but looking at mdahole2's dependencies it does not look like hole2 is provided, is it? So packaging mdahole2 would be easier, although I don't think it would make much sense to provide a downstream Spack package without hole2 TBH.

Copy link
Member

Choose a reason for hiding this comment

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

We have a hole2 cf package https://anaconda.org/conda-forge/hole2 for Linux and osx — just not for Windows.

Copy link
Member

Choose a reason for hiding this comment

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

We didn't include it as a dependency because ... well, because we only got the conda-forge package recently and used the reasoning for the pip package (see also MDAnalysis/mdahole2#25 ) that people should be able to use their own hole2 installation (as it worked previously).

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to clarify the current situation here:

  1. PyPi mdahole2 / pure pip install - has no hole2 dependency. This is because we can't distribute hole2 over pypi at the moment.
  2. conda-forge mdahole2-base: has no hole2 dependency - this exists for all the os & architecture types where hole2 can't be used. The combination of MDAnalysis & mdahole2-base effectively replicates the current status of the MDA core library where we ask folks to install hole2 themselves.
  3. conda-forge mdahole2: for x86_64 linux and macos this is mdahole2-base + hole2

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for explaining. I won't resolve the comment, just so that it remains visible.

@IAlibay
Copy link
Member Author

IAlibay commented Feb 25, 2024

Thanks @RMeli

Re: extra dependencies - unfortunately this is a temporary pain to avoid another one. The reasons for importing things directly rather than keeping the old code around are 1) to avoid having to back port a bunch of stuff (happened a few times already for hole2), 2) to get folks used to the idea of the mdakit - i.e. "you've been using them all along", is better than "ok starting from now you have to trust this instead".

From a packaging perspective, I have only been thinking about pypi and conda-forge, sorry :( How much work is it elsewhere? I would have hoped that folks were just pulling from pypi for pure python projects.

@IAlibay
Copy link
Member Author

IAlibay commented Feb 25, 2024

I'm going to cc @orbeckst @fiona-naughton @lilyminium into this discussion.

My opinion here is very likely biased since I've spent a decent chunk of time on the mdakit migrations. However, we should make sure that everyone is happy with the plan to add in these temporary core dependencies.

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
@RMeli
Copy link
Member

RMeli commented Feb 25, 2024

If the module is deprecated we don't need to back port stuff IMO, we can just point to the MDAKit if users have problems (which the code itself already does).

Packaging upstream is not too hard, but you still need to write the package file etc. I should do it anyways for the MDAKits we own.

However, my concern here is adding an external dependency when we know we will remove it. It looks like the worst option, the other two being (1) deprecate but leave the old code until removal (without backporting fixes and improvements) or (2) leave the MDAKit as an external dependency, i.e. use the MDAKit code but don't deprecate the module.

@IAlibay
Copy link
Member Author

IAlibay commented Feb 25, 2024

If the module is deprecated we don't need to back port stuff IMO, we can just point to the MDAKit if users have problems (which the code itself already does).

I disagree, it's deprecated but we still need to ensure that folks get the right outcomes, i.e. it's deprecated for us not for them. The code here pointing to the new kit is actually a mistake - when we originally created mdahole2 we hadn't packaged it, so we included a deprecation notice but didn't replace the imports.

Packaging upstream is not too hard, but you still need to write the package file etc. I should do it anyways for the MDAKits we own.

That would be useful if you want to do it, but it could also fall under the scope of someone working in EOSS4 if it's time you'd rather not spend on this task.

However, my concern here is adding an external dependency when we know we will remove it. It looks like the worst option, the other two being (1) deprecate but leave the old code until removal (without backporting fixes and improvements) or (2) leave the MDAKit as an external dependency, i.e. use the MDAKit code but don't deprecate the module.

I think the issue here is that you end up with a mess of fixes that are done mostly here and need to get moved to mdahole2. Then we keep facing having to tell folks "no actually do this change over there", to which folks will go "but I'm not using that thing I'm using the core library" or if it's ourselves "but not fixing this here means that we don't get to support Y in the core library".

A good example of this is doing numpy 2.0 fixes. MDA 3.0 will likely come out after numpy 2.0. If we want to support it then we have to make relevant fixes here and then also in the kit. It's not excessively problematic, but it does have a time cost.

w.r.t. not deprecating - that's in the territory of roadmap 3.0 stuff and I'm not sure I have a strong enough opinion.

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.

Thanks for doing all the work @IAlibay .

I agree with #4464 (comment) that we need to bite the bullet and increase dependencies while we're still shipping a thin version of mdahole2 — it's on us to make it work while we're going through deprecation, not on our users. Sorry @RMeli — I understand the desire to make clean breaks but that seems too user-unfriendly.

package/CHANGELOG Outdated Show resolved Hide resolved
maintainer/conda/environment.yml Show resolved Hide resolved
@@ -44,6 +44,7 @@ dependencies = [
'mda-xdrlib',
'waterdynamics',
'pathsimanalysis',
'mdahole2',
Copy link
Member

@orbeckst orbeckst Feb 25, 2024

Choose a reason for hiding this comment

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

(EDIT: This comment refers to @RMeli 's comment of downstream pain in packaging)

Because you need to make hole2 available in spack?

@RMeli
Copy link
Member

RMeli commented Feb 25, 2024

deprecate but leave the old code until removal (without backporting fixes and improvements)

To clarify my comment, which was poorly phrased, I was not advocating to leave the code go bad. I was thinking of just not backporting fixes or enhancement from the MDAKit to change the behaviour (i.e. if there was a bug pre-deprecation, it would stay during deprecation). As a user I'd expect deprecated code to work as at time of deprecation (bugs included).

However, I was not aware of big changes that would mean a lot of work, which would incur in high maintenance costs (and are therefore not viable/acceptable).

w.r.t. not deprecating - that's in the territory of roadmap 3.0 stuff and I'm not sure I have a strong enough opinion.

Yeah, I'm just wondering if it's really worth removing a thin wrapper to an MDAKit once it's already in core.

@IAlibay
Copy link
Member Author

IAlibay commented Feb 26, 2024

However, I was not aware of big changes that would mean a lot of work, which would incur in high maintenance costs (and are therefore not viable/acceptable).

I wouldn't say "high maintenance cost" - porting fixes across the core library & kits isn't a big thing in isolation (couple of lines here and there), but it becomes an extra thing to think about / do when you already have a tiny number of maintainers. A couple half hours here and there and the cost starts really adding up.

@IAlibay
Copy link
Member Author

IAlibay commented Feb 26, 2024

I'll leave this PR up for a little while longer so that folks get to discuss a bit more - we can merge when everyone is happy.

@RMeli RMeli merged commit d366921 into develop Mar 4, 2024
24 checks passed
@RMeli RMeli deleted the mdahole2 branch March 4, 2024 20:36
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.

Replace hole2 imports with mdakit-hole2 imports
3 participants