Ejemplo n.º 1
0
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################

from __future__ import division

from vistrails.core.modules.utils import make_modules_dict

from .write_csv import _modules as csv_modules
from .write_excel import _modules as excel_modules
from .write_numpy import _modules as numpy_modules


_modules = make_modules_dict(numpy_modules, csv_modules, excel_modules,
                             namespace='write')


###############################################################################

import unittest


class BaseWriteTestCase(object):
    def test_numeric(self):
        from vistrails.tests.utils import execute, intercept_result
        from ..common import ExtractColumn
        from ..identifiers import identifier
        with intercept_result(ExtractColumn, 'value') as results:
            self.assertFalse(execute([
                    ('BuildTable', identifier, [
Ejemplo n.º 2
0
    import numpy
except ImportError: # pragma: no cover
    numpy_modules = []
else:
    from .write_numpy import _modules as numpy_modules

from .write_excel import get_xlwt
if get_xlwt():
    from .write_excel import _modules as excel_modules
else: # pragma: no cover
    excel_modules = []

from .write_csv import _modules as csv_modules


_modules = make_modules_dict(numpy_modules, csv_modules, excel_modules,
                             namespace='write')


###############################################################################

import unittest


class BaseWriteTestCase(object):
    def test_numeric(self):
        from vistrails.tests.utils import execute, intercept_result
        from ..common import ExtractColumn
        from ..identifiers import identifier
        with intercept_result(ExtractColumn, 'value') as results:
            self.assertFalse(execute([
                    ('BuildTable', identifier, [
Ejemplo n.º 3
0
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################

from __future__ import division

from vistrails.core.modules.utils import make_modules_dict

from .convert import _modules as convert_modules
from .read_excel import _modules as excel_modules
from .read_numpy import _modules as numpy_modules

from .read_csv import _modules as csv_modules
from .read_json import _modules as json_modules

_modules = make_modules_dict(convert_modules,
                             numpy_modules,
                             csv_modules,
                             excel_modules,
                             json_modules,
                             namespace='read')
Ejemplo n.º 4
0
from .operations import _modules as operation_modules
from .read import _modules as read_modules
from .write import _modules as write_modules

_modules = [
    common_modules, convert_modules, operation_modules, read_modules,
    write_modules
]

if get_package_manager().has_package(  # pragma: no branch
        'org.vistrails.vistrails.spreadsheet'):
    from .viewer import _modules as viewer_modules, TableToSpreadsheetMode
    _modules.append(viewer_modules)
    TableOutput.register_output_mode(TableToSpreadsheetMode)

_modules = make_modules_dict(*_modules)


def handle_module_upgrade_request(controller, module_id, pipeline):
    def add_keyname(fname, module):
        new_function = controller.create_function(module, "key_name", ["_key"])
        return [('add', new_function, 'module', module.id)]

    module_remap = {
        'read|csv|CSVFile': [(None, '0.1.1', 'read|CSVFile', {
            'src_port_remap': {
                'self': 'value'
            },
        })],
        'read|numpy|NumPyArray': [(None, '0.1.1', 'read|NumPyArray', {
            'src_port_remap': {
Ejemplo n.º 5
0
from vistrails.core.modules.utils import make_modules_dict

try:
    # read_numpy requires numpy
    import numpy
except ImportError:
    numpy_modules = []
else:
    from read_numpy import _modules as numpy_modules

from read_csv import _modules as csv_modules
from read_excel import _modules as excel_modules


_modules = make_modules_dict(numpy_modules, csv_modules, excel_modules,
                             namespace='read')
Ejemplo n.º 6
0
from .operations import _modules as operation_modules
from .read import _modules as read_modules
from .write import _modules as write_modules


_modules = [common_modules,
            convert_modules,
            operation_modules,
            read_modules,
            write_modules]

if get_package_manager().has_package('org.vistrails.vistrails.spreadsheet'):
    from .viewer import _modules as viewer_modules
    _modules.append(viewer_modules)

_modules = make_modules_dict(*_modules)


def handle_module_upgrade_request(controller, module_id, pipeline):
    module_remap = {
            'read|csv|CSVFile': [
                (None, '0.1.1', 'read|CSVFile', {
                    'src_port_remap': {
                        'self': 'value'},
                })
            ],
            'read|numpy|NumPyArray': [
                (None, '0.1.1', 'read|NumPyArray', {
                    'src_port_remap': {
                        'self': 'value'},
                })
Ejemplo n.º 7
0
##    this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################

from __future__ import division

from vistrails.core.modules.utils import make_modules_dict

from .convert import _modules as convert_modules
from .read_excel import _modules as excel_modules
from .read_numpy import _modules as numpy_modules

from .read_csv import _modules as csv_modules
from .read_json import _modules as json_modules

_modules = make_modules_dict(convert_modules, numpy_modules, csv_modules,
                             excel_modules, json_modules,
                             namespace='read')
Ejemplo n.º 8
0
##    notice, this list of conditions and the following disclaimer in the
##    documentation and/or other materials provided with the distribution.
##  - Neither the name of the New York University nor the names of its
##    contributors may be used to endorse or promote products derived from
##    this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################

from __future__ import division

from vistrails.core.modules.utils import make_modules_dict

from convert_dates import _modules as dates_modules
from .convert_numpy import _modules as numpy_modules


_modules = make_modules_dict(dates_modules, numpy_modules,
                             namespace='convert')
Ejemplo n.º 9
0
##    this list of conditions and the following disclaimer.
##  - Redistributions in binary form must reproduce the above copyright
##    notice, this list of conditions and the following disclaimer in the
##    documentation and/or other materials provided with the distribution.
##  - Neither the name of the New York University nor the names of its
##    contributors may be used to endorse or promote products derived from
##    this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################

from __future__ import division

from vistrails.core.modules.utils import make_modules_dict

from convert_dates import _modules as dates_modules
from .convert_numpy import _modules as numpy_modules

_modules = make_modules_dict(dates_modules, numpy_modules, namespace='convert')