Skip to content

API for converters #2790

@cbouy

Description

@cbouy

Is your feature request related to a problem?

Currently, converters are called with the convert_to method, e.g. u.atoms.convert_to('PARMED'). This requires users to:

  1. Check the docstring for which converters are available
  2. Use all caps for the converter name

Describe the solution you'd like

Add to_lib methods for all converters, e.g. u.atoms.to_parmed(). This allows users to use auto-completion to quickly check for which converters are available after typing to_.
Optionally, allowing u.atoms.convert_to('parmed') would be great as it feels more natural

Describe alternatives you've considered

u.atoms.parmed(), i.e. pytorch style, but it's less useful for auto-completion

Additional context

Discussed in PR #2775 (more technically here)
Currently concerns the ParmEd converter, and will also concern the RDKit converter in 2.0.0

Tagging @lilyminium @RMeli @richardjgowers @IAlibay

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions