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

renaming universes? #27

Closed
orbeckst opened this issue May 27, 2015 · 1 comment
Closed

renaming universes? #27

orbeckst opened this issue May 27, 2015 · 1 comment
Labels
Milestone

Comments

@orbeckst
Copy link
Contributor

I haven't found a way to rename a universe --- am I missing something? I was looking for

Sim.universes.rename(old, new)

or at least

Sim.universes[new] = Sim.universes[old]
del Sim.universes[old]
@dotsdl
Copy link
Member

dotsdl commented May 29, 2015

Currently, there is no way to directly rename a universe. For now you could do:

s.universes[old]
s.universes.add(new, s.universe.filename, s.universe.trajectory.filenames)
s.universes.resnums(new, s.universe.atoms.resnums)
s.universes[new]
s.selections.copy(old)
s.universes.remove(old)

And this will ensure everything the old universe definition had ends up in the new one, but this is beyond clunky. I aggree this method (Sim.universes.rename()) should be added, and I think the other pythonic expression should work, too (once we have #25, it will be almost trivial). I can add the __delitem__ method immediately so that

del Sim.universes[old]

works as expected.

@dotsdl dotsdl added this to the 0.5.1 milestone Jun 22, 2015
@dotsdl dotsdl closed this as completed in 022f187 Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants