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

Change variable iterables from sets back to tuples or lists #385

Open
moorepants opened this issue Dec 5, 2017 · 4 comments
Open

Change variable iterables from sets back to tuples or lists #385

moorepants opened this issue Dec 5, 2017 · 4 comments

Comments

@moorepants
Copy link
Member

Sets are extremely annoying to work with and they don't really offer anything for System.constants_symbols, specifieds_symbols, etc. I'm tire of typing list(sys.constants_symbols) all the time. I think this should be reverted.

@oliverlee
Copy link
Contributor

If I remember correctly, I changed those fields to be sets as order of the symbols was not specified or required in some cases.

Can you share an example where this would help?

@moorepants
Copy link
Member Author

It may be the case that order is not required but sets are particularly annoying to work with from a user perspective. For example, If I have a system and I want to access a particular constant, I can't simply index into the set or I can't pop it (cause I get an arbitrary symbol), etc. I find that the only time I ever use sets is for a quick conversion to one to use unions/intersections/etc or to make a list unique. Other than that they are not friendly for manipulation like lists and tuples are. My pydy related code these days is full of list(sys.constants_symbols)[2] and list(sys.specifieds_symbols)[2], for example.

@oliverlee
Copy link
Contributor

I don't feel too strongly about keeping sets and would be happy to review a PR.

@moorepants
Copy link
Member Author

Ok, thanks. I'll probably be posting a number of PRs over winter break. I am just finishing teaching with sympy/pydy in grad level multibody dynamics and a number of things came up that I want to fix. The most important is getting your pythreejs pr finished up so that we can use Jupyter >= 5.0.

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