fossasia / pslab-python

Python Library for PSLab Desktop: https://pslab.io
GNU General Public License v3.0
1.63k stars 226 forks source link

Update __init__.py #131

Closed 19-pragya closed 4 years ago

19-pragya commented 4 years ago

Issue : #127

bessman commented 4 years ago

Hi pragya, thank you for the pull request! Could you add add a description explaining your changes, please?

19-pragya commented 4 years ago

Actually , i was trying to divide it into modules.. (sciencelab ) it was asked to divide the components of this large script into smaller modules so...i did only for installation

bessman commented 4 years ago

I see! May I ask how much experience you have with Python? As you can see from the Travis CI build, your changes currently do not work. Moving methods out of a class and turning them into standalone functions require careful consideration to avoid breaking something, since methods often depend on instance variables which cannot be used by standalone functions. In this case, the methods you've chosen exist only to initialize new ScienceLab instances, so turning them into functions will not work.

What might work is to create a ScienceLabBase class, moving the initialization there, and making the ScienceLab class inherit from it. If you want to try doing that, please put the new class in the PSL package, not the tests package. The latter is for unit tests.

bessman commented 4 years ago

Closing due to lack of activity.