suny-downstate-medical-center / netpyne

A Python package to facilitate the development, parallel simulation, optimization and analysis of multiscale biological neuronal networks in NEURON.
http://www.netpyne.org
MIT License
145 stars 136 forks source link

Handle mod files load through netpyne api method #796

Closed ddelpiano closed 7 months ago

ddelpiano commented 10 months ago

Please describe the new feature you'd like to see.

As discussed at the UI sprint meeting, it would be nice to have an api method that takes care of the cells import, computes the md5sum hashes of the mod files loaded and if we try to load the same module twice it skips it, otherwise if it is a different mod with the same name handle the rename for it.

Is your feature request related to a problem? Please describe.

related to the import cell type through UI issues raised recently.

Describe the solution you'd like

already done above

vvbragin commented 9 months ago

Proposed API:

  1. Added new method loaded, skipped = netpyne.sim.load.processModFiles(modFolderPath, forceCompile=False) Returned values: loaded: mechanisms that was successfully loaded during the call. List of 2-element tuples in form (fileName, mechName) skipped: mechanisms that were already loaded prior to the call, so they were skipped this time. list of 3-element tuples in form (fileName, mechName, status), where status takes values: modified/unmodified/unknown. modified - new file and previously loaded file are not the same. Need to notify user that this may have unpredictable consequences, and it's better to change mechanism name unmodified - new and previously loaded files are the same, so no need to notify user. unknown - impossible to tell if files are the same. Probably need to notify user as well.

  2. Modified the existing netpyne.sim.load.loadModel(), now it gets an additional argument returnLoadMechStatus, which is False by default, and if True, the method returns loadedMods, skippedMods (in same format as described above) in addition to simConfig and netParams

vvbragin commented 7 months ago

Done: https://github.com/suny-downstate-medical-center/netpyne/pull/803