Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
add modules to manipulate data cubes
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Aug 27, 2014
1 parent a7b1534 commit 38299a9
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Functionalities
Versions
--------

* **0.7 - 2014/??/??**
* **new:** list of modules to manipulate and view data cubes
* **0.6 - 2014/08/26**
* **fix:** fix an import issue
* **0.5 - 2014/08/24**
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
subversion = 1

project_var_name = "pymyinstall"
sversion = "0.6"
sversion = "0.7"
versionPython = "%s.%s" % (sys.version_info.major, sys.version_info.minor)
path = "Lib/site-packages/" + project_var_name
readme = 'README.rst'
Expand Down
4 changes: 2 additions & 2 deletions src/pymyinstall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@endcode
"""

__version__ = "0.6"
__version__ = "0.7"
__author__ = "Xavier Dupré"
__github__ = "https://github.com/sdpython/pymyinstall"
__url__ = "http://www.xavierdupre.fr/app/pymyinstall/helpsphinx/index.html"
Expand All @@ -40,5 +40,5 @@ def check( log = False):
from .installhelper.install_custom_pandoc import install_pandoc
from .installhelper.install_custom_scite import install_scite, add_shortcut_to_desktop_for_scite
from .installhelper.install_custom_sqlitespy import install_sqlitespy, add_shortcut_to_desktop_for_sqlitespy
from .packaged.packaged_functions import datascientist
from .packaged.packaged_functions import datascientist, ds_small, ds_complete, ds_cubes
from .packaged.packaged_config import complete_installation, small_installation
16 changes: 16 additions & 0 deletions src/pymyinstall/packaged/packaged_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,20 @@ def complete_installation():
return mod


def installation_cubes():
"""
A cube is a multidimensional array.
This functions gathers the dependencies for module `cubes <https://github.com/Stiivi/cubes>`_
(`documentation <http://cubes.databrewery.org/dev/doc/>`_)
and `cubesviewer <https://github.com/jjmontesl/cubesviewer>`_.
"""
mod = [
ModuleInstall("python-dateutil","pip", "dateutil"),
ModuleInstall("pytz", "pip"),
ModuleInstall("jsonschema", "pip"),
ModuleInstall("cubes", "pip"),
]

return mod

40 changes: 39 additions & 1 deletion src/pymyinstall/packaged/packaged_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
from ..installhelper.install_cmd import run_cmd, ModuleInstall, unzip_files, add_shortcut_to_desktop_for_module
from ..installhelper.install_manual import get_install_list
from .packaged_config import complete_installation, small_installation
from .packaged_config import complete_installation, small_installation, installation_cubes
from ..installhelper.install_custom_scite import install_scite, add_shortcut_to_desktop_for_scite
from ..installhelper.install_custom_pandoc import install_pandoc
from ..setuphelper.ipython_helper import setup_ipython, add_shortcut_to_desktop_for_ipython
Expand Down Expand Up @@ -42,6 +42,7 @@ def datascientist( folder = "install",
@param browser browser to use for the notebooks if not the default one (ie, firefox, chrome)
@param skip to skip some modules if they fail
@param full if True, install many modules including the ones used to generate the documentation
@param fLOG logging function
@example(Install manything for a Data Scientist)
@code
Expand All @@ -63,6 +64,7 @@ def datascientist( folder = "install",
"""
if modules :
modules = complete_installation() if full else small_installation()

for _ in modules :
if _.name in skip or _.mname in skip :
fLOG("skip module", _.name, " import name:", _.mname)
Expand Down Expand Up @@ -90,3 +92,39 @@ def datascientist( folder = "install",
if ipython : add_shortcut_to_desktop_for_module("spyder")
if sqlitespy: add_shortcut_to_desktop_for_sqlitespy(sqlitespy_file)

def ds_complete(**params):
"""
calls @see fn datascientist with ``full=True``
"""
params = params.copy()
params["full"] = True
datascientist(**params)

def ds_small(**params):
"""
calls @see fn datascientist with ``full=False``
"""
params = params.copy()
params["full"] = False
datascientist(**params)

def ds_cubes( folder = "install",
modules = True,
skip = [],
fLOG = print) :
"""
Install all the necessary modules to manipulate `data cubes <http://en.wikipedia.org/wiki/Data_cube>`_ (= multidimensional arrays).
@param folder where to install everything
@param modules go through the list of necessary modules
@param skip to skip some modules if they fail
@param fLOG logging function
"""
if modules :
modules = installation_cubes()

for _ in modules :
if _.name in skip or _.mname in skip :
fLOG("skip module", _.name, " import name:", _.mname)
else :
_.install(temp_folder=folder)

0 comments on commit 38299a9

Please sign in to comment.