mdanalysis
mdanalysis copied to clipboard
Change order of arguments for adding auxiliary data for 3.0 release
Is your feature request related to a problem?
Currently, auxiliary data is added as such:
aux = mda.auxiliary.EDR.EDRReader(edr_file)
u.trajectory.add_auxiliary(aux_spec, aux)
i.e.
u.trajectory.add_auxiliary({"temp": "Temperature"}, aux)
Adding all data is done as such:
u.trajectory.add_auxiliary(auxdata=aux)
aux_spec
and aux_data
both are optional arguments for this solution. Changing the order and making auxdata
mandatory is preferable, but is a breaking change to the aux framework.
Describe the solution you'd like
In 3.0, the order of aux_spec
and aux_data
should be switched, and only aux_spec
should be optional and default to None.
Then, adding all auxdata could be done as such:
u.trajectory.add_auxiliary(aux)
This will require changes in coordinates.base.add_auxiliary and the tests. I have left a TODO comment there.
Describe alternatives you've considered
Leave as is
Additional context
For more context on how the auxiliary system works, see my blog
You could create the PR and it will wait until we are getting ready for 3.0. According to @IAlibay on twitter, this will be September 2023. So no rush... but it would be nice to have it queued up, especially if it only touches code related to aux.
We also need a reminder to deprecate the old functionality — that should go into 2 releases prior to 3.0.