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

feature request: species name in SimulationResult.all() #449

Open
hungyiwu opened this issue May 21, 2019 · 2 comments
Open

feature request: species name in SimulationResult.all() #449

hungyiwu opened this issue May 21, 2019 · 2 comments

Comments

@hungyiwu
Copy link

I'm using version 1.9.0

Right now in the source code of SimulationResult.all() the species names are given by

sp_names = ['__s%d' % i for i in range(len(self._model.species))]

(link), which then propagates to SimulationResult.dataframe() as column names. Would it be possible to incorporate more informative species names here, like Component name?

@alubbock
Copy link
Member

Hi, thanks for your suggestion. Our original reason for choosing species names like __s1 was for ease of reference. Species can be large complexes of molecules, which would mean their names could run into hundreds of characters, which is not ideal for referencing individual species. That said, I get that there are times when it would be useful to have more meaningful species names, so maybe some kind of user-selected naming option would work. In the meantime, here's how you can achieve what you describe manually:

# Run your simulation, e.g. res = ScipyOdeSimulator(model, ...), then:
new_names = list(res.all.dtype.names)
new_names[:len(model.species)] = [str(s) for s in model.species]
res.all.dtype.names = new_names

@hungyiwu
Copy link
Author

Thank you for the clarification and example! I did not realize the problem with large complexes, and now that design totally makes sense.

I suggest we add this example to the tutorial in the documentation (link) and then close this issue. User-selected naming option doesn't seem to be urgent or essential.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants