Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: util to create + include new components in NeuroMLDocuments #430

Merged
merged 5 commits into from
Oct 23, 2024

Conversation

sanjayankur31
Copy link
Member

Adds a utility function to allow users to add new components of user-defined component types to their models.
It creates the component using pylems and saves it to a new xml file. It then includes the xml file in the main model document.

@sanjayankur31 sanjayankur31 added the T: enhancement Type: enhancement label Oct 2, 2024
@sanjayankur31 sanjayankur31 changed the title Feat util new components Feat: util to create + include new components in NeuroMLDocuments Oct 2, 2024
@sanjayankur31
Copy link
Member Author

@pgleeson @borismarin : what do you think of this?

Traditionally, the way we'd do this is to edit the XML file to manually add the new component to the model. Or, we'd define the new component with the new component type. This just does that programmatically---it allows me to create a new component with new parameters using python and saves it to a new XML file that is included in my model.

So, I no longer need to hard code the component with the component type, nor do I need to run my python to create the model and then go edit the XML manually.

@sanjayankur31
Copy link
Member Author

PS: not added it as a function of NeuroMLDocument in libNeuroML to clearly separate what is part of the standard and what is extending it.

Only NeuroML docs can be included in other NeuroML docs. Components are
LEMS constructs and so must be included in the LEMS simulation file.
@sanjayankur31
Copy link
Member Author

Updated: returns the name of the new file, but the user still has to manually include this in the LEMS simulation file. Components are not part of the NeuroML standard and as LEMS bits, they cannot be included in NeuroML files.

@sanjayankur31 sanjayankur31 merged commit 24a1b69 into development Oct 23, 2024
7 checks passed
@sanjayankur31 sanjayankur31 deleted the feat-util-new-components branch October 23, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement Type: enhancement
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant