pylada / pylada-light

A physics computational framework for python and ipython
GNU General Public License v3.0
38 stars 24 forks source link

Python 2 is still alive! #45

Closed ftherrien closed 5 years ago

ftherrien commented 5 years ago

This is my suggestion to fix #44. That way the depreciation warning does not show up and pylada still works in python 2.

ftherrien commented 5 years ago

Is this better?

@mdavezac, do you know why the tests are failing?

ftherrien commented 5 years ago

Found it! I will add new commit and see if it still fails

ftherrien commented 5 years ago

@mdavezac the tests seem to be failing because of a fixture issue in espresso/tests/bdd/test_restart.py. Rewritting the function this way solves the issue, should I create a specific pull request for that?

 from pylada.espresso.tests.fixtures import diamond_structure as structure

 @given("a distorted diamond structure")
 def distorted_diamond(structure):
     from numpy.random import random
     #structure = diamond_structure()    
mdavezac commented 5 years ago

Let me take a look this WE

mdavezac commented 5 years ago

@ftherrien, I think it should pass now. It's was really just some iffy code that used to be okay, but that pytest rejects now.

I've also simplified (... i think ...) some of the code in tools/makeclass.py, compared to what you were proposing.

mdavezac commented 5 years ago

@ftherrien, can you confirm this works on your end? Then we can merge.

ftherrien commented 5 years ago

@mdavezac everything seems to work for me