mdanalysis
mdanalysis copied to clipboard
Add copy method to AuxReader
A copy method needs to be added to MDAnalysis.auxiliary.base.AuxReader which should work similarly to the ReaderBase copy method. This should then be extended to include the XVGReader.
@richardjgowers once copy method is implemented in Auxreader , it'll be called via ReaderBase copy method :
for auxname, auxread in self._auxs.items():
new.add_auxiliary(auxname, auxread.copy())
return new
so how to add testcases for this method? as u mentioned earlier that base reader has its own set of test cases, so should this be integrated there? or it should be integrated in test_copying.py for which we'll have to define format for AuxReader ? For the copy method itself, auxname and **kwargs (auxdata) should be copied ?
Is this something worth reviving for @BFedder's GSoC project?
Its required to make a Universe with aux Readers copyable, so it’d be great if they’re getting popularised
On Sat, Jun 11, 2022 at 10:02, Irfan Alibay @.***> wrote:
Is this something worth reviving for @BFedder https://github.com/BFedder's GSoC project?
— Reply to this email directly, view it on GitHub https://github.com/MDAnalysis/mdanalysis/issues/1785#issuecomment-1152885669, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGSGB2LP7BQGFVBJOH2ONDVORI3HANCNFSM4ESFKCVA . You are receiving this because you were mentioned.Message ID: @.***>
I had a quick look, is there any reason why the copy method couldn't just take the output from mda.auxiliary.base.get_description to create and return a new instance of the AuxReader? Because if that's okay that would be a reasonably quick fix, but I feel like I'm missing something obvious.
As discussed on the call today with @BFedder @hmacdope @IAlibay , we need the aux copy(). Starting with your idea, @BFedder , looks like a sensible first step.
I suggest to then look at Reader.copy() and mirror the behavior for consistency.