Hacker News new | ask | show | jobs
by jackmaney 3979 days ago
> There is no requirements file with pandashells because some of the tools only require the standard library, and there's no sense installing unnecessary packages if you only want to use that subset of tools.

This is a terrible idea. One of the main features of package managers is dependency management. If you want to be as minimalistic as possible, separate the tools into further packages (some of which have their requirements laid out properly, and some of which only require the standard library).

2 comments

Try the extra capabilities parameters in setup.py, so the user can selectively install what they'd like:

    extras_require = {
         'param_name': ['pkg1', 'pkg2'],
     },

They then can be used like so:

    pip install package[param_name]
thanks mixmastamyk. That's a good suggestion.
Thanks for the feedback. As you may know, getting matplotlib to work properly with backends like TkAgg can be quite a chore when installing using pip (non-python libraries are needed). The Pandashells install process could be improved. I intend on creating a conda package for Pandashells that should handle the dependency issue you raise, but I just haven't had time to do so yet. I am hoping the detailed examples in the docs will suffice until I do.
Why focus on TkAgg support? Just write graphics to a user-specified file.
A native-ish backend like TkAgg is valuable because it instantly pops up an interactive plot, which I find really useful for the quick-n-dirty data exploration tasks I usually use Pandashells for. You don't need the interactive backend and can use the --savefig option on plots to save images or html, but that takes time -- and I usually want my results now!! :)
It should be possible to pipe to file and then fire off a subprocess to open the resulting png.

In Windows, you can do:

    os.system("start {}".format(output_file_name))
to open the output file with the default Windows program to view that file type (although if there is no registered program to open files of that extension, you'll get the usual prompt asking you what program you want to use to open the file.

Similarly, you can use `open` in OS X and `gnome-open` in at least some flavors of Linux (including Ubuntu).

Of course, you could always allow this command to be user configurable, with the defaults above depending on the OS in which the code is running.