-
Notifications
You must be signed in to change notification settings - Fork 667
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
[DOC] doctest MEGA-issue #3925
Comments
Another idea would be to add the doctest in the CI and allow it to fail for now, then once we're passing make it another row in the CI. |
Hey maintainers, I want to work on this issue but I don't have enough knowledge, so can you please assign me and guide me through it? |
Hi @sahilempire sorry for the slow response. To address this issue you will need to run This will show you a bunch of failing doctests which we would like to fix up. Submit a PR fixing one or more! See our contributing guide for more info. |
Hi, I would also like to work on this issue. @sahilempire Have you already resolved some of the errors? Maybe we can split the work as there are a lot of failing examples? |
@chrispfae I haven't done anything in this yet and if you want to do something then you can do it. |
The point of this issue is that there are lots of things that need addressing and so it is assumed that folks might only tackle a smaller section of the failures. Please do raise PRs with fixes - we generally go on a "first PR basis", but we do appreciate it if folks want to coordinate so as to not duplicate efforts. |
Hello @hmacdope , I would like to contribute on this issue . Please assign me and guide throughout period. |
Respected Sir/madam, I am a 1 year experienced programmer, please let me work on this issue. |
Hi I want to solve this issue. could you please assign this to me |
* Adds missing imports in docstrings in MDAnalysis.core.topology * solves failing darker_lint * Part of #3925 for MDAnalysis.core.topology Co-authored-by: Pratham Chauhan <[email protected]>
To everyone who wants to work on this issue: that's great. But please note that we do not assign issues. Instead you should do the work and submit a PR that references this issue. Normally, we only look at the first PR for each issue (see our GSOC FAQ Can I claim an issue to work on?) but for this umbrella issue we will look at any PR that addresses non-overlapping fixes. When you start working on one doc test, check any linked, open PRs so that you only start work on an issue that has not been addressed yet. |
You can also look at merged linked PRs to see how to do it. |
resolves one of many inconsistencies in doctests as described in issue MDAnalysis#3925
* Fix doctest for MDAnalysis.analysis.encore.similarity * part of #3925
* Towards MDAnalysis#3925 * Add imports to asunique() examples * Fix code logic for ag*.ix in unique() and asunique(): change expected array to specify dtype=int64 * Fixes 102 failing tests (344 failures -> 242 failures)
code: cluster.py Error: UNEXPECTED EXCEPTION: AttributeError("'ClusterCollection' object has no attribute 'metadata'")
Traceback (most recent call last):
File "/home/heet/anaconda3/envs/mdanalysis-dev/lib/python3.10/doctest.py", line 1350, in __run
exec(compile(example.source, filename, "single",
File "<doctest MDAnalysis.analysis.encore.clustering.cluster.cluster[10]>", line 1, in <module>
File "<doctest MDAnalysis.analysis.encore.clustering.cluster.cluster[10]>", line 1, in <listcomp>
AttributeError: 'ClusterCollection' object has no attribute 'metadata'
/home/heet/Work/Development/mdanalysis/package/MDAnalysis/analysis/encore/clustering/cluster.py:145: UnexpectedException
===================================================== short test summary info =====================================================
FAILED analysis/encore/clustering/cluster.py::MDAnalysis.analysis.encore.clustering.cluster.cluster |
If you manually follow the example (eg in ipython or Jupyter) do you get the same error, i.e., the object misses the attribute? If yes, then look through the documentation to see if the attribute is documented and ought to exist. If it is documented but not there, raise an issue. If it’s not documented, remove the example. |
>>> print([type(cluster) for cluster in cluster_collection][:2])
[<class 'MDAnalysis.analysis.encore.clustering.ClusterCollection.ClusterCollection'>,
<class 'MDAnalysis.analysis.encore.clustering.ClusterCollection.ClusterCollection'>]
>>> print([cluster.metadata["ensemble_membership"]
... for cluster in cluster_collection][:2])
[array([1, 1, 1, 1, 2]), array([1, 1, 1, 1, 1])]
AttributeError: 'ClusterCollection' object has no attribute 'metadata'
|
If the docs state that |
These are old docs (see the 2.0.0 in the URL and check the version menu in the lower left hand corner of the screen). 2.7.0 docs look fine to me. |
I am hoping to fix a doctest as part of my GSoC 2024 application and to get more familiar with the codebase, as I have only really utilised the analysis classes. I have set my cd to |
@lunamorrow could you post the error log here? Incidentally, while you can do a doctest problem for your GSOC PR. I would reccomend doing an issue that has you tackling a more coding than a docs problem, as more substantial and will show your skills better. |
Ok noted, thanks @hmacdope, I will look for another issue to tackle. I saw a few tagged with GSOC starter that did not already have a pull submitted, but it seems someone has already requested to do them for their GSOC PR and I did not want to double up as I understand contributions/pull requests are on a first submitted basis. I will have another look :) |
* part of #3925 (doc test mega issue) * Fixed all failing doctests in groups.py using sphinx directives NOTE: These tests will not pass using `pytest -v --disable-pytest-warnings --doctest-modules` since I used sphinx directives to allow for concise example code. This can be changed but the documentation will become more verbose. * Updated CHANGELOG
Sorry for the auto-close! Thank you for noticing and re-opening @IAlibay ! |
* contributes to #3925 * fix analysis.align doctest errors: added :: in the end of two sentences, to remove two "not defined" errors * Update AUTHORS
Sorry, writing "partially fixes ISSUE" apparently auto-closes. Re-opening. |
In order to make it easier to manage this big parent issue, could we ask contributors who want to do doctest fixing to do the follwing:
In this way contributors learn to raise issues and work on an immediately well-defined problem, and we better keep track of what's open and closed, and we don't accidentally close this omnibus issue. |
* contributes to #3925 * fix lammps.py doctest errors
Expected behavior
All the code in our docstring examples should be self-contained and run on its own. They should:
Actual behavior
A lot of the examples in our docs do not run correctly as they are missing imports, steps, some code logic or all of the above.
By my initial count there are ~350 failing examples and only a handful that work.
We would love this to be fixed! This is a great opportunity for community members and budding open source contributors to get involved as there are lots of docstrings to tackle.
Luckily there is a way to test which doc examples are failing programatically!
/package/doc/sphinx
directorymake doctest
This will indicate which doc examples are failing.
If you want to tackle multiple doc changes at once editing your makefile command on L130 to include
--keep-going
will allow you to see the full set of errors.eg
Please contribute your changes in a new PR!
If you are new to making PRs and github in general, try our handy contributing guide! Feel free to ping our team if unsure. :)
The text was updated successfully, but these errors were encountered: