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

Rewrite Parsers #572

Closed
17 tasks done
richardjgowers opened this issue Dec 8, 2015 · 13 comments
Closed
17 tasks done

Rewrite Parsers #572

richardjgowers opened this issue Dec 8, 2015 · 13 comments

Comments

@richardjgowers
Copy link
Member

All parsers need to have their output changed to a Topology object. These should only now return values that are defined in the format (no guessing & no default values).

For details on the new structures, see:
https://github.com/MDAnalysis/mdanalysis/wiki/Guide-to-new-Topology-format

It is also possible to add in Attributes for values that were previously ignored

  • CRDParser
  • DLPolyParser
  • DMSParser
  • ExtendedPDBParser
  • GMSParser
  • GROParser
  • HoomdXMLParser
  • LAMMPSParser
  • MOL2Parser
  • PDBParser
  • PDBQTParser
  • PQRParser
  • PrimitivePDBParser
  • PSFParser
  • TOPParser
  • TPRParser
  • XYZParser
@orbeckst
Copy link
Member

Is this really easy for a newcomer or "just" easy for someone in @MDAnalysis/coredevs ?

@richardjgowers
Copy link
Member Author

I think I called it easy because it's (mostly) just filling numpy arrays with stuff from the file, rather than filling Atom objects. So it's just converting the existing parsers really.

@jbarnoud
Copy link
Contributor

What is the status of the tests? Are they still relevant? I am mostly concerned about MDAnalysisTests.topology.test_topology._TestTopology (that is MDAnalysisTests.test_topology._TestTopology in the develop branch). Indeed, I plan to tackle the TPR parser, most tests of which inherit from _TestTopology.

@richardjgowers
Copy link
Member Author

Long story short, the current tests aren't very good because they need to create a Universe. The new Topology object should work as a standalone object, so the new tests for topology won't have to involve a Universe.

I'll try and get a new test template done soon, but it will likely just have to inspect each of the numpy arrays inside each Attribute in the Topology object.

If you want to look at doing TPR, on the issue-363 branch, GROParser is a fairly good example of what needs to be done.

@jbarnoud
Copy link
Contributor

@richardjgowers
Great! I'll see what I can do for the TPR parser then.

Quick remark: it may be good to list the attributes a child of ParserBase must define in the docstring of the class. Of course, one can read the code or copy TestGROParser but it is better when a class has its own doc.

jbarnoud added a commit to jbarnoud/mdanalysis that referenced this issue Dec 13, 2015
See MDAnalysis#572

Some other changes where also done:
* `MDAnalysis/core/__init__.py` import `selection` rather than
  `Selection` following the module renaming in commit
  78abe4e
* Add messages when some assertions fail in
  `MDAnalysisTests/topology/base.py`
jbarnoud added a commit to jbarnoud/mdanalysis that referenced this issue Dec 13, 2015
See MDAnalysis#572

Some other changes where also done:
* `MDAnalysis/core/__init__.py` import `selection` rather than
  `Selection` following the module renaming in commit
  78abe4e
* Add messages when some assertions fail in
  `MDAnalysisTests/topology/base.py`
@richardjgowers richardjgowers self-assigned this Dec 19, 2015
@dotsdl
Copy link
Member

dotsdl commented Dec 19, 2015

@richardjgowers clearly you had a relaxing vacation. :D

@richardjgowers
Copy link
Member Author

Wasn't too bad in the end :D We need to get the benchmarks up really, show everyone why we're even bothering to get this done

@dotsdl
Copy link
Member

dotsdl commented Dec 19, 2015

Do you want help on that front? Did you check if the performance of any of these parsers improved from these changes alone?

@richardjgowers
Copy link
Member Author

Yeah I was going to add the select_atoms benchmarks in too, so if you could
throw the notebook up and maybe add some quick selection benchmarks that'd
be good.

On Sat, 19 Dec 2015 17:57 David Dotson notifications@github.com wrote:

Do you want help on that front? Did you check if the performance of any of
these parsers improved from these changes alone?


Reply to this email directly or view it on GitHub
#572 (comment)
.

@richardjgowers
Copy link
Member Author

Oh, and I've not checked individual parsers, but I expect none will be
slower, many will be faster. I did a little refactoring for a few.

On Sun, 20 Dec 2015 08:40 Richard Gowers richardjgowers@gmail.com wrote:

Yeah I was going to add the select_atoms benchmarks in too, so if you
could throw the notebook up and maybe add some quick selection benchmarks
that'd be good.

On Sat, 19 Dec 2015 17:57 David Dotson notifications@github.com wrote:

Do you want help on that front? Did you check if the performance of any
of these parsers improved from these changes alone?


Reply to this email directly or view it on GitHub
#572 (comment)
.

@dotsdl
Copy link
Member

dotsdl commented Dec 21, 2015

@richardjgowers I'll throw it up as a gist today. Any selections in particular you think showcase the best the new behavior? Also, on which system?

@dotsdl
Copy link
Member

dotsdl commented Dec 21, 2015

Here's the link: https://gist.github.com/dotsdl/0e0fbd409e3e102d0458

Haven't added selections yet, but can update the notebook later on.

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

No branches or pull requests

4 participants