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

Shape dimensions should only be int or float #299

Open
yashu-seth opened this issue Dec 17, 2015 · 9 comments
Open

Shape dimensions should only be int or float #299

yashu-seth opened this issue Dec 17, 2015 · 9 comments

Comments

@yashu-seth
Copy link
Contributor

>>> from pydy.viz.shapes import Sphere,Cube
>>> c = Cube('abcd')
>>> s = Sphere('xyz')
>>> print(s)
Sphere unnamed color:grey material:default radius:xyz
>>> print(c)
Cube unnamed color:grey material:default length:abcd
@yashu-seth
Copy link
Contributor Author

@moorepants I don't think this behavior should be allowed. If you also feel the same, I can send a PR.

@moorepants
Copy link
Member

We work somewhat on the "garbage in/garbage out" principal instead of having tons of type checks, but if you'd like to submit a PR with the type checks I will accept it. Thanks.

@yashu-seth
Copy link
Contributor Author

@moorepants okay i think i'll pass. Can you please help me get started with some beginner friendly issues?

@moorepants
Copy link
Member

This would be a good one to start with: #296

You have to run the examples and see which ones are using deprecated code.

@yashu-seth
Copy link
Contributor Author

@moorepants thank you. I'll look into it.

@oliverlee
Copy link
Contributor

I think the existing PR fixes this but I can't check for a while.
On Dec 17, 2015 15:55, "Yashu Seth" notifications@github.com wrote:

@moorepants https://github.com/moorepants thank you. I'll look into it.


Reply to this email directly or view it on GitHub
#299 (comment).

@yashu-seth
Copy link
Contributor Author

@oliverlee yes, I think you have already sent a PR for this.

@oliverlee
Copy link
Contributor

@yashu-seth I just realized I won't have wifi for a while. so if you'd like to work on it, please do. You can take a look at the existing PR for a starting point.

abhishekgarg16 added a commit to abhishekgarg16/pydy that referenced this issue Mar 20, 2016
This solves Bug pydy#299. A simple check for the datatype.
abhishekgarg16 added a commit to abhishekgarg16/pydy that referenced this issue Mar 21, 2016
@moorepants
Copy link
Member

Note that the shapes support sympy expressions as dimensions, so they shouldn't "only be int or float".

I actually don't see any reason to make these specific type checks. Python code typically follows duck typing and I'm fine if we use the garbage in/garbage out philosophy here. You simply need to have clear docstrings that say what should be passed in. We don't have to have tons of type checks.

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

3 participants