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

Using external libraries #14

Open
lo-co opened this issue Jan 26, 2016 · 11 comments
Open

Using external libraries #14

lo-co opened this issue Jan 26, 2016 · 11 comments
Labels

Comments

@lo-co
Copy link
Owner

lo-co commented Jan 26, 2016

So, my SMPS module needs a lot of work and I noticed that I have imported the following libraries:

  • tkinter
  • matplotlib
  • pandas

I use tkinter to produce a file dialog, matplotlib to plot some results and pandas to read in data. My gut feeling is that none of these are necessary and that basically we want to provide tools for analysis and not a graphical package or a package tied to a specific data format. In this instance, the use of pandas.read_csv presupposes a file format that is not some kind of industry standard. In addition, tkinter is kind of tacked on to allow the user to choose a file but there is also a tool for programatically allowing the user to provide data files. So, my conclusion is that none of this is necessary for this module. My question is - when is it appropriate to require external modules?

@lo-co lo-co added the question label Jan 26, 2016
@hagne
Copy link
Collaborator

hagne commented Jan 26, 2016

I don't see the point not to use pandas. I mean we are using numpy, why not go one step further and use pandas. We could say everything that is shipped with, e.g. anaconda, is ok to import?!?
Regarding tkinter. You could give the option to read using a gui or programmatically?

@lo-co
Copy link
Owner Author

lo-co commented Jan 26, 2016

I see your point, but why? I think the pandas question is something to be addressed case-by-case (in my case the answer is don't use it I think), but why would you ever want to use guis, especially tkinter. To be honest, I can't come up with a justification.

@hagne
Copy link
Collaborator

hagne commented Jan 26, 2016

then get rid of it :-)
I don't have a strong opinion on it.

@lo-co
Copy link
Owner Author

lo-co commented Jan 26, 2016

I am, but I am just putting that question out there with intention of hopefully getting everyone to think about why they are doing something. So, my question is when and why do you use pandas? (I primarily use it to gather and organize data from files; beyond that, numpy is generally sufficient since pandas is mostly a wrapper for numpy)

@hagne
Copy link
Collaborator

hagne commented Jan 27, 2016

pandas is just awesome. Makes it easier to deal with arrays and not lose track of columns and dimentions. It also adds a lot of functionality to an array, grouping, merging, interpolating ...

@lo-co
Copy link
Owner Author

lo-co commented Jan 28, 2016

I agree. But do you make raw pandas objects or are most of yours derived from csv files?

@hagne
Copy link
Collaborator

hagne commented Jan 28, 2016

both

@lo-co
Copy link
Owner Author

lo-co commented Jan 28, 2016

Where are you making raw pandas objects (out of curiosity)?

@hagne
Copy link
Collaborator

hagne commented Jan 28, 2016

define raw!

@lo-co
Copy link
Owner Author

lo-co commented Jan 28, 2016

I mean ones that are generated in the code (i.e. you don't start the call off with pandas.read_csv to populate it). I have some idea as to how I would do it, but I wouldn't mind seeing what you do...

@hagne
Copy link
Collaborator

hagne commented Jan 28, 2016

Allmost each of my modules uses them. Sizedistribution is for example full of them. Just look for DataFrame, Series, or Panel. These are the points were I create the pandas objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants