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

Use numbers abstract base class #236

Merged
merged 3 commits into from
Nov 12, 2015

Conversation

jdemeyer
Copy link
Contributor

Be compliant with PEP 3141: replace code like isinstance(foo, (int, float)) by isinstance(foo, numbers.Real). This is in particular needed for better SageMath support.

@jdfreder
Copy link
Contributor

Looks like the tests themselves are failing at a lower level, in the widgets themselves. We use traitlets to strictly type min and max to int and float, so I think the SageMath numbers are conflicting with that. You'll either need to implement custom trait types that does the type checking how you propose here and then sprinkle those throughout the widgets, or probably better, open a PR against ipython/traitlets fixing the validation logic of Int and Float accordingly.

@jdemeyer
Copy link
Contributor Author

Looks like the tests themselves are failing at a lower level, in the widgets themselves

Can you please tell me how to run the testsuite? I have no idea...

@jdemeyer
Copy link
Contributor Author

I spoke too quickly. How to run the tests is in README.md, not in CONTRIBUTING.md (which I would find more logical).

@jdemeyer
Copy link
Contributor Author

I think the SageMath numbers are conflicting with that.

Why do you think that? I tested the @interact in SageMath and it works.

@jdfreder
Copy link
Contributor

Can you please tell me how to run the testsuite? I have no idea...

I spoke too quickly. How to run the tests is in README.md, not in CONTRIBUTING.md (which I would find more logical).

Another way is to peak at how our CI (Travis) does it, defined in .travis.yml in the repo root.
nosetests --with-coverage --cover-package=ipywidgets ipywidgets runs the Python tests, which were failing.

Why do you think that? I tested the @interact in SageMath and it works.

Awesome, glad it's working. It was an erroneous conclusion on my part after a quick look at the test output.

jdfreder added a commit that referenced this pull request Nov 12, 2015
@jdfreder jdfreder merged commit 7fceb35 into jupyter-widgets:master Nov 12, 2015
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 27, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request proposal resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants