Logged-In As
ACCOUNT
Not Logged In
Remove bare except statements SymPy
Status: Closed Time to complete: 48 hrs Mentors: Matthew Rocklin, Vladimir Perić, Stefan Krastanov, Aaron Meurer Tags: Python
Please see http://code.google.com/p/sympy/issues/detail?id=2570 for full information on this task.

Please read https://github.com/sympy/sympy/wiki/gci-2011-landing before completing any tasks for SymPy.

Uploaded Work
File name/URL File size Date submitted
https://github.com/sympy/sympy/pull/784 n/a November 30 2011 11:22 UTC
Comments
Tsvetelina on November 26 2011 12:25 UTC Task Claimed

I would like to work on this task.

Tsvetelina on November 26 2011 18:12 UTC Claim Removed

The claim on this task has been removed, someone else can claim it now.

Tsvetelina on November 26 2011 19:36 UTC Task Claimed

I would like to work on this task.

Aaron Meurer on November 27 2011 01:39 UTC Task Assigned

This task has been assigned to Tsvetelina. You have 48 hours to complete this task, good luck!

Tsvetelina on November 27 2011 06:31 UTC Where is the file in which i have to remove bare exception statments?

I can't find it in the links you have given

Ondřej Čertík on November 27 2011 06:41 UTC Files

Read the second link to see how to checkout the latest sympy repository (please ask if you can't figure it out). Then go into the sympy repository and do:


 


git grep "except:"


 


On my machine it prints:


 


data/TeXmacs/bin/tm_sympy:        except:


data/TeXmacs/bin/tm_sympy:            except:


examples/all.py:        except:


examples/intermediate/sample.py:    except:


examples/intermediate/sample.py:    except:


examples/intermediate/sample.py:        except:


examples/intermediate/sample.py:    except:


examples/intermediate/sample.py:    except:


examples/intermediate/sample.py:            except:


setup.py:        except:


sympy/core/basic.py:            except:


sympy/core/evalf.py:            except:


sympy/matrices/matrices.py:            except:


sympy/mpmath/ctx_fp.py:        except:


sympy/mpmath/ctx_fp.py:        except:


sympy/mpmath/ctx_iv.py:            except:


sympy/mpmath/ctx_iv.py:            except:


sympy/mpmath/functions/zeta.py:        except:


sympy/mpmath/libmp/backend.py:    except:


sympy/mpmath/libmp/backend.py:    except:


sympy/mpmath/libmp/libmpf.py:    except:


....

And those are the files to fix.

Tsvetelina on November 27 2011 06:52 UTC Thank you

For the quick response

Tsvetelina on November 27 2011 09:34 UTC Tests

The tests in sympy/bin run the code in which i have to remove the bare exception statments,rigth?

Stefan Krastanov on November 27 2011 11:17 UTC Tests

The tests scripts (test and doctest) in sympy/bin run the doctests (that are part of the comments on the code) and the rest of the tests (that are in the test folder of every module). Every part of the code is covered by those, so yes, they will also run the code that you are editing.


you can run just a subset of the test by giving the directory of the submodule as an argument:


./bin/tests sympy/the_submodule/the_subsubmodule/.../tests


 

Tsvetelina on November 27 2011 11:22 UTC Uploading here?

Ok. And about uploading my work - can i just upload here the files i edit in case i couldn't upload them in github.com ?

Stefan Krastanov on November 27 2011 12:14 UTC upload at github

If the fixes are not commited to our gitserver they are useless for us. Please read our langding page, it explains why we use git. Downloading them from here and adding them ourselfs will take much time.


If you have problems with git ask on #sympy. There is also a tutorial about git on our langding page.

Tsvetelina on November 27 2011 12:21 UTC Ok

Ok.Thank you for answering.

Ondřej Čertík on November 27 2011 21:38 UTC git

You can also ask on the sympy mailinglist if you have problems with git or github. We'll help.

Tsvetelina on November 28 2011 09:08 UTC Problem with no running tests

I can't run the test in sympy/plotting/test.  In them is said that they will run if the version of ctypes is > 1.0.0. So that means that my versionn is < 1.0.0. How can i uptade my version? I searched in Google but i didn't find anything that says how to do it.

Vladimir Perić on November 28 2011 11:12 UTC Python version

Which version of Python are you using? ctypes should be included by default from Python 2.6 onwards; if you are using 2.5 running "easy_install ctypes" should be enough (that's Linux/Mac, don'tknow for Windows). If that doesn't help, can you please post the full output of that test failure and we'll go from there. Thanks!

Tsvetelina on November 28 2011 12:03 UTC Python version

I am using Ubuntu 11.10 and Python 2.7.2+ and when i run ./bin/test sympy/plotting/tests it prints out that:


============================= test process starts ==============================
executable:   /usr/bin/python  (2.7.2-final-0)
architecture: 32-bit
cache:        yes
ground types: python
random seed:  21384383


================== tests finished: 0 passed, in 0.02 seconds ===================


And this happens only with plotting. All of the other test - for core,utilities and etc. print out what they test and OK or FAIL


And i have one more queston: Is there some site where i can read about the exception thrown by SymPy functions? I am almost done with the task - i have to do the plotting file and one file in utilies.


Thanks for the quick response.

Vladimir Perić on November 28 2011 12:08 UTC Pyglet

Ah, you actually don't have pyglet installed, so the plotting tests are automatically disabled (it's the next code block after checking for ctypes). Just install pyglet and it will be fine - you can probably find it in your repos (python-pyglet I guess), or using easy_install or pip (if you have it) should also work. Then you'll be able to run the tests. That output happens whenever you try to run some tests that don't exist (eg. try  "bin/test asdf").


Unfortunately, I'm not aware of such a file. To see all classes that inherit from Exception (which should be all of our Exceptions), you can use the following git grep command: git grep "class.*Exception"

Tsvetelina on November 28 2011 12:11 UTC Thank you

Ok, i will install pyglet. Thank you for the quick response. :)

Tsvetelina on November 28 2011 14:31 UTC Still don't run

I installed piglet but the tests for plotting still don't run. There are a few exception in (plotting files) for which i am not sure that are thrown. Can i wrtite except Exception: - where i am not sure what exception is thrown? Sorry for asking you so many times :)

Tsvetelina on November 28 2011 15:09 UTC Plotting tests run!

Sorry if i was too annoying with all these questions and thank you all for answering them :)

Tsvetelina on November 28 2011 17:36 UTC I can't push my branch

I can't push my branch. I followed https://github.com/sympy/sympy/wiki/Development-workflow#wiki-cloning-sympy but i get this error:


Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Aaron Meurer on November 28 2011 20:50 UTC Deadline extended

The deadline of the task has been extended with 1 days and 0 hours.

Aaron Meurer on November 28 2011 20:51 UTC

You sent the pull requests to the wrong repository.  You need to send them to sympy/sympy, not to me.


And please create only one pull request for all of your work.  You can collect all of your changes into one branch in git by using the cherry-pick command to apply them all to a branch.  Ping me on IRC (#sympy on Freenode) if you need help.


I've extended your deadline to give you time to fix this. 

Tsvetelina on November 28 2011 20:52 UTC Finished the task and pulled request in github/sympy

I successed in uploading the files i edited and i pulled request in github/sympy. It says that they are submitted to asmeurer/sympy so i guess if they are approved by him the changes i made will be visible. I am asking that because you said that if i upload them here it they will be useless for you and i don't know what link to give. Again thanks for answering to all of my questions :)

Tsvetelina on November 28 2011 20:54 UTC Ok

Ok, i will send them to the right repository

Tsvetelina on November 28 2011 21:26 UTC Pull requests

I can't connect to irc and i can't make nake cgerry-pick. It won't hurt anyone if i just make new pull request for each file,would it?

Aaron Meurer on November 28 2011 21:46 UTC

No, please do not spam our pull request system.  If you can't connect to IRC, ask for help on our mailing list.

Tsvetelina on November 28 2011 22:07 UTC I won't spam and will make branch :)

I found good tutorial - http://net.tutsplus.com/tutorials/other/the-perfect-workflow-with-git-github-and-ssh/ - about git and tommorow when i read it i will make branch. Sorry for spaming.

Tsvetelina on November 29 2011 08:21 UTC I think i successed in making a branch and push it and pull request

Can you check if i have upload the branch and if i have done it right? Thanks. :)

Vladimir Perić on November 29 2011 09:19 UTC Looks good

The pull request is fine, now it just needs to go through the normal review process. I don't think there will be any problems, though.

Tsvetelina on November 29 2011 18:43 UTC Am i done with the task?

When i pull request in github i was told that i should do rebase because except statements  in mpmath shouldn't change. I have been trying all day to do rebase but i eventuallly i messed up the files and now it would be easier if i create a new branch with mpmath not changed. What should i do?

Tsvetelina on November 29 2011 20:36 UTC Is the task OK?

Please if you don't approve my work extend my time. I want to finished this task since i spent too many hours working on it and i don't want all to go to waste. Thank you.

Vladimir Perić on November 29 2011 20:39 UTC Deadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Tsvetelina on November 30 2011 11:23 UTC Ready for review

The work on this task is ready to be reviewed.

Chris Smith on December 1 2011 07:45 UTC Task Closed

Congratulations, this task has been completed successfully.