NeuroML / pyNeuroML

A single package in Python unifying scripts and modules for reading, writing, simulating and analysing NeuroML2/LEMS models.
https://docs.neuroml.org/Userdocs/Software/pyNeuroML.html
GNU Lesser General Public License v3.0
36 stars 30 forks source link

Added translate_cell function #367

Closed lej0hn closed 4 months ago

lej0hn commented 4 months ago

Aims to solve #360 . Function translates cell so that its soma at the origin of the axes

pgleeson commented 4 months ago

Perhaps a better name for this would be translate_cell_to_origin() as there could be another method translate_cell() which takes a point as an argument and translates it to there..?

lej0hn commented 4 months ago

Yes of course, fixed it

sanjayankur31 commented 4 months ago

Is it worth generalising this to translate_cell where dest is an argument that by default is [0, 0, 0] (origin)? What do you think @lej0hn ?

lej0hn commented 4 months ago

Yes, I think that's a good idea

lej0hn commented 4 months ago

This is ready for review. I changed the name to translate_cell_to_coords thinking there might be a future function, translate_by for example, that could translate the cell by some distance (x,y,z) in the according axis

sanjayankur31 commented 4 months ago

@all-contributors please add @lej0hn for code

allcontributors[bot] commented 4 months ago

@sanjayankur31

I've put up a pull request to add @lej0hn! :tada:

sanjayankur31 commented 4 months ago

@lej0hn : quick question: do you have pre-commit setup so that the files are formatted before being committed? Do check because my pre-commit formatted both files again when I looked at them, suggesting they weren't originally formatted here in the PR

lej0hn commented 4 months ago

No, I don't have pre-commit setup. I will check that

sanjayankur31 commented 4 months ago

Cool, all you have to do is run pre-commit install in the repo, and it'll take care of things automatically after that.

https://github.com/NeuroML/pyNeuroML/blob/development/CONTRIBUTING.md#pre-commit