mdanalysis icon indicating copy to clipboard operation
mdanalysis copied to clipboard

Add copy method to AuxReader

Open richardjgowers opened this issue 7 years ago • 4 comments
trafficstars

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 avatar Feb 23 '18 19:02 richardjgowers

@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 ?

navyakhare avatar Mar 29 '18 10:03 navyakhare

Is this something worth reviving for @BFedder's GSoC project?

IAlibay avatar Jun 11 '22 09:06 IAlibay

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: @.***>

richardjgowers avatar Oct 11 '22 07:10 richardjgowers

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.

BFedder avatar Oct 11 '22 16:10 BFedder

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.

orbeckst avatar Oct 17 '22 22:10 orbeckst