├── .gitignore ├── ANNOUNCE.txt ├── ChangeLog.txt ├── INSTALL.txt ├── LICENSE.html ├── LICENSE.txt ├── MANIFEST.in ├── README.txt ├── TODO.txt ├── VERSION ├── doc ├── Makefile ├── conf.py ├── images │ ├── browseDataset.png │ ├── editingUserAttrs.png │ ├── groupCreation.png │ ├── helpBrowser.png │ ├── mainWindow.png │ ├── newFilteredTable.png │ ├── propertiesDlg.png │ ├── settingsDlg.png │ ├── title_page_plain.png │ ├── title_page_plain.svg │ ├── treeSymbols.png │ └── zoomingCells.png ├── index_html.txt ├── index_pdf.txt ├── make.bat ├── posterIcons.py ├── users_guide.style ├── usersguide-app1.rst ├── usersguide-app2.rst ├── usersguide-ch1.rst ├── usersguide-ch2.rst ├── usersguide-ch3.rst ├── usersguide-ch4.rst ├── usersguide-ch5.rst └── vitables_cover.tmpl ├── examples ├── arrays │ ├── array_samples.h5 │ ├── carray_sample.h5 │ ├── earray_samples.h5 │ └── vlarray_samples.h5 ├── misc │ ├── MDobjects.h5 │ ├── external_file.h5 │ ├── fnode.h5 │ ├── genericHDF5.h5 │ ├── links_examples.h5 │ ├── nonalphanum.h5 │ ├── objecttree.h5 │ └── szip_compressor.h5 ├── scripts │ ├── MDobjects.py │ ├── array_samples.py │ ├── array_timeseries.py │ ├── carray_samples.py │ ├── create-large-table.py │ ├── earray_samples.py │ ├── filenode_sample.py │ ├── large_number_of_objects.py │ ├── linked_nodes.py │ ├── nested_samples.py │ ├── objecttree.py │ ├── pandas_timeseries1.py │ ├── pandas_timeseries2.py │ ├── pandas_timeseries3.py │ ├── scikits_timeseries1.py │ ├── scikits_timeseries2.py │ ├── scikits_timeseries3.py │ ├── table_samples.py │ ├── table_timeseries.py │ └── vlarray_samples.py ├── tables │ ├── nested_samples.h5 │ └── table_samples.h5 └── timeseries │ ├── carray_ts.h5 │ ├── pandas_test1.hdf5 │ ├── pandas_test2.hdf5 │ ├── pandas_test3.hdf5 │ ├── scikits_test1.hdf5 │ ├── scikits_test2.hdf5 │ ├── scikits_test3.hdf5 │ └── table_ts.h5 ├── macosxapp ├── ReadMe-MacOSX.rtf ├── ViTables.icns ├── ViTables.png ├── ViTables.xcf └── make.sh ├── mswindows ├── Makefile └── vitables.nsi.in ├── scripts └── vitables ├── setup.py ├── setupdocs.py ├── tests ├── README ├── __init__.py ├── common.py ├── create_samples.py ├── h5db │ ├── __init__.py │ ├── test_dbDoc.py │ ├── test_dbManager.py │ └── test_dbView.py ├── h5list.txt ├── hdf5_sample.h5 ├── nodes │ ├── __init__.py │ ├── test_arrayDoc.py │ ├── test_groupDoc.py │ ├── test_nodeDoc.py │ ├── test_tableDoc.py │ └── test_unimplementedDoc.py ├── preferences │ ├── __init__.py │ ├── test_preferences.py │ └── test_vtconfig.py ├── root_owned_samples.h5 ├── root_package │ ├── __init__.py │ ├── test_actions.py │ ├── test_commandLine.py │ └── test_query.py └── test_all.py ├── translations ├── Translations.txt └── vitables_es_ES.qm ├── unixapp ├── vitables.desktop ├── vitables.svg ├── vitables_128x128.png ├── vitables_16x16.png ├── vitables_22x22.png ├── vitables_32x32.png ├── vitables_48x48.png └── vitables_64x64.png ├── vitables.pro ├── vitables ├── __init__.py ├── docbrowser │ ├── __init__.py │ ├── bookmarksdlg.py │ ├── browsergui.py │ └── helpbrowser.py ├── h5db │ ├── __init__.py │ ├── dbdoc.py │ ├── dbstreemodel.py │ ├── dbstreeview.py │ ├── groupnode.py │ ├── leafnode.py │ ├── linknode.py │ ├── nodeitemdelegate.py │ ├── rootgroupnode.py │ ├── tlink_editor.py │ └── tnode_editor.py ├── icons │ ├── 16x16 │ │ ├── application-exit.png │ │ ├── array.png │ │ ├── bookmark_add.png │ │ ├── bookmarks.png │ │ ├── carray.png │ │ ├── configure.png │ │ ├── delete_filters.png │ │ ├── dialog-cancel.png │ │ ├── dialog-ok.png │ │ ├── document-close.png │ │ ├── document-new.png │ │ ├── document-open-recent.png │ │ ├── document-open.png │ │ ├── document-save-as.png │ │ ├── earray.png │ │ ├── edit-copy.png │ │ ├── edit-cut.png │ │ ├── edit-delete.png │ │ ├── edit-paste.png │ │ ├── edit-rename.png │ │ ├── file_ro.png │ │ ├── file_rw.png │ │ ├── folder-new.png │ │ ├── go-first-view.png │ │ ├── go-next-view.png │ │ ├── go-previous-view.png │ │ ├── help-about.png │ │ ├── help-contents.png │ │ ├── image-missing.png │ │ ├── link_array.png │ │ ├── link_carray.png │ │ ├── link_earray.png │ │ ├── link_table.png │ │ ├── link_vlarray.png │ │ ├── list-remove.png │ │ ├── object.png │ │ ├── table.png │ │ ├── vlarray.png │ │ ├── vlstring.png │ │ ├── zoom-in.png │ │ └── zoom-out.png │ ├── 22x22 │ │ ├── application-exit.png │ │ ├── bookmark_add.png │ │ ├── bookmarks.png │ │ ├── dbfilters.png │ │ ├── delete_filters.png │ │ ├── document-close.png │ │ ├── document-new.png │ │ ├── document-open-folder.png │ │ ├── document-open.png │ │ ├── document-save-as.png │ │ ├── edit-clear-history.png │ │ ├── edit-copy.png │ │ ├── edit-cut.png │ │ ├── edit-delete.png │ │ ├── edit-paste.png │ │ ├── file_ro.png │ │ ├── file_rw.png │ │ ├── folder-new.png │ │ ├── folder.png │ │ ├── go-first-view.png │ │ ├── go-next-view.png │ │ ├── go-previous-view.png │ │ ├── help-contents.png │ │ ├── view-filter.png │ │ ├── view-refresh.png │ │ ├── zoom-in.png │ │ └── zoom-out.png │ ├── 64x64 │ │ ├── preferences-desktop-theme.png │ │ ├── preferences-other.png │ │ └── preferences-plugin.png │ ├── vitables.ico │ ├── vitables_file.ico │ ├── vitables_logo.png │ ├── vitables_logo.svg │ ├── vitables_wm.png │ └── vtinstaller.ico ├── logger.py ├── nodeprops │ ├── __init__.py │ ├── attr_prop_dlg.ui │ ├── attreditor.py │ ├── attrpropdlg.py │ ├── group_prop_page.ui │ ├── grouppropdlg.py │ ├── groupproppage.py │ ├── leaf_prop_page.ui │ ├── leafpropdlg.py │ ├── leafproppage.py │ ├── link_prop_dlg.ui │ ├── linkpropdlg.py │ └── nodeinfo.py ├── plugin_utils.py ├── plugins │ ├── __init__.py │ ├── about_page.ui │ ├── columnorg │ │ ├── __init__.py │ │ ├── aboutpage.py │ │ ├── columnar_org.py │ │ └── icons │ │ │ ├── object-group.png │ │ │ └── object-ungroup.png │ ├── csv │ │ ├── __init__.py │ │ ├── aboutpage.py │ │ ├── examples │ │ │ ├── array.csv │ │ │ ├── arrayND.csv │ │ │ ├── array_float.csv │ │ │ ├── column.csv │ │ │ ├── columnND.csv │ │ │ ├── row.csv │ │ │ ├── rowND.csv │ │ │ ├── table.csv │ │ │ └── table_strings.csv │ │ ├── export_csv.py │ │ ├── icons │ │ │ ├── document-export.png │ │ │ └── document-import.png │ │ └── import_csv.py │ ├── dbstreesort │ │ ├── __init__.py │ │ ├── aboutpage.py │ │ ├── dbs_tree_sort.py │ │ ├── dbs_tree_sort_page.ui │ │ └── sorting_algorithm.ini │ └── timeseries │ │ ├── __init__.py │ │ ├── aboutpage.py │ │ ├── time_format.ini │ │ ├── time_series.py │ │ └── timeformatter_page.ui ├── preferences │ ├── __init__.py │ ├── cfgexception.py │ ├── pluginsloader.py │ ├── preferences.py │ ├── settings_dlg.ui │ └── vtconfig.py ├── queries │ ├── __init__.py │ ├── query.py │ ├── query_dlg.ui │ ├── querydlg.py │ └── querymgr.py ├── utils.py ├── vtapp.py ├── vtgui.py ├── vtsite.py ├── vtsplash.py ├── vttables │ ├── __init__.py │ ├── buffer.py │ ├── datasheet.py │ ├── leaf_delegate.py │ ├── leaf_model.py │ ├── leaf_view.py │ └── scrollbar.py └── vtwidgets │ ├── __init__.py │ ├── nodename_dlg.ui │ ├── nodenamedlg.py │ ├── rename_dlg.ui │ ├── renamedlg.py │ └── zoom_cell.py ├── vitables_ca_ES.ts └── vitables_es_ES.ts /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | Makefile 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | tmp/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | 45 | # Translations 46 | *.mo 47 | *.pot 48 | 49 | # Django stuff: 50 | *.log 51 | 52 | # Sphinx documentation 53 | docs/_build/ 54 | 55 | # PyBuilder 56 | target/ 57 | Makefile 58 | Manifest.in 59 | -------------------------------------------------------------------------------- /ANNOUNCE.txt: -------------------------------------------------------------------------------- 1 | ======================= 2 | Announcing ViTables 2.1 3 | ======================= 4 | 5 | After a long period retired from development activities I'm happy to come back 6 | and present ViTables 2.1, the latest release of this viewer for PyTables/HDF5 7 | files. 8 | 9 | As it happens with the entire PyTables family, the main strength of ViTables 10 | is its ability to manage really large datasets in a fast and comfortable 11 | manner. For example, with ViTables you can open a table with one thousand 12 | million rows in a few tenths of second, with very low memory requirements. 13 | Also important is the fact that it is designed to be a multiplatform 14 | application, i.e., it runs flawlessly in Unix (and hence, GNU/Linux), Mac OS 15 | X and Windows. The fact that it runs on top of PyTables ensures its speed and 16 | memory efficiency. 17 | 18 | In this release you will find some bug fixes and usability enhancements. New 19 | features include: 20 | 21 | - improved queries. They are faster and eat much less memory 22 | - a simple but flexible plugins framework 23 | - human friendly formatting of times and dates for PyTables native Time fields 24 | and also for time series created via scikits.timeseries package 25 | - datasets can be imported/exported from/to files with CSV format 26 | 27 | Platforms 28 | --------- 29 | At the moment, ViTables has been fully tested only on GNU/Linux and Windows 30 | platforms, but as it is made on top of Python, PyQt and PyTables, its 31 | portability should be really good and it should work just fine in other 32 | Unices. 33 | 34 | How to get it 35 | ------------- 36 | Visit: 37 | 38 | http://www.vitables.org/download 39 | 40 | and click the link 'downloads area' to find the available packages. 41 | 42 | Share your experience 43 | --------------------- 44 | I'm very interested in your feedback about ViTables. Please send your 45 | opinions, suggestions, bugs, etc. to the ViTables Users Group at 46 | 47 | http://tech.groups.yahoo.com/group/vitables-users. 48 | 49 | Thank you! 50 | 51 | Enjoy Data with ViTables, the troll of the PyTables family! 52 | -------------------------------------------------------------------------------- /INSTALL.txt: -------------------------------------------------------------------------------- 1 | System requirements 2 | ------------------- 3 | 4 | ViTables 2.1 has been tested against Python 2.6 and 2.7 and the latest 5 | versions of PyTables and PyQt4 (you can try older versions at your own risk 6 | :). 7 | 8 | Installation on Windows platforms 9 | --------------------------------- 10 | Just double click the installer icon and follow the wizard instructions. 11 | 12 | If you prefer to launch ViTables from the command line then install it 13 | following the instructions given in the next section. 14 | 15 | 16 | Installation on Linux platforms 17 | ------------------------------- 18 | 19 | The Python Distutils are used to build and install ViTables. Provided your 20 | system fulfills the requirements listed in the above section, installing 21 | the package is really easy. Just uncompress it, change to the distribution 22 | directory and execute (as root) 23 | 24 | $ python setup.py install 25 | 26 | If you are doing this on a MacOS X platform, please make sure that the 27 | DYLD_LIBRARY_PATH environment variable has been setup properly. 28 | 29 | By default ViTables will be installed in the system-protected area where 30 | your system installs third party Python packages so you will need superuser 31 | privileges. If you prefer to install the package in a different location 32 | (for instance, your home directory) so that the installation can be done by 33 | non privileged users, you can do it using the --prefix (or --home) tag 34 | 35 | $ python setup.py install --prefix=/home/myuser/mystuff 36 | 37 | Please, remember that installing Python modules in non-standard locations 38 | makes it necessary to setup properly the PYTHONPATH environment variable so 39 | that the Python interpreter can find the new modules. 40 | 41 | If you need further customizations, please have a look to the output of the 42 | command 43 | 44 | $python setup.py install --help 45 | 46 | to see all the available options. Complete information about them can be 47 | found in the Distutils documentation. 48 | 49 | Installation on MacOS X platforms 50 | --------------------------------- 51 | For getting a double-clickable application bundle do the following: 52 | 53 | - uncompress the tarball 54 | - change to the distribution directory 55 | - change to the macosxapp directory 56 | - execute the make.sh script 57 | 58 | If you prefer to launch ViTables from the command line then install it 59 | following the instructions given in the previous section. 60 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt VERSION LICENSE.html 2 | include scripts/vitables 3 | recursive-include unixapp vitables.desktop vitables.svg 4 | recursive-include doc * 5 | exclude doc/images/title_page_plain.svg 6 | exclude doc/index.rst 7 | recursive-include examples * 8 | recursive-include macosxapp * 9 | recursive-include vitables/* *.ui *.ini 10 | recursive-include vitables/icons * 11 | exclude vitables/icons/vitables_logo.svg 12 | recursive-include vitables/htmldocs * 13 | recursive-include vitables/plugins/csv/icons *.png 14 | recursive-include vitables/plugins/csv/examples *.csv 15 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | This is a fork of https://github.com/uvemas/ViTables 2 | There is no development here, it serves as a basis for pull requests. 3 | 4 | ViTables 5 | -------- 6 | ViTables is a graphical tool for browsing and editing files in both PyTables 7 | and HDF5 format. With ViTables you can easily navigate through the data 8 | hierarchy, view and modify metadata, view actual data and more. 9 | 10 | ViTables has been developed using Python and PyQt4, a binding to Qt4 11 | libraries, so it should run on any platform that support these components 12 | (this includes Windows, Mac OS X, Linux and many other Unices). The interface 13 | and features are the same in all platforms. At the moment, ViTables has been 14 | heavily tested on Linux and Windows platforms. 15 | 16 | The User's Guide in PDF format can be found in the doc directory. Please read 17 | it. I've written it for you :-) 18 | 19 | For installation instructions see INSTALL.txt. 20 | 21 | Feel free to subscribe to the ViTables users group `[1]`_ and to report bugs and 22 | send suggestions or features requests. 23 | 24 | .. _[1]: http://tech.groups.yahoo.com/group/vitables-users/ 25 | -------------------------------------------------------------------------------- /TODO.txt: -------------------------------------------------------------------------------- 1 | Possible future aditions 2 | ------------------------ 3 | * Python shell 4 | * Make datasets editable 5 | * Images support 6 | * Statistics and graphics 7 | 8 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 2.1 2 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | 15 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest 16 | 17 | help: 18 | @echo "Please use \`make ' where is one of" 19 | @echo " html to make standalone HTML files" 20 | @echo " dirhtml to make HTML files named index.html in directories" 21 | @echo " singlehtml to make a single large HTML file" 22 | @echo " pickle to make pickle files" 23 | @echo " json to make JSON files" 24 | @echo " htmlhelp to make HTML files and a HTML help project" 25 | @echo " qthelp to make HTML files and a qthelp project" 26 | @echo " devhelp to make HTML files and a Devhelp project" 27 | @echo " epub to make an epub" 28 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 29 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 30 | @echo " text to make text files" 31 | @echo " man to make manual pages" 32 | @echo " changes to make an overview of all changed/added/deprecated items" 33 | @echo " linkcheck to check all external links for integrity" 34 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 35 | 36 | clean: 37 | -rm -rf $(BUILDDIR)/* 38 | 39 | html: 40 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 41 | @echo 42 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 43 | 44 | dirhtml: 45 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 46 | @echo 47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 48 | 49 | singlehtml: 50 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 51 | @echo 52 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 53 | 54 | pickle: 55 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 56 | @echo 57 | @echo "Build finished; now you can process the pickle files." 58 | 59 | json: 60 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 61 | @echo 62 | @echo "Build finished; now you can process the JSON files." 63 | 64 | htmlhelp: 65 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 66 | @echo 67 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 68 | ".hhp project file in $(BUILDDIR)/htmlhelp." 69 | 70 | qthelp: 71 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 72 | @echo 73 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 74 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 75 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ViTablesUsersGuide.qhcp" 76 | @echo "To view the help file:" 77 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ViTablesUsersGuide.qhc" 78 | 79 | devhelp: 80 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 81 | @echo 82 | @echo "Build finished." 83 | @echo "To view the help file:" 84 | @echo "# mkdir -p $$HOME/.local/share/devhelp/ViTablesUsersGuide" 85 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ViTablesUsersGuide" 86 | @echo "# devhelp" 87 | 88 | epub: 89 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 90 | @echo 91 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 92 | 93 | latex: 94 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 95 | @echo 96 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 97 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 98 | "(use \`make latexpdf' here to do that automatically)." 99 | 100 | latexpdf: 101 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 102 | @echo "Running LaTeX files through pdflatex..." 103 | make -C $(BUILDDIR)/latex all-pdf 104 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 105 | 106 | text: 107 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 108 | @echo 109 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 110 | 111 | man: 112 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 113 | @echo 114 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 115 | 116 | changes: 117 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 118 | @echo 119 | @echo "The overview file is in $(BUILDDIR)/changes." 120 | 121 | linkcheck: 122 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 123 | @echo 124 | @echo "Link check complete; look for any errors in the above output " \ 125 | "or in $(BUILDDIR)/linkcheck/output.txt." 126 | 127 | doctest: 128 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 129 | @echo "Testing of doctests in the sources finished, look at the " \ 130 | "results in $(BUILDDIR)/doctest/output.txt." 131 | 132 | pdf: 133 | $(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf 134 | @echo 135 | @echo "pdf build finished; the PDF files are in $(BUILDDIR)/pdf." 136 | 137 | -------------------------------------------------------------------------------- /doc/images/browseDataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/browseDataset.png -------------------------------------------------------------------------------- /doc/images/editingUserAttrs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/editingUserAttrs.png -------------------------------------------------------------------------------- /doc/images/groupCreation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/groupCreation.png -------------------------------------------------------------------------------- /doc/images/helpBrowser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/helpBrowser.png -------------------------------------------------------------------------------- /doc/images/mainWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/mainWindow.png -------------------------------------------------------------------------------- /doc/images/newFilteredTable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/newFilteredTable.png -------------------------------------------------------------------------------- /doc/images/propertiesDlg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/propertiesDlg.png -------------------------------------------------------------------------------- /doc/images/settingsDlg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/settingsDlg.png -------------------------------------------------------------------------------- /doc/images/title_page_plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/title_page_plain.png -------------------------------------------------------------------------------- /doc/images/treeSymbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/treeSymbols.png -------------------------------------------------------------------------------- /doc/images/zoomingCells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/doc/images/zoomingCells.png -------------------------------------------------------------------------------- /doc/index_html.txt: -------------------------------------------------------------------------------- 1 | .. ViTables Users' Guide documentation master file, created by 2 | sphinx-quickstart on Sat Dec 4 18:53:39 2010. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to ViTables Users' Guide! 7 | ================================= 8 | 9 | .. COMMENT: Page title 10 | 11 | .. image:: images/title_page_plain.png 12 | :width: 359 13 | 14 | .. include:: 15 | 16 | Vicent Mas 17 | 18 | ViTables |version| Users' Guide version 1.0 19 | 20 | |today| 21 | 22 | Copyright |copy| 2005-2007 Cárabos Coop. V. All rights reserved. 23 | 24 | Copyright |copy| 2008-2013 Vicent Mas. All rights reserved. 25 | 26 | **Copyright Notice and Statement for the ViTables User's Guide.** 27 | 28 | This manual is part of the Licensed Software included in the *ViTables* package. For 29 | detailed information see the LICENSE.txt file. 30 | 31 | **Copyright Notice and Statement for the Qt library.** 32 | 33 | *Qt* is registered trademark of Nokia Corporation. 34 | 35 | **Copyright Notice and Statement for the PyQt library.** 36 | 37 | *PyQt* library Copyright by Riverbank Computing Limited. 38 | 39 | .. toctree:: 40 | :maxdepth: 3 41 | :numbered: 42 | 43 | usersguide-ch1 44 | usersguide-ch2 45 | usersguide-ch3 46 | usersguide-ch4 47 | usersguide-ch5 48 | usersguide-app1 49 | usersguide-app2 50 | 51 | -------------------------------------------------------------------------------- /doc/index_pdf.txt: -------------------------------------------------------------------------------- 1 | .. include:: 2 | 3 | Vicent Mas 4 | 5 | ViTables |version| Users' Guide version 1.0 6 | 7 | |today| 8 | 9 | Copyright |copy| 2005-2007 Cárabos Coop. V. All rights reserved. 10 | 11 | Copyright |copy| 2008-2013 Vicent Mas. All rights reserved. 12 | 13 | **Copyright Notice and Statement for the ViTables User's Guide.** 14 | 15 | This manual is part of the Licensed Software included in the *ViTables* package. For 16 | detailed information see the LICENSE.txt file. 17 | 18 | **Copyright Notice and Statement for the Qt library.** 19 | 20 | *Qt* is registered trademark of Nokia Corporation. 21 | 22 | **Copyright Notice and Statement for the PyQt library.** 23 | 24 | *PyQt* library Copyright by Riverbank Computing Limited. 25 | 26 | .. raw:: pdf 27 | 28 | PageBreak 29 | 30 | 31 | .. toctree:: 32 | :maxdepth: 3 33 | :numbered: 34 | 35 | usersguide-ch1 36 | usersguide-ch2 37 | usersguide-ch3 38 | usersguide-ch4 39 | usersguide-ch5 40 | usersguide-app1 41 | usersguide-app2 42 | 43 | -------------------------------------------------------------------------------- /doc/posterIcons.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (C) 2005, 2006, 2007 Carabos Coop. V. All rights reserved 4 | # Copyright (C) 2008, 2009 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | # 22 | # posterIcons.py 23 | # 24 | import sys 25 | 26 | from PyQt4.QtCore import * 27 | from PyQt4.QtGui import * 28 | 29 | iconsDir = '/home/vmas/ViTables/hg_branches/vitables_tip/vitables/icons/' 30 | big_icons = [('file_rw', 'The root node (read-write)'), 31 | ('file_ro', 'The root node (read-only)'), 32 | ('dbfilters', 'The root node of the Query Results file'), 33 | ('folder', 'A collapsed group '), 34 | ('document-open-folder', 'An expanded group ')] 35 | small_icons = [('table', 'A table (heterogeneus dataset) '), 36 | ('array', 'A regular array (homogeneus dataset) '), 37 | ('earray', 'An enlargeable array'), 38 | ('carray', 'A compressed array'), 39 | ('vlarray', 'A variable length array'), 40 | ('vlstring', 'An array of VLStrings'), 41 | ('object', 'A serialized objects dataset'), 42 | ('image-missing', 'An unsupported dataset')] 43 | 44 | class Poster(QMainWindow) : 45 | def __init__(self, *args) : 46 | apply(QMainWindow.__init__, (self,) + args) 47 | w = QWidget(self) 48 | l = QGridLayout(w) 49 | self.setCentralWidget(w) 50 | self.makePoster() 51 | 52 | 53 | def changePalette(self, widget): 54 | palette = QPalette() 55 | self.palette().setColor(widget.backgroundRole(), Qt.white) 56 | widget.setPalette(palette) 57 | 58 | 59 | def makePoster(self): 60 | widget = self.centralWidget() 61 | layout = widget.layout() 62 | r = 0 63 | iconsDict = {'big_icons': big_icons, 'small_icons': small_icons} 64 | for key in iconsDict.keys(): 65 | for (name, caption) in iconsDict[key] : 66 | pixmap = QPixmap() 67 | image_path = '%s/%s.png' % ("%s%s" % (iconsDir, key), name) 68 | print image_path 69 | pixmap.load(image_path) 70 | imLabel = QLabel(widget) 71 | imLabel.setPixmap(pixmap) 72 | self.changePalette(imLabel) 73 | layout.addWidget(imLabel, r, 0, 1, 1) 74 | textLabel = QLabel(caption,widget) 75 | self.changePalette(textLabel) 76 | layout.addWidget(textLabel, r, 1, 1, 1) 77 | r = r + 1 78 | 79 | 80 | def main(args) : 81 | app = QApplication(args) 82 | poster = Poster() 83 | poster.show() 84 | app.exec_() 85 | 86 | if __name__ == '__main__' : 87 | main(sys.argv) 88 | -------------------------------------------------------------------------------- /doc/usersguide-app1.rst: -------------------------------------------------------------------------------- 1 | 2 | .. raw:: pdf 3 | 4 | PageBreak appendixPage 5 | 6 | .. _appendix-a: 7 | 8 | About Plugins 9 | ============= 10 | 11 | Since version 2.1 *ViTables* has a simple but powerful plugins framework. 12 | 13 | If you are interested in writing plugins the next paragraphs can be of utility. If not you can skip to the list of available plugins. 14 | 15 | Plugins live in the plugins subdirectory of the root directory where the source code is installed. A plugin can be a pure Python module 16 | or can have a package structure (i.e. a directory with a :mod:`__init__.py` file). Packages can have as many directories as you want but 17 | plugins must be located at top level of the package. 18 | 19 | The use of contracts is not enforced when writing plugins so you have nearly complete freedom for writing them. Nevertheless a plugin must 20 | declare the following variables. :const:`plugin_class` which is set to the name of the class invoqued when your plugin is executed by *ViTables*, 21 | :const:`plugin_name` which is set to the descriptive name of the plugin and will be used in the Plugins page of the Preferences dialog and, 22 | finally, :const:`comment` which is set to a short description of the plugin and will be used too in the Plugins page of the Preferences dialog. 23 | 24 | In some cases it can be useful to use convenience variables or methods. For instance, suppose than in the Preferences dialog you want to show a 25 | more complete description of your plugin that that provided by the :const:`comment` variable. Then you may be interested in define a method 26 | :meth:`!helpAbout` in your plugin. 27 | 28 | Of course some knowledge (not necessarily a deep one) of the *ViTables* code is required in order to bind your plugin to the application core. 29 | This task is commonly achieved via the menu bar of the main window or via the signals/slots mechanism (convenience signals can be defined in 30 | the application if needed). 31 | 32 | If you need more help just send an email to developers or ask to the *ViTables* Users' Group. 33 | 34 | Three plugins are currently distributed along with the application: 35 | 36 | Time series 37 | formats time series in a human friendly way. It supports PyTables time datatypes and PyTables time series created via scikits.timeseries 38 | module. The format used for displaying times can be configured by user via the Preferences dialog or editing by hand the 39 | :file:`time_format.ini` configuration file. 40 | 41 | Import CSV 42 | provides import capabilities from :abbr:`CSV` files into PyTables datasets. 43 | 44 | Export CSV 45 | provides export capabilities of PyTables datasets to :abbr:`CSV` files. 46 | 47 | -------------------------------------------------------------------------------- /doc/usersguide-app2.rst: -------------------------------------------------------------------------------- 1 | The Help Browser 2 | ================ 3 | 4 | *ViTables* comes with its own 5 | fully-integrated documentation browser. It allows the 6 | *ViTables* User's Guide to be browsed without 7 | leaving the current working session and without opening external 8 | applications. You can start the browser issuing the 9 | :menuselection:`Help --> User's Guide` 10 | command or from the toolbar. 11 | 12 | The help browser is a small HTML browser for 13 | *local* documents. Despite its small size it exhibits 14 | some nice features 15 | 16 | - bookmarks 17 | 18 | - session history 19 | 20 | - easy document navigation through navigation buttons 21 | 22 | A nice feature of bookmarks is that they can be navigated while they are being edited with the Bookmarks 23 | Editing dialog. Simply double click on a bookmark and it will be displayed in the browser. 24 | 25 | .. _help-browser: 26 | .. figure:: images/helpBrowser.png 27 | :width: 80% 28 | 29 | The Users' Guide browser 30 | 31 | -------------------------------------------------------------------------------- /doc/usersguide-ch4.rst: -------------------------------------------------------------------------------- 1 | .. sectnum:: 2 | :start: 4 3 | 4 | Editing Files 5 | ============= 6 | 7 | In this chapter we are going to describe briefly the editing 8 | capabilities of *ViTables*. 9 | 10 | Creating Complex Hierarchies 11 | ++++++++++++++++++++++++++++ 12 | 13 | *ViTables* supports a complete set of 14 | editing operations on files and nodes. The result of these operations is 15 | made immediately visible on the databases tree viewer. 16 | 17 | To create a new file in write mode, just issue the command :menuselection:`File --> New…` (:kbd:`Ctrl-N`). 18 | By default, the file will be created with a ``.h5`` 19 | extension but you can provide your desired extension. 20 | 21 | You can add new empty groups to a writable file as easily as you 22 | create a new file. Simply select a group on the the tree pane and launch 23 | the command 24 | :menuselection:`Node --> New group…`. 25 | A new, empty group will be added to the previously selected group. By 26 | combining this operation with file creation, you can easily create 27 | complex hierarchies. Later on, you can populate the hierarchies with real 28 | data using your PyTables programs. 29 | 30 | .. _group-creation: 31 | .. figure:: images/groupCreation.png 32 | :width: 80% 33 | 34 | Creating a new group 35 | 36 | Editing Object Trees 37 | ++++++++++++++++++++ 38 | 39 | Files opened in write mode can be modified by moving their nodes 40 | (groups and leaves) around. From the 41 | :guilabel:`Node` 42 | menu you can copy, paste, cut, rename or delete any selected node 43 | (except root groups). Typical keyboard shortcuts are available for copy 44 | and paste operations. Of course, you can drag and drop nodes from one 45 | location to a different one using the mouse. 46 | 47 | Nodes can be moved to a different location in the object tree, but 48 | can also be reallocated in a different file. This way you can 49 | *merge* open files in a very flexible and comfortable 50 | way. 51 | 52 | As usual, while an operation is being performed on a given node, 53 | the shape of the mouse cursor will change into a clock, reminding you 54 | that a PyTables operation is being executed. 55 | 56 | Given a node opened in read-write mode you can edit its user attributes from 57 | the User attributes page 58 | (see :ref:`this Figure`) 59 | in the node Properties dialog. This page contains the user attributes 60 | table. You can add and remove attributes with the respective buttons or 61 | you can edit any existing attribute by clicking the table cell that you 62 | want to modify and introducing the new value. This way you can change 63 | name, value and type of any existing attribute. 64 | 65 | .. note:: multidimensional attribute values are not supported by *ViTables*. Also be aware that scalar attributes will be saved as scalar Numpy objects instead of serialized using cPickle (which used to be the default PyTables behavior). This way you will be able to read them using generic :abbr:`HDF5` tools, not just PyTables. 66 | 67 | Finally, the value of the TITLE system attribute can also be 68 | edited. 69 | Just click its cell in the System Attributes tab and enter the desired 70 | value. 71 | 72 | .. _editing_user_attributes: 73 | .. figure:: images/editingUserAttrs.png 74 | :width: 60% 75 | 76 | Editing user attributes 77 | 78 | Editing Leaves 79 | ++++++++++++++ 80 | 81 | At the moment of writing, editing the real data stored in leaves 82 | has not yet been implemented. 83 | 84 | -------------------------------------------------------------------------------- /doc/usersguide-ch5.rst: -------------------------------------------------------------------------------- 1 | .. sectnum:: 2 | :start: 5 3 | 4 | .. _configuration-chapter: 5 | 6 | Configuring ViTables 7 | ==================== 8 | 9 | As mentioned earlier, many aspects of the *ViTables* behaviour can 10 | be customized by you through the 11 | :menuselection:`Settings --> Preferences` 12 | command. 13 | 14 | It shows a dialog offering you several customization 15 | possibilities. The dialog is made of three stacked pages, 16 | :guilabel:`General`, :guilabel:`Look & Feel` and 17 | :guilabel:`Plugins`. 18 | 19 | The :guilabel:`General` page allows to change the 20 | *ViTables* behavior at startup. You can set the 21 | initial working directory to be that one from which *ViTables* is starting or 22 | to be the last used 23 | working directory. And you can recover your last working session. 24 | 25 | The :guilabel:`Look & Feel` page allows to change visual 26 | aspects of the application such as fonts, colors or even the general style, 27 | so you can adapt the global aspect of *ViTables* 28 | to what would be expected on your platform. 29 | 30 | From the :guilabel:`Plugins` page the plugins can be managed. You 31 | can enable or disable the available plugins. Changes in this page will take effect 32 | the next time you start *ViTables*. 33 | 34 | The :guilabel:`OK` button will apply the new settings and 35 | make them permanent by saving them in the Windows registry, in a 36 | configuration file (on Unix platforms) or in a plist file (on Mac OS X platforms). Even 37 | if settings are stored in a plain text file editing it by hand is not 38 | recommended. Some settings, like fonts or geometry settings [#f3]_, are stored in a way not really intended to be modified manually. 39 | 40 | Anyway it can be worth how settings are stored so let's do it. 41 | The configuration file is divided into sections, labeled as 42 | [section_name]. Every section is made of subsections 43 | written as key/value pairs and representing the item that is being 44 | customized. 45 | Currently the following sections/subsections are available: 46 | 47 | [Geometry] HSplitter 48 | the size of the horizontal splitter 49 | 50 | [Geometry] Layout 51 | the position and size of toolbars and dock widgets 52 | 53 | [Geometry] Position 54 | the position and size of the application window 55 | 56 | [Geometry] VSplitter 57 | the size of the vertical splitter 58 | 59 | [HelpBrowser] Bookmarks 60 | the list of current bookmarks of the help browser 61 | 62 | [HelpBrowser] History 63 | the navigation history of the help browser 64 | 65 | [Logger] Font 66 | the logger font 67 | 68 | [Logger] Paper 69 | the logger background color 70 | 71 | [Logger] Text 72 | the logger text color 73 | 74 | [Look] currentStyle 75 | the style that defines the application look & feel. Available styles fit the most common platforms, i.e., Windows, Unix (Motif and SGI flavors), and Macintosh 76 | 77 | [Plugins] Enabled 78 | the list of full paths of enabled plugins 79 | 80 | [Recent] Files 81 | the list of files recently opened 82 | 83 | [Session] Files 84 | the list of files and views that were open the last time *ViTables* was closed 85 | 86 | [Startup] lastWorkingDir 87 | the last directory accessed from within *ViTables* via Open File dialog 88 | 89 | [Startup] restoreLastSession 90 | the last working session is restored (if possible) which means that both files and leaves that were open in the last session will be reopen at application startup. 91 | 92 | [Startup] startupWorkingDir 93 | possible values are *current*, and *last*. These values indicate how the application will setup the startup working directory. 94 | 95 | [Workspace] Background 96 | the workspace background brush 97 | 98 | .. rubric:: Footnotes 99 | 100 | .. [#f3] Entries in the Geometry section allow for keeping the aspect, size and position of the application window between sessions. 101 | 102 | -------------------------------------------------------------------------------- /doc/vitables_cover.tmpl: -------------------------------------------------------------------------------- 1 | .. role:: normal 2 | 3 | 4 | 5 | .. cssclass:: title 6 | 7 | #{title} 8 | 9 | 10 | 11 | 12 | 13 | .. cssclass:: subtitle 14 | 15 | #{subtitle} 16 | 17 | 18 | 19 | .. raw:: pdf 20 | 21 | Spacer 0 3cm 22 | 23 | 24 | .. cssclass:: author 25 | 26 | #{author} 27 | 28 | 29 | 30 | .. raw:: pdf 31 | 32 | Spacer 0 3cm 33 | 34 | .. cssclass:: author 35 | 36 | :normal:`#{date}` 37 | 38 | .. raw:: pdf 39 | 40 | PageBreak cutePage 41 | 42 | -------------------------------------------------------------------------------- /examples/arrays/array_samples.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/arrays/array_samples.h5 -------------------------------------------------------------------------------- /examples/arrays/carray_sample.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/arrays/carray_sample.h5 -------------------------------------------------------------------------------- /examples/arrays/earray_samples.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/arrays/earray_samples.h5 -------------------------------------------------------------------------------- /examples/arrays/vlarray_samples.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/arrays/vlarray_samples.h5 -------------------------------------------------------------------------------- /examples/misc/MDobjects.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/misc/MDobjects.h5 -------------------------------------------------------------------------------- /examples/misc/external_file.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/misc/external_file.h5 -------------------------------------------------------------------------------- /examples/misc/fnode.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/misc/fnode.h5 -------------------------------------------------------------------------------- /examples/misc/genericHDF5.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/misc/genericHDF5.h5 -------------------------------------------------------------------------------- /examples/misc/links_examples.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/misc/links_examples.h5 -------------------------------------------------------------------------------- /examples/misc/nonalphanum.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/misc/nonalphanum.h5 -------------------------------------------------------------------------------- /examples/misc/objecttree.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/misc/objecttree.h5 -------------------------------------------------------------------------------- /examples/misc/szip_compressor.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/misc/szip_compressor.h5 -------------------------------------------------------------------------------- /examples/scripts/MDobjects.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This is meant to exercise ViTables capability to zoom into 24 | multidimensional cells. 25 | It also works to check views of multidimensional attributes. 26 | """ 27 | 28 | import tables 29 | import numpy 30 | 31 | class Particle(tables.IsDescription): 32 | """Description of a table record.""" 33 | name = tables.StringCol(16, pos=1) 34 | lati = tables.IntCol(pos=2) 35 | vector = tables.Int32Col(shape=(200,), pos=3) 36 | matrix1 = tables.Int32Col(shape=(2, 200), pos=4) 37 | matrix2 = tables.FloatCol(shape=(100, 2), pos=5) 38 | matrix3 = tables.FloatCol(shape=(10, 100, 2), pos=5) 39 | matrix4 = tables.FloatCol(shape=(2, 10, 100, 2), pos=5) 40 | 41 | # Open a file in "w"rite mode 42 | fileh = tables.open_file("MDobjects.h5", mode = "w") 43 | # Create the table with compression 'on' in order to reduce size as 44 | # much as possible 45 | table = fileh.create_table(fileh.root, 'table', Particle, "A table", 46 | filters=tables.Filters(complevel=1)) 47 | # Append several rows with default values 48 | for i in range(10): 49 | table.row.append() 50 | table.flush() 51 | 52 | # create new arrays 53 | atom1 = tables.IntAtom() 54 | shape1 = (2, 10, 10, 1) 55 | filters1 = tables.Filters(complevel=1) 56 | #(2, 10, 10, 3) 57 | array1 = fileh.create_carray(fileh.root, 'array1', atom1, shape1, 58 | filters=filters1) 59 | atom2 = tables.FloatAtom() 60 | shape2 = (2, 10, 10, 3, 1) 61 | filters2 = tables.Filters(complevel=1) 62 | #(2, 10, 10, 3, 200) 63 | array2 = fileh.create_carray(fileh.root, 'array2', atom2, shape2, 64 | filters=filters2) 65 | 66 | # Add multimensional attributes to the objects 67 | # Integers will go in /table 68 | table.attrs.MD1 = numpy.arange(5, dtype="int8") 69 | table.attrs.MD2 = numpy.arange(10, dtype="int64").reshape(2, 5) 70 | 71 | # Complex will go in /array1 72 | array1.attrs.MD1 = numpy.arange(5, dtype="complex128") 73 | array1.attrs.MD2 = numpy.arange(10, dtype="complex128").reshape(2, 5) 74 | 75 | # Strings will go in /array2 76 | array2.attrs.MD1 = numpy.array(['Hi', 'world!'], dtype='|S6') 77 | array2.attrs.MD2 = numpy.array([['Hi', 'world!'], 78 | ['Hola', 'mon!']], dtype='|S4') 79 | 80 | fileh.close() 81 | -------------------------------------------------------------------------------- /examples/scripts/array_samples.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | # 23 | # This script is based on a set of scripts by Francesc Alted. 24 | 25 | """Several simple Arrays.""" 26 | 27 | import numpy 28 | import tables 29 | 30 | # Open a new empty HDF5 file 31 | fileh = tables.open_file("array_samples.h5", mode = "w") 32 | # Get the root group 33 | root = fileh.root 34 | 35 | # Create an Array 36 | a = numpy.array([-1, 2, 4], numpy.int16) 37 | # Save it on the HDF5 file 38 | hdfarray = fileh.create_array(root, 'array_int16', a, "Signed short array") 39 | 40 | # Create a scalar Array 41 | a = numpy.array(4, numpy.int16) 42 | # Save it on the HDF5 file 43 | hdfarray = fileh.create_array(root, 'scalar_array', a, 44 | "Scalar signed short array") 45 | 46 | # Create a 3-d array of floats 47 | a = numpy.arange(120, dtype=numpy.float64).reshape(20, 3, 2) 48 | # Save it on the HDF5 file 49 | hdfarray = fileh.create_array(root, 'array_f3D', a, "3-D float array") 50 | 51 | # Create an array of floats 52 | a = numpy.array([1, 2.7182818284590451, 3.141592], numpy.float) 53 | # Save it on the HDF5 file 54 | hdfarray = fileh.create_array(root, 'array_f', a, "Float array") 55 | 56 | # Create a large array 57 | #a = reshape(array(range(2**16), "s"), (2,) * 16) 58 | a = numpy.ones((2,) * 8, numpy.int8) 59 | 60 | # Save it on the HDF5 file 61 | hdfarray = fileh.create_array(root, 'array_int8', a, "Large array") 62 | 63 | # Create a set of arrays and save them on the HDF5 file 64 | basedim = 4 65 | group = root 66 | dtypes = [numpy.int8, numpy.uint8, numpy.int16, numpy.int, numpy.float32, 67 | numpy.float] 68 | i = 1 69 | for dtype in dtypes: 70 | # Create an array of dtype, with incrementally bigger ranges 71 | a = numpy.ones((basedim,) * i, dtype) 72 | # Save it on the HDF5 file 73 | dsetname = 'array_' + a.dtype.char 74 | hdfarray = fileh.create_array(group, dsetname, a, "Large array") 75 | # Create a new group 76 | group = fileh.create_group(root, 'group' + str(i)) 77 | # increment the range for next iteration 78 | i += 1 79 | 80 | # Close the file 81 | fileh.close() 82 | 83 | -------------------------------------------------------------------------------- /examples/scripts/array_timeseries.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """CArray with time fields. 22 | """ 23 | 24 | import os 25 | import time 26 | 27 | import tables 28 | 29 | output_dir = '../timeseries' 30 | try: 31 | os.mkdir(output_dir) 32 | except OSError: 33 | pass 34 | 35 | # Open a new empty HDF5 file 36 | hdf5_name = "carray_ts.h5" 37 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 38 | h5file = tables.open_file(filepath_hdf5, mode="w", 39 | title='Example CArray with time fields') 40 | 41 | # Create a CArray and fill it 42 | root = h5file.root 43 | shape = (300, 2) 44 | atom = tables.Time32Atom() 45 | filters = tables.Filters(complevel=5, complib='zlib') 46 | hdfarray = h5file.create_carray(root, 'test_carray_1', atom, shape, 47 | "Signed short array") 48 | now = time.time() 49 | seconds_by_day = 1*24*60*60 50 | for index in range(0, 600, 2): 51 | seconds = now - seconds_by_day * index 52 | hdfarray[index/2, 0] = seconds 53 | hdfarray[299-index/2, 1] = seconds 54 | 55 | # Create other CArray and fill it 56 | shape = (300,) 57 | atom = tables.Time32Atom(shape=(2,)) 58 | filters = tables.Filters(complevel=5, complib='zlib') 59 | hdfarray = h5file.create_carray(root, 'test_carray_2', atom, shape, 60 | "Signed short array") 61 | now = time.time() 62 | seconds_by_day = 1*24*60*60 63 | for index in range(0, 600, 2): 64 | seconds = now - seconds_by_day * index 65 | hdfarray[index/2] = [seconds, seconds] 66 | 67 | h5file.close() 68 | -------------------------------------------------------------------------------- /examples/scripts/carray_samples.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | # 23 | # This script is based on a script by Francesc Alted. 24 | 25 | """A simple CArray.""" 26 | 27 | import numpy 28 | import tables 29 | 30 | fileName = 'carray_sample.h5' 31 | shape = (200, 300) 32 | atom = tables.UInt8Atom() 33 | filters = tables.Filters(complevel=5, complib='zlib') 34 | 35 | h5f = tables.open_file(fileName, 'w') 36 | ca = h5f.create_carray(h5f.root, 'carray', atom, shape, filters=filters) 37 | ca[10:60, 20:70] = numpy.ones((50, 50)) 38 | h5f.close() 39 | -------------------------------------------------------------------------------- /examples/scripts/create-large-table.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """This program creates a potentially big table for tests purposes. 23 | 24 | The program is based on the tutorial programs included in the PyTables 25 | User's Guide. 26 | 27 | Modified to use buffers so that filling times are bettered by one order of 28 | magnitude. F. Altet 2006-02-27 29 | """ 30 | 31 | import time 32 | from numpy import arange 33 | import tables 34 | 35 | t0 = time.time() 36 | 37 | # Describe a particle record 38 | class Particle(tables.IsDescription): 39 | """Description of a table record.""" 40 | lati = tables.IntCol(pos=0) 41 | longi = tables.IntCol(pos=1) 42 | temperature = tables.FloatCol(pos=2) 43 | pressure = tables.FloatCol(pos=3) 44 | 45 | # Open a file in "w"rite mode 46 | fileh = tables.open_file("large_table.h5", mode = "w") 47 | 48 | # Get the HDF5 root group 49 | root = fileh.root 50 | # Create a group 51 | group = fileh.create_group(root, "Particles") 52 | 53 | # Now, create and fill the tables in Particles group 54 | filters = tables.Filters(complevel=1, complib='lzo', shuffle=1) 55 | nrows = 10**7 56 | table = fileh.create_table("/Particles", "TParticle", Particle, 57 | "Sample set of particles ", filters, expectedrows = nrows) 58 | 59 | # Number of rows in buffer 60 | nrowsbuf = 10000 61 | # Fill the table with 10**N particles 62 | for i in xrange(0, nrows, nrowsbuf): 63 | if i + nrowsbuf > nrows: 64 | nrapp = nrows - i 65 | else: 66 | nrapp = nrowsbuf 67 | # First, assign the values to the Particle record 68 | lati = arange(i, i + nrapp) 69 | longi = 10 - lati 70 | temperature = lati + 0.5 71 | pressure = 10.5 - lati 72 | # This injects the Record values 73 | table.append([lati, longi, temperature, pressure]) 74 | 75 | # Flush the table buffers and close the file 76 | fileh.close() 77 | 78 | tsec = round((time.time() - t0), 3) 79 | print 'Last of the run: %s s' % (tsec) 80 | -------------------------------------------------------------------------------- /examples/scripts/earray_samples.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | # 23 | # This script is based on a set of scripts by Francesc Alted. 24 | 25 | """Several simple EArrays.""" 26 | 27 | import tables 28 | import numpy 29 | 30 | fileh = tables.open_file('earray_samples.h5', mode='w') 31 | 32 | root = fileh.root 33 | a = tables.StringAtom(itemsize=8) 34 | # Use ``a`` as the object type for the enlargeable array. 35 | array_c = fileh.create_earray(root, 'array_c', a, (0,), "Chars") 36 | array_c.append(numpy.array(['a'*2, 'b'*4], dtype='S8')) 37 | array_c.append(numpy.array(['a'*6, 'b'*8, 'c'*10], dtype='S8')) 38 | 39 | # Create an string atom 40 | a = tables.StringAtom(itemsize=1) 41 | # Use it as a type for the enlargeable array 42 | hdfarray = fileh.create_earray(root, 'array_char', a, (0,), "Character array") 43 | hdfarray.append(numpy.array(['a', 'b', 'c'])) 44 | # The next is legal: 45 | hdfarray.append(numpy.array(['c', 'b', 'c', 'd'])) 46 | # but these are not: 47 | #hdfarray.append(array([['c', 'b'], ['c', 'd']])) 48 | #hdfarray.append(array([[1,2,3],[3,2,1]], dtype=uint8).reshape(2,1,3)) 49 | 50 | # Create an atom 51 | a = tables.UInt16Atom() 52 | hdfarray = fileh.create_earray(root, 'array_e', a, (2, 0, 3), 53 | "Unsigned short array") 54 | 55 | # Create an enlargeable array 56 | a = tables.UInt8Atom() 57 | hdfarray = fileh.create_earray(root, 'array_b', a, (2, 0, 3), 58 | "Unsigned byte array", tables.Filters(complevel = 1)) 59 | 60 | # Append an array to this table 61 | hdfarray.append(numpy.array([[1, 2, 3], [3, 2, 1]], 62 | dtype=numpy.uint8).reshape(2, 1, 3)) 63 | hdfarray.append(numpy.array([[1, 2, 3], [3, 2, 1], [2, 4, 6], [6, 4, 2]], 64 | dtype=numpy.uint8).reshape(2,2,3)*2) 65 | # The next should give a type error: 66 | #hdfarray.append(array([[1,0,1],[0,0,1]], dtype=Bool).reshape(2,1,3)) 67 | 68 | # Close the file. 69 | fileh.close() 70 | -------------------------------------------------------------------------------- /examples/scripts/filenode_sample.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | # 23 | # This script is based on a script by Ivan Vilata. 24 | 25 | """How to use the filenode module.""" 26 | 27 | from tables.nodes import filenode 28 | import tables 29 | 30 | h5file = tables.open_file('fnode.h5', 'w') 31 | 32 | fnode = filenode.new_node(h5file, where='/', name='fnode_test') 33 | print >> fnode, "This is a test text line." 34 | print >> fnode, "And this is another one." 35 | print >> fnode 36 | fnode.write("Of course, file methods can also be used.") 37 | fnode.close() 38 | 39 | node = h5file.root.fnode_test 40 | fnode = filenode.open_node(node, 'a+') 41 | print >> fnode, "This is a new line." 42 | 43 | fnode.attrs.content_type = 'text/plain; charset=us-ascii' 44 | 45 | fnode.attrs.author = "Ivan Vilata i Balaguer" 46 | fnode.attrs.creation_date = '2004-10-20T13:25:25+0200' 47 | fnode.attrs.keywords_en = ["FileNode", "test", "metadata"] 48 | fnode.attrs.keywords_ca = ["FileNode", "prova", "metadades"] 49 | fnode.attrs.owner = 'ivan' 50 | fnode.attrs.acl = {'ivan': 'rw', '@users': 'r'} 51 | 52 | fnode.close() 53 | h5file.close() 54 | -------------------------------------------------------------------------------- /examples/scripts/large_number_of_objects.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | "This creates an HDF5 file with a potentially large number of objects" 23 | 24 | import sys 25 | import numpy 26 | import tables 27 | 28 | filename = 'large_number_of_objects.h5' 29 | 30 | # Open a new empty HDF5 file 31 | fileh = tables.open_file(filename, mode = "w") 32 | 33 | # nlevels -- Number of levels in hierarchy 34 | # ngroups -- Number of groups on each level 35 | # ndatasets -- Number of arrays on each group 36 | # LR: Low ratio groups/datasets 37 | #nlevels, ngroups, ndatasets = (3, 1, 1000) 38 | # MR: Medium ratio groups/datasets 39 | nlevels, ngroups, ndatasets = (3, 10, 100) 40 | # HR: High ratio groups/datasets 41 | #nlevels, ngroups, ndatasets = (30, 10, 10) 42 | 43 | # Create an Array to save on disk 44 | a = numpy.array([-1, 2, 4], dtype=numpy.int16) 45 | 46 | group = fileh.root 47 | group2 = fileh.root 48 | for k in range(nlevels): 49 | for j in range(ngroups): 50 | for i in range(ndatasets): 51 | # Save the array on the HDF5 file 52 | fileh.create_array(group2, 'array'+str(i), a, "Signed short array") 53 | # Create a new group 54 | group2 = fileh.create_group(group, 'group'+str(j)) 55 | # Create a new group 56 | group3 = fileh.create_group(group, 'ngroup'+str(k)) 57 | # Iterate over this new group (group3) 58 | group = group3 59 | group2 = group3 60 | 61 | fileh.close() 62 | 63 | -------------------------------------------------------------------------------- /examples/scripts/linked_nodes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | "This creates an HDF5 file that contains soft and external links" 22 | 23 | import os 24 | 25 | import tables as tb 26 | 27 | output_dir = '../misc' 28 | try: 29 | os.mkdir(output_dir) 30 | except OSError: 31 | pass 32 | 33 | # Open a new empty HDF5 file 34 | hdf5_name = 'links_examples.h5' 35 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 36 | fileh = tb.open_file(filepath_hdf5, mode = "w") 37 | 38 | # Create some groups and add datasets to them 39 | garrays = fileh.create_group('/', 'arrays') 40 | a1 = fileh.create_carray(garrays, 'a1', tb.Int64Atom(shape=(2,)), shape=(100, 3), 41 | title='A linked array') 42 | gtables = fileh.create_group('/', 'tables') 43 | t1 = fileh.create_table(gtables, 't1', 44 | {'field1': tb.FloatCol(), 'field2': tb.IntCol()}, title='A linked table') 45 | 46 | # Create a group and put some links there 47 | glinks = fileh.create_group('/', 'links') 48 | 49 | # Hard link to table t1. If we remove t1 it will still be accessible via ht1. 50 | # Hard links are not a subclass of tables.link.Link so they don't have a 51 | # target attribute. Because hard links behave like regular nodes one can't 52 | # infer if ht1 is a hard link by calling its __str__ method 53 | ht1 = fileh.create_hard_link(glinks, 'ht1', '/tables/t1') 54 | t1.remove() 55 | 56 | # Soft link to array a1 57 | sa1 = fileh.create_soft_link(glinks, 'sa1', '/arrays/a1') 58 | 59 | # Soft link to table t1. This is a dangling link because it points to a 60 | # non-existing node. In order to get the pointed node the soft links are 61 | # callable >>> psa1 = sa1() 62 | st1 = fileh.create_soft_link(glinks, 'st1', '/tables/t1') 63 | # Recreate the pointed table so the link is not dangling 64 | hht1 = fileh.create_hard_link(gtables, 't1', '/links/ht1') 65 | 66 | # External links. They behave like soft links but point to nodes living in 67 | # a different file 68 | hdf5_name = 'external_file.h5' 69 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 70 | fileh2 = tb.open_file(filepath_hdf5, mode = "w") 71 | new_a1 = a1.copy(fileh2.root, 'a1') 72 | fileh2.close() 73 | sa1.remove() 74 | ea1 = fileh.create_external_link(glinks, 'ea1', 'external_file.h5:/a1') 75 | 76 | fileh.close() 77 | 78 | -------------------------------------------------------------------------------- /examples/scripts/nested_samples.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | # 23 | # This script is based on a set of scripts by Francesc Alted. 24 | 25 | """A Table with nested records.""" 26 | 27 | import random 28 | 29 | import tables 30 | 31 | fileout = "nested_samples.h5" 32 | 33 | # An example of enumerated structure 34 | colors = tables.Enum(['red', 'green', 'blue']) 35 | 36 | def write(h5file, desc, indexed): 37 | fileh = tables.open_file(h5file, "w") 38 | table = fileh.create_table(fileh.root, 'table', desc) 39 | #for colname in indexed: 40 | # table.colinstances[colname].create_index() 41 | 42 | row = table.row 43 | for i in range(10): 44 | row['x'] = i 45 | row['y'] = 10.2-i 46 | row['z'] = i 47 | row['color'] = colors[random.choice(['red', 'green', 'blue'])] 48 | row['extra_info/name'] = "name%s" % i 49 | row['extra_info/info2/info3/z4'] = i 50 | # All the rest will be filled with defaults 51 | row.append() 52 | 53 | fileh.close() 54 | 55 | # The sample nested class description 56 | 57 | class Info(tables.IsDescription): 58 | _v_pos = 2 59 | Name = tables.StringCol(16, dflt='sample string') 60 | Value = tables.Float64Col() 61 | 62 | class Test(tables.IsDescription): 63 | """A description that has several columns""" 64 | x = tables.Int32Col(shape=2, dflt=0, pos=0) 65 | y = tables.Float64Col(dflt=1.2, shape=(2, 3)) 66 | z = tables.UInt8Col(dflt=1) 67 | color = tables.EnumCol(colors, 'red', base='uint32', shape=(2,)) 68 | Info = Info() 69 | class extra_info(tables.IsDescription): 70 | _v_pos = 1 71 | name = tables.StringCol(10) 72 | value = tables.Float64Col(pos=0) 73 | y2 = tables.Float64Col(dflt=1, shape=(2, 3), pos=1) 74 | z2 = tables.UInt8Col(dflt=1) 75 | class info2(tables.IsDescription): 76 | y3 = tables.Float64Col(dflt=1, shape=(2, 3)) 77 | z3 = tables.UInt8Col(dflt=1) 78 | name = tables.StringCol(10) 79 | value = tables.EnumCol(colors, 'blue', base='uint32', shape=(1,)) 80 | class info3(tables.IsDescription): 81 | name = tables.StringCol(10) 82 | value = tables.Time64Col() 83 | y4 = tables.Float64Col(dflt=1, shape=(2, 3)) 84 | z4 = tables.UInt8Col(dflt=1) 85 | 86 | # Write the file and read it 87 | write(fileout, Test, ['info/info2/z3']) 88 | -------------------------------------------------------------------------------- /examples/scripts/objecttree.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | # 23 | # This script is based on a set of scripts by Francesc Alted. 24 | 25 | """Sample of a typical object tree.""" 26 | 27 | import tables 28 | 29 | class Particle(tables.IsDescription): 30 | identity = tables.StringCol(itemsize=22, dflt=" ", pos=0) # character String 31 | idnumber = tables.Int16Col(dflt=1, pos = 1) # short integer 32 | speed = tables.Float32Col(dflt=1, pos = 1) # single-precision 33 | 34 | # Open a file in "w"rite mode 35 | fileh = tables.open_file("objecttree.h5", mode = "w") 36 | # Get the HDF5 root group 37 | root = fileh.root 38 | 39 | # Create the groups: 40 | group1 = fileh.create_group(root, "group1") 41 | group2 = fileh.create_group(root, "group2") 42 | 43 | # Now, create an array in root group 44 | array1 = fileh.create_array(root, "array1", ["string", "array"], "String array") 45 | # Create 2 new tables in group1 46 | table1 = fileh.create_table(group1, "table1", Particle) 47 | table2 = fileh.create_table("/group2", "table2", Particle) 48 | # Create the last table in group2 49 | array2 = fileh.create_array("/group1", "array2", [1,2,3,4]) 50 | 51 | # Now, fill the tables: 52 | for table in (table1, table2): 53 | # Get the record object associated with the table: 54 | row = table.row 55 | # Fill the table with 10 records 56 | for i in xrange(10): 57 | # First, assign the values to the Particle record 58 | row['identity'] = 'This is particle: %2d' % (i) 59 | row['idnumber'] = i 60 | row['speed'] = i * 2. 61 | # This injects the Record values 62 | row.append() 63 | 64 | # Flush the table buffers 65 | table.flush() 66 | 67 | # Finally, close the file (this also will flush all the remaining buffers!) 68 | fileh.close() 69 | -------------------------------------------------------------------------------- /examples/scripts/pandas_timeseries1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """Storing time series created with Pandas in PyTables. Example 1. 22 | """ 23 | 24 | import os 25 | 26 | import numpy as np 27 | import pandas as pd 28 | 29 | ## A test series, the deprecated way (not supported by timeseries plugin) 30 | #startdate = pd.Period(freq='D', year=2009, month=1, day=1) 31 | #rng = pd.period_range(startdate, periods=365) 32 | #ts = pd.Series(np.arange(1, 366), index=rng) 33 | 34 | ## A test series, the recommended way 35 | dti = pd.DatetimeIndex(start='1/1/2009', freq='D', periods=365) 36 | ts = pd.Series(np.arange(1, 366), index=dti) 37 | # Saving this time series in a HDFStore will add two arrays to the h5 file 38 | # one array with the index and other with the data 39 | # So we create a data frame in order to store all the information in a table 40 | df = pd.DataFrame(ts) 41 | 42 | # Write to a PyTables file 43 | output_dir = '../timeseries' 44 | try: 45 | os.mkdir(output_dir) 46 | except OSError: 47 | pass 48 | 49 | hdf5_name = 'pandas_test1.hdf5' 50 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 51 | store = pd.HDFStore(filepath_hdf5) 52 | 53 | # The following code create a group with 1 leaf (Table instance) 54 | # df 55 | # |_ table 56 | store.append('one_column_ts', df) 57 | store.close() 58 | 59 | -------------------------------------------------------------------------------- /examples/scripts/pandas_timeseries2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """Storing time series created with Pandas in PyTables. Example 2. 22 | """ 23 | 24 | import os 25 | import datetime 26 | 27 | import pandas 28 | from pandas.io.data import DataReader 29 | 30 | startdate = datetime.date(2002, 1, 5) 31 | enddate = datetime.date(2003, 12, 1) 32 | 33 | # retrieve data from yahoo. 34 | # Retrieve Intel Corp. prices of stocks from Yahoo! Finance historical data pages 35 | # Data format is [(d, [open, high, low, close, adj close], volume), ...] 36 | intc = DataReader('INTC', 'yahoo', startdate, enddate) 37 | 38 | # Write to a PyTables file 39 | output_dir = '../timeseries' 40 | try: 41 | os.mkdir(output_dir) 42 | except OSError: 43 | pass 44 | 45 | hdf5_name = 'pandas_test2.hdf5' 46 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 47 | store = pandas.HDFStore(filepath_hdf5) 48 | 49 | # The following code stores the information in a Table instance 50 | # intc 51 | # |_ table (field index contains the dates range used as index, field 52 | # values_block0 contains [open, high, low, close, adj close], 53 | # field values_block1 contains volume 54 | # shape is (480,)) 55 | store.append('intc', intc) 56 | store.close() 57 | 58 | -------------------------------------------------------------------------------- /examples/scripts/pandas_timeseries3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """Storing time series created with Pandas in PyTables. Example 3. 22 | """ 23 | 24 | import os 25 | 26 | import numpy.random as nr 27 | import pandas 28 | 29 | ## a test data frame with 3 column and 365 rows 30 | index = pandas.date_range('1/1/2009', periods=365, freq='D') 31 | df = pandas.DataFrame(nr.randn(365, 3), index=index, columns=['A', 'B', 'C']) 32 | 33 | # Write to a PyTables file 34 | output_dir = '../timeseries' 35 | try: 36 | os.mkdir(output_dir) 37 | except OSError: 38 | pass 39 | 40 | hdf5_name = 'pandas_test3.hdf5' 41 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 42 | store = pandas.HDFStore(filepath_hdf5) 43 | 44 | # The following code create a group with 4 leaves (Array instances) 45 | # df 46 | # |_ axis1 (the row index, a range of dates, shape is (365,)) 47 | # |_ axis0 (the column index, shape is (3,)) 48 | # |_ block0_values (the random array of values, shape is (365,3)) 49 | # |_ block0_items (identical to axis0) 50 | store['df'] = df 51 | 52 | # The following code stores the same information in a Table instance 53 | # df_table 54 | # |_ table (field index contains the range of dates used as index, field 55 | # values_block0 contains the random array of values, 56 | # shape is (365,)) 57 | store.append('df_table', df) 58 | store.close() 59 | 60 | -------------------------------------------------------------------------------- /examples/scripts/scikits_timeseries1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """Storing time series created with scikits.timeseries module in PyTables. 22 | Example 1. 23 | """ 24 | 25 | import os 26 | 27 | import numpy as np 28 | 29 | import scikits.timeseries as ts 30 | import scikits.timeseries.lib.tstables as tstab 31 | import scikits.timeseries.lib.reportlib as rl 32 | 33 | ## a test series 34 | data = np.arange(1, 366) 35 | startdate = ts.Date(freq='D', year=2009, month=1, day=1) 36 | test_series = ts.time_series(data, start_date=startdate, freq='D') 37 | 38 | output_dir = '../timeseries' 39 | try: 40 | os.mkdir(output_dir) 41 | except OSError: 42 | pass 43 | 44 | ## write to csv file 45 | csv_file = os.path.abspath(os.path.join(output_dir, 'test_series.csv')) 46 | mycsv = open(csv_file, 'w') 47 | csvReport = rl.Report(test_series, delim=';', 48 | fixed_width=True) 49 | csvReport(output=mycsv) 50 | mycsv.close() 51 | 52 | # Write to a PyTables file 53 | hdf5_name = 'scikits_test1.hdf5' 54 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 55 | h5file = tstab.open_file(filepath_hdf5, mode="w", 56 | title='Example table with csikits time series') 57 | group_doc = h5file.create_group("/", 'examples', 'Test Data') 58 | table = h5file.createTimeSeriesTable(group_doc, 'Example_1', test_series) 59 | h5file.close() 60 | 61 | -------------------------------------------------------------------------------- /examples/scripts/scikits_timeseries2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """Storing time series created with scikits.timeseries module in PyTables. 22 | Example 2. 23 | 24 | Notes: 25 | -The dates from the yahoo quotes module get returned as integers, which happen 26 | to correspond to the integer representation of 'DAILY' frequency dates in the 27 | scikits.timeseries module. 28 | -`fill_missing_dates` will insert masked values for any missing data points. 29 | Note that you could plot the series without doing this, but it would cause 30 | missing values to be linearly interpolated rather than left empty in the plot 31 | """ 32 | 33 | import os 34 | import datetime 35 | 36 | from matplotlib.finance import quotes_historical_yahoo 37 | import scikits.timeseries as ts 38 | import scikits.timeseries.lib.tstables as tstab 39 | 40 | startdate = datetime.date(2002, 1, 5) 41 | enddate = datetime.date(2003, 12, 1) 42 | 43 | # retrieve data from yahoo. 44 | # Data format is [(d, open, close, high, low, volume), ...] where d is 45 | # a floating point representation of the number of days since 01-01-01 UTC 46 | quotes = quotes_historical_yahoo('INTC', startdate, enddate) 47 | 48 | # Create a DateArray of daily dates and convert it to business day frequency 49 | dates = ts.date_array([q[0] for q in quotes], freq='DAILY').asfreq('BUSINESS') 50 | 51 | opens = [q[1] for q in quotes] 52 | 53 | # opens: the data portion of the timeserie 54 | # dates: the date portion of the timeserie 55 | raw_series = ts.time_series(opens, dates) 56 | test_series = raw_series 57 | #test_series = ts.fill_missing_dates(raw_series, fill_value=-1) 58 | 59 | # Write to a PyTables file 60 | output_dir = '../timeseries' 61 | try: 62 | os.mkdir(output_dir) 63 | except OSError: 64 | pass 65 | 66 | hdf5_name = 'scikits_test2.hdf5' 67 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 68 | h5file = tstab.open_file(filepath_hdf5, mode="w", 69 | title='Example table with csikits time series') 70 | group_doc = h5file.create_group("/", 'examples', 'Test Data') 71 | table = h5file.createTimeSeriesTable(group_doc, 'Example_2', test_series) 72 | h5file.close() 73 | 74 | -------------------------------------------------------------------------------- /examples/scripts/scikits_timeseries3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """Storing time series created with scikits.timeseries module in PyTables. 22 | Example 3. 23 | """ 24 | 25 | import os 26 | 27 | import numpy as np 28 | 29 | import scikits.timeseries as ts 30 | import scikits.timeseries.lib.tstables as tstab 31 | 32 | # Generate random data 33 | data = np.cumprod(1 + np.random.normal(0, 1, 300)/100) 34 | series = ts.time_series(data, start_date=ts.Date(freq='M', year=1982, month=1)) 35 | 36 | # Write to a PyTables file 37 | output_dir = '../timeseries' 38 | try: 39 | os.mkdir(output_dir) 40 | except OSError: 41 | pass 42 | 43 | hdf5_name = 'scikits_test3.hdf5' 44 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 45 | h5file = tstab.open_file(filepath_hdf5, mode="w", 46 | title='Example table with csikits time series') 47 | group_doc = h5file.create_group("/", 'examples', 'Test Data') 48 | table = h5file.createTimeSeriesTable(group_doc, 'Example_3', series) 49 | h5file.close() 50 | 51 | -------------------------------------------------------------------------------- /examples/scripts/table_timeseries.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """Table with time fields.""" 22 | 23 | import os 24 | import time 25 | import numpy 26 | 27 | import tables 28 | 29 | # Describe a particle record 30 | class Particle(tables.IsDescription): 31 | """This class defines a table record. 32 | """ 33 | 34 | lati = tables.IntCol(pos=0) 35 | # longi = IntCol(pos=1) 36 | Time = tables.Time64Col(pos=2) 37 | pressure = tables.FloatCol(pos=3) 38 | ID = tables.StringCol(itemsize=10, pos=4) 39 | Int16 = tables.UIntCol(itemsize=4, pos=5) 40 | Int64 = tables.IntCol(itemsize=8, pos=6) 41 | Bool = tables.BoolCol(pos=7) 42 | 43 | output_dir = '../timeseries' 44 | try: 45 | os.mkdir(output_dir) 46 | except OSError: 47 | pass 48 | 49 | # Open a new empty HDF5 file 50 | hdf5_name = "table_ts.h5" 51 | filepath_hdf5 = os.path.join(output_dir, hdf5_name) 52 | h5file = tables.open_file(filepath_hdf5, mode="w", 53 | title='Example Table with time series') 54 | 55 | # Get the HDF5 root group 56 | root = h5file.root 57 | group = h5file.create_group(root, "Particles") 58 | filters = tables.Filters(complevel=1, complib='lzo', shuffle=1) 59 | nrows = 6000 60 | table = h5file.create_table("/Particles", "TParticle", Particle, 61 | "Sample set of particles ", filters, 62 | expectedrows = nrows) 63 | 64 | # Number of rows in buffer 65 | nrowsbuf = 1000 66 | # Fill the table with 10**N particles 67 | for i in numpy.arange(0, nrows, nrowsbuf, dtype=numpy.int64): 68 | if i+nrowsbuf > nrows: 69 | nrapp = nrows-i 70 | else: 71 | nrapp = nrowsbuf 72 | # First, assign the values to the Particle record 73 | Int64 = numpy.arange(i, i+nrapp) 74 | Time = Int64 + time.time() 75 | lati = Int64 76 | pressure = lati - 10.4 77 | ID = (i + Int64).astype('S10') 78 | Int16 = lati - 50 79 | Bool = lati % 3 > 1 80 | # This injects the Record values 81 | table.append([lati, Time, pressure, ID, Int16, Int64, Bool]) 82 | 83 | # Flush the table buffers and close the file 84 | h5file.close() 85 | -------------------------------------------------------------------------------- /examples/scripts/vlarray_samples.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """Several simple VLArrays.""" 23 | 24 | import cPickle 25 | 26 | import tables 27 | import numpy 28 | 29 | # Create a VLArray: 30 | fileh = tables.open_file('vlarray_samples.h5', mode='w') 31 | 32 | root = fileh.root 33 | vlarray = fileh.create_vlarray(root, 'vlarray1', 34 | tables.Int32Atom(), "ragged array of ints", filters=tables.Filters(1)) 35 | # Append some (variable length) rows: 36 | vlarray.append(numpy.array([5, 6])) 37 | vlarray.append(numpy.array([5, 6, 7])) 38 | vlarray.append([5, 6, 9, 8]) 39 | 40 | # Now, do the same with native Python strings. 41 | vlarray2 = fileh.create_vlarray(root, 'vlarray2', 42 | tables.StringAtom(itemsize=2), "ragged array of strings", 43 | filters=tables.Filters(1)) 44 | vlarray2.flavor = 'python' 45 | # Append some (variable length) rows: 46 | vlarray2.append(['5', '66']) 47 | vlarray2.append(['5', '6', '77']) 48 | vlarray2.append(['5', '6', '9', '88']) 49 | 50 | # Test with lists of bidimensional vectors 51 | vlarray3 = fileh.create_vlarray(root, 'vlarray3', tables.Int64Atom(shape=(2,)), 52 | "Ragged array of vectors") 53 | a = numpy.array([[1, 2], [1, 2]], dtype=numpy.int64) 54 | vlarray3.append(a) 55 | vlarray3.append(numpy.array([[1, 2], [3, 4]], dtype=numpy.int64)) 56 | vlarray3.append(numpy.zeros(dtype=numpy.int64, shape=(0, 2))) 57 | vlarray3.append(numpy.array([[5, 6]], dtype=numpy.int64)) 58 | # This makes an error (shape) 59 | #vlarray.append(array([[5], [6]], dtype=int64)) 60 | # This makes an error (type) 61 | #vlarray.append(array([[5, 6]], dtype=uint64)) 62 | 63 | # Tests with strings 64 | 65 | # Python flavor 66 | vlarray5 = fileh.create_vlarray(root, 'vlarray5', 67 | tables.StringAtom(itemsize=3), "Ragged array of strings") 68 | vlarray5.flavor = "python" 69 | vlarray5.append(["123", "456", "3"]) 70 | vlarray5.append(["456", "3"]) 71 | 72 | # Binary strings 73 | vlarray6 = fileh.create_vlarray(root, 'vlarray6', tables.UInt8Atom(), 74 | "pickled bytes") 75 | data = cPickle.dumps((["123", "456"], "3")) 76 | vlarray6.append(numpy.ndarray(buffer=data, dtype=numpy.uint8, shape=len(data))) 77 | 78 | # The next is a way of doing the same than before 79 | vlarray7 = fileh.create_vlarray(root, 'vlarray7', tables.ObjectAtom(), 80 | "pickled object") 81 | vlarray7.append([["123", "456"], "3"]) 82 | 83 | # Boolean arrays are supported as well 84 | vlarray8 = fileh.create_vlarray(root, 'vlarray8', tables.BoolAtom(), 85 | "Boolean atoms") 86 | # The next lines are equivalent... 87 | vlarray8.append([1, 0]) 88 | vlarray8.append([1, 0, 3, 0]) # This will be converted to a boolean 89 | # This gives a TypeError 90 | #vlarray.append([1,0,1]) 91 | 92 | # Variable length strings 93 | vlarray9 = fileh.create_vlarray(root, 'vlarray9', tables.VLStringAtom(), 94 | "Variable Length String") 95 | vlarray9.append("asd") 96 | vlarray9.append("aaana") 97 | 98 | # Unicode variable length strings 99 | vlarray10 = fileh.create_vlarray(root, 'vlarray10', tables.VLUnicodeAtom(), 100 | "Variable Length Unicode String") 101 | vlarray10.append(u"aaana") 102 | vlarray10.append(u"") # The empty string 103 | vlarray10.append(u"asd") 104 | vlarray10.append(u"para\u0140lel") 105 | 106 | # Still more vlarrays... 107 | N = 100 108 | shape = (3,3) 109 | numpy.random.seed(10) # For reproductible results 110 | vlarray11 = fileh.create_vlarray(root, 'vlarray11', 111 | tables.Float64Atom(shape=shape), "ragged array of arrays") 112 | 113 | k = 0 114 | for i in xrange(N): 115 | l = [] 116 | for j in xrange(numpy.random.randint(N)): 117 | l.append(numpy.random.randn(*shape)) 118 | k += 1 119 | vlarray11.append(l) 120 | 121 | # Close the file. 122 | fileh.close() 123 | 124 | -------------------------------------------------------------------------------- /examples/tables/nested_samples.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/tables/nested_samples.h5 -------------------------------------------------------------------------------- /examples/tables/table_samples.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/tables/table_samples.h5 -------------------------------------------------------------------------------- /examples/timeseries/carray_ts.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/timeseries/carray_ts.h5 -------------------------------------------------------------------------------- /examples/timeseries/pandas_test1.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/timeseries/pandas_test1.hdf5 -------------------------------------------------------------------------------- /examples/timeseries/pandas_test2.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/timeseries/pandas_test2.hdf5 -------------------------------------------------------------------------------- /examples/timeseries/pandas_test3.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/timeseries/pandas_test3.hdf5 -------------------------------------------------------------------------------- /examples/timeseries/scikits_test1.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/timeseries/scikits_test1.hdf5 -------------------------------------------------------------------------------- /examples/timeseries/scikits_test2.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/timeseries/scikits_test2.hdf5 -------------------------------------------------------------------------------- /examples/timeseries/scikits_test3.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/timeseries/scikits_test3.hdf5 -------------------------------------------------------------------------------- /examples/timeseries/table_ts.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/examples/timeseries/table_ts.h5 -------------------------------------------------------------------------------- /macosxapp/ReadMe-MacOSX.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\deff1\adeflang1025 2 | {\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fswiss\fprq0\fcharset77 Helvetica{\*\falt Arial};}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fnil\fprq0\fcharset0 Arial;}{\f4\fswiss\fprq0\fcharset77 Helvetica{\*\falt Arial};}{\f5\fswiss\fprq0\fcharset77 Helvetica-Bold;}{\f6\fnil\fprq2\fcharset0 Bitstream Vera Sans;}} 3 | {\colortbl;\red0\green0\blue0;\red128\green128\blue128;} 4 | {\stylesheet{\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs20\lang2057\loch\f1\fs20\lang2057\snext1 Normal;} 5 | {\s2\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af6\afs28\lang255\ltrch\dbch\af6\langfe255\hich\f2\fs24\lang2057\loch\f2\fs24\lang2057\sbasedon1\snext3 Heading;} 6 | {\s3\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs20\lang2057\loch\f1\fs20\lang2057\sbasedon1\snext3 Body Text;} 7 | {\s4\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f3\fs20\lang2057\loch\f3\fs20\lang2057\sbasedon3\snext4 List;} 8 | {\s5\sb120\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ai\ltrch\dbch\af1\langfe255\hich\f3\fs20\lang2057\i\loch\f3\fs20\lang2057\i\sbasedon1\snext5 caption;} 9 | {\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f3\fs20\lang2057\loch\f3\fs20\lang2057\sbasedon1\snext6 Index;} 10 | } 11 | {\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern6800}}\deftab720 12 | {\*\pgdsctbl 13 | {\pgdsc0\pgdscuse195\pgwsxn11900\pghsxn16840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} 14 | {\*\pgdscno0}\paperh16840\paperw11900\margl1440\margr1440\margt1440\margb1440\sectd\sbknone\pgwsxn11900\pghsxn16840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc 15 | \pard\plain \ltrpar\s1\cf0\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs20\lang2057\loch\f1\fs20\lang2057{\rtlch \ltrch\loch\f1\fs20\lang2057\i0\b0{\ltrch\dbch\hich\fs24\loch\fs24 Welcome to the }}{\rtlch \ltrch\loch\f1\fs20\lang2057\i0\b0{\rtlch\ltrch\dbch\hich\f5\fs24\b\loch\f5\fs24\b ViTables @VER@}{\ltrch\dbch\hich\fs24\loch\fs24 distribution for Python @PYVER@ .}} 16 | \par \pard\plain \ltrpar\s1\cf0\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 17 | \par \pard\plain \ltrpar\s1\cf0\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs20\lang2057\loch\f1\fs20\lang2057{\rtlch \ltrch\loch\f1\fs20\lang2057\i0\b0{\rtlch\ltrch\dbch\hich\f5\fs24\b\loch\f5\fs24\b IMPORTANT:}}{\rtlch \ltrch\loch\f1\fs20\lang2057\i0\b0{\ltrch\dbch\hich\fs24\loch\fs24 ViTables needs PyTables 2.x or PyTables Pro 2.x for Universal MacPython @PYVER@ to be installed, see:}} 18 | \par \pard\plain \ltrpar\s1\cf0\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\li720\ri0\lin720\rin0\fi-720\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 19 | \par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs20\lang2057\loch\f1\fs20\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 PyTables: http://www.pytables.org} 20 | \par \pard\plain \ltrpar\s1\cf0\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 21 | \par \pard\plain \ltrpar\s1\cf0\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 This distribution contains some example files which you can use to test ViTables features. You may find the User's Manual in the distribution as well.} 22 | \par \pard\plain \ltrpar\s1\cf0\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 23 | \par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang2057\loch\f1\fs24\lang2057 {\rtlch \ltrch\loch\f1\fs24\lang2057\i0\b0 Enjoy Data with ViTables, the troll of the PyTables family.} 24 | \par } 25 | -------------------------------------------------------------------------------- /macosxapp/ViTables.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/macosxapp/ViTables.icns -------------------------------------------------------------------------------- /macosxapp/ViTables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/macosxapp/ViTables.png -------------------------------------------------------------------------------- /macosxapp/ViTables.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/macosxapp/ViTables.xcf -------------------------------------------------------------------------------- /macosxapp/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | set -e 22 | 23 | VER=$(cat ../VERSION) 24 | 25 | PYVERS="$(ls /System/Library/Frameworks/Python.framework/Versions | grep -v Current)" 26 | if [ ! "$PYVERS" ]; then 27 | echo "No available Python installs." > /dev/stderr 28 | exit 1 29 | fi 30 | 31 | if [ "$1" = "clean" ]; then 32 | cleaning=true 33 | fi 34 | 35 | 36 | if [ $cleaning ]; then 37 | rm -f vitables-app.py 38 | else 39 | cp ../scripts/vitables vitables-app.py 40 | fi 41 | 42 | for PYVER in $PYVERS; do 43 | if ! python$PYVER -c 'import tables' 2> /dev/null; then 44 | continue 45 | fi 46 | 47 | rm -rf ../dist/ViTables.app 48 | if [ ! $cleaning ]; then 49 | echo "Creating application bundle for Python $PYVER..." 50 | (cd .. && python$PYVER setup.py py2app) 51 | fi 52 | 53 | DMGDIR="ViTables $VER (py$PYVER)" 54 | DMG="ViTables-${VER}.macosxppc-py${PYVER}.dmg" 55 | RESOURCES="$DMGDIR/ViTables.app/Contents/Resources" 56 | 57 | if [ $cleaning ]; then 58 | rm -rf "$DMGDIR" "$DMG" 59 | continue 60 | fi 61 | 62 | echo -n "Building $DMG..." 63 | echo -n " app" 64 | mkdir -p "$DMGDIR" 65 | cp -R ../dist/ViTables.app "$DMGDIR" 66 | echo -n " examples" 67 | mv "$RESOURCES/examples" "$DMGDIR/Examples" 68 | echo -n " license" 69 | cp ../LICENSE.* "$RESOURCES" 70 | cp ../LICENSE.txt "$DMGDIR/License.txt" 71 | echo -n " readme" 72 | cp ../README.txt "$DMGDIR/ReadMe.txt" 73 | sed -e "s/@VER@/$VER/g" -e "s/@PYVER@/$PYVER/g" < ReadMe-MacOSX.rtf > "$DMGDIR/ReadMe-MacOSX.rtf" 74 | echo -n " guide" 75 | cp ../doc/UsersGuide.pdf "$DMGDIR/User's Guide.pdf" 76 | cp -R ../vitables/htmldocs "$DMGDIR/User's Guide (HTML)" 77 | echo "." 78 | hdiutil create -srcfolder "$DMGDIR" -anyowners -format UDZO -imagekey zlib-level=9 "$DMG" 79 | done 80 | echo "Done" 81 | -------------------------------------------------------------------------------- /mswindows/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 2 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 3 | # Author: Vicent Mas - vmas@vitables.org 4 | # 5 | # This Makefile is intended to create the ViTables installer for Windows. 6 | # It is not intended for distribution. 7 | 8 | VERSIONFILE=..\VERSION 9 | #VERSION=$(shell type ..\VERSION) (syntax not supported by nmake) 10 | 11 | VERSION=2.1 12 | 13 | PYTHONVERSION=26 14 | DOTPYTHONVERSION=2.6 15 | 16 | ROOT=.. 17 | LICENSEFILE=$(ROOT)\LICENSE.txt 18 | LICENSEFILENAME=LICENSE.txt 19 | WINDOWS32=C:\\Windows\\system32 20 | 21 | # The NSIS intstaller script 22 | VTNSIS=vitables-py$(DOTPYTHONVERSION).nsi 23 | 24 | # ViTables executable script 25 | PYTHON=C:\Python$(PYTHONVERSION)\python 26 | SIB="$(USERPROFILE)\VendorID-1.0.0\sib\sib.py" 27 | ICON=$(ROOT)\vitables\icons\vitables.ico 28 | 29 | # Documentation in HTML and PDF formats 30 | INDEX=$(ROOT)\doc\index.rst 31 | HTML_INDEX=$(ROOT)\doc\index_html.txt 32 | PDF_INDEX=$(ROOT)\doc\index_pdf.txt 33 | HTML_OUTDIR=$(ROOT)\vitables\htmldocs 34 | PDF_OUTDIR=$(ROOT)\doc 35 | 36 | clean: 37 | del $(VTNSIS) 38 | del ViTables*.win32-py$(DOTPYTHONVERSION).exe 39 | del $(ROOT)\vitables.py 40 | del $(INDEX) 41 | del $(ROOT)\doc\UsersGuide.pdf 42 | rmdir /q /s $(HTML_OUTDIR) 43 | rmdir /q /s $(ROOT)\doc\_build 44 | 45 | vitables.exe: 46 | copy $(ROOT)\scripts\vitables .\vitables.py 47 | $(PYTHON) $(SIB) -u -i $(ICON) ./vitables.py 48 | # $(MAKE) -C build_vitables (syntax not supported by nmake) 49 | cd build_vitables && $(MAKE) 50 | copy build_vitables\vitables.exe . 51 | copy build_vitables\vitables.exe.manifest . 52 | rmdir /q /s build_vitables 53 | del .\vitables.py 54 | 55 | vtdoc: htmldoc pdfdoc 56 | 57 | htmldoc: 58 | del $(INDEX) 59 | copy $(HTML_INDEX) $(INDEX) 60 | cd $(ROOT)\doc && make.bat html 61 | mkdir $(HTML_OUTDIR) 62 | xcopy $(ROOT)\doc\_build\html\*.* /E $(HTML_OUTDIR) 63 | rmdir /q /s $(HTML_OUTDIR)\_sources 64 | copy $(ROOT)\LICENSE.html $(HTML_OUTDIR) 65 | rmdir /q /s $(ROOT)\doc\_build 66 | 67 | pdfdoc: 68 | del $(INDEX) 69 | copy $(PDF_INDEX) /Y $(INDEX) 70 | cd $(ROOT)\doc && make.bat pdf 71 | xcopy $(ROOT)\doc\_build\pdf\*.* $(ROOT)\doc 72 | rmdir /q /s $(ROOT)\doc\_build 73 | 74 | installer: vitables.nsi.in $(VERSIONFILE) $(LICENSEFILE) vtdoc vitables.exe 75 | copy ..\LICENSE.html LICENSE.html 76 | type vitables.nsi.in | sed -e "s/@VERSION@/$(VERSION)/g" \ 77 | -e "s/@PYTHONVERSION@/$(PYTHONVERSION)/g" \ 78 | -e "s/@DOTPYTHONVERSION@/$(DOTPYTHONVERSION)/g" \ 79 | -e "s/@ROOT@/$(ROOT)/g" \ 80 | -e "s/@WINDOWS32@/$(WINDOWS32)/g" \ 81 | -e "s/@LICENSE@/$(LICENSE)/g" \ 82 | -e "s/@LICENSEFILENAME@/$(LICENSEFILENAME)/g" \ 83 | > $(VTNSIS) 84 | makensis $(VTNSIS) 85 | del LICENSE.html 86 | del vitables.exe 87 | del vitables.exe.manifest 88 | -------------------------------------------------------------------------------- /setupdocs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | #!/usr/bin/env python 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """ 22 | Create the Users Guide in both HTML and PDF formats. 23 | 24 | distutils, sphinx and rst2pdf are required. 25 | """ 26 | 27 | import os 28 | import shutil 29 | 30 | from distutils.core import setup 31 | from distutils.dir_util import copy_tree 32 | from distutils.file_util import copy_file 33 | 34 | from sphinx.setup_command import BuildDoc 35 | 36 | 37 | 38 | 39 | class BuildSphinx(BuildDoc): 40 | """Customise the BuildDoc provided by the sphinx module setup_command.py 41 | """ 42 | 43 | 44 | def run(self): 45 | """ Execute the build_sphinx command. 46 | 47 | The HTML and PDF docs will be included in the tarball. So this script 48 | MUST be executed before creating the distributable tarball. 49 | """ 50 | 51 | # Build the Users Guide in HTML and TeX format 52 | for builder in ('html', 'pdf'): 53 | # Tidy up before every build 54 | try: 55 | os.remove(os.path.join(self.source_dir, 'index.rst')) 56 | except OSError: 57 | pass 58 | shutil.rmtree(self.doctree_dir, True) 59 | 60 | self.builder = builder 61 | self.builder_target_dir = os.path.join(self.build_dir, builder) 62 | self.mkpath(self.builder_target_dir) 63 | builder_index = 'index_{0}.txt'.format(builder) 64 | copy_file(os.path.join(self.source_dir, builder_index), 65 | os.path.join(self.source_dir, 'index.rst')) 66 | BuildDoc.run(self) 67 | 68 | # Copy the docs to their final destination: 69 | # HTML docs (Users Guide and License) -> ./vitables/htmldocs 70 | # PDF guide -> ./doc 71 | output_dir = os.path.join("vitables", "htmldocs") 72 | if not os.access(output_dir, os.F_OK): 73 | # Include the HTML guide and the license in the package 74 | copy_tree(os.path.join(self.build_dir,"html"), output_dir) 75 | shutil.rmtree(os.path.join(output_dir,"_sources")) 76 | copy_file('LICENSE.html', output_dir) 77 | copy_file(os.path.join(self.build_dir, "pdf", 78 | "UsersGuide.pdf"), "doc") 79 | 80 | setup_args = {} 81 | 82 | setup(cmdclass = {'build_sphinx': BuildSphinx}, 83 | **setup_args 84 | ) 85 | 86 | -------------------------------------------------------------------------------- /tests/README: -------------------------------------------------------------------------------- 1 | Before executing the tests do the following: 2 | 3 | - $ rm samples.h5 4 | - $ python create_samples.py 5 | - make sure that root_owned.h5 is owned by root.root 6 | 7 | In order to execute the tests:: 8 | 9 | $ cd .. 10 | $ PYTHONPATH=.:tests python tests/test_all.py 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '1.2' 2 | __all__ = ["h5db", "nodes", "preferences", "root_package"] 3 | -------------------------------------------------------------------------------- /tests/common.py: -------------------------------------------------------------------------------- 1 | """ 2 | Utilities for ViTables' test suites 3 | =================================== 4 | 5 | :Author: Vicent Mas, aka V+ 6 | :Contact: vmas@carabos.com 7 | :Created: 2006-07-11 8 | :License: ViTables commercial 9 | :Revision: $Id: common.py 1495 2006-03-13 09:37:24Z faltet $ 10 | """ 11 | 12 | import unittest 13 | import tempfile 14 | import os 15 | import os.path 16 | import warnings 17 | import sys 18 | import popen2 19 | import time 20 | 21 | 22 | verbose = False 23 | """Show detailed output of the testing process.""" 24 | 25 | if 'verbose' in sys.argv: 26 | verbose = True 27 | sys.argv.remove('verbose') 28 | 29 | 30 | def verbosePrint(string): 31 | """Print out the `string` if verbose output is enabled.""" 32 | if verbose: print string 33 | 34 | 35 | def cleanup(klass): 36 | #klass.__dict__.clear() # This is too hard. Don't do that 37 | # print "Class attributes deleted" 38 | for key in klass.__dict__.keys(): 39 | if not klass.__dict__[key].__class__.__name__ in ('instancemethod'): 40 | klass.__dict__[key] = None 41 | 42 | 43 | class PyTablesTestCase(unittest.TestCase): 44 | 45 | """Abstract test case with useful methods.""" 46 | 47 | def _getName(self): 48 | """Get the name of this test case.""" 49 | return self.id().split('.')[-2] 50 | 51 | 52 | def _getMethodName(self): 53 | """Get the name of the method currently running in the test case.""" 54 | return self.id().split('.')[-1] 55 | 56 | 57 | def _verboseHeader(self): 58 | """Print a nice header for the current test method if verbose.""" 59 | 60 | if verbose: 61 | name = self._getName() 62 | methodName = self._getMethodName() 63 | 64 | title = "Running %s.%s" % (name, methodName) 65 | print '%s\n%s\n' % (title, '-'*len(title)) 66 | 67 | 68 | -------------------------------------------------------------------------------- /tests/create_samples.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import numpy 3 | import tables 4 | 5 | # The top level description of a sample table 6 | class Particle(tables.IsDescription): 7 | name = tables.StringCol(16, pos=1) # 16-character String 8 | lati = tables.IntCol(pos=2) # integer 9 | longi = tables.IntCol(pos=3) # integer 10 | pressure = tables.Float32Col(pos=4) # float (single precision) 11 | temperature = tables.FloatCol(pos=5) # double (double precision) 12 | 13 | # Define a nested field using a IsDescription descendant 14 | class Info(tables.IsDescription): 15 | """A substructure of ComplexObject. 16 | """ 17 | name = tables.StringCol(16, pos=0) 18 | value = tables.IntCol() 19 | 20 | # Define a nested field using a dictionary 21 | Coord = { 22 | "x": tables.FloatCol(pos=0), 23 | "y": tables.FloatCol(pos=1), 24 | "z": tables.FloatCol(pos=2)} 25 | 26 | # The top level description of another sample table 27 | # Dictionaries have an advantage over IsDescription: they allow for 28 | # fields with blanks in their names 29 | ComplexObject = { 30 | "ID": tables.StringCol(8, pos=0), # 8-character String 31 | "long_ID": tables.StringCol(16, pos=1), # 16-character String 32 | "position": tables.IntCol(shape=2, pos=2), # integer 33 | "imag": tables.ComplexCol(16, pos=3), # complex (double precision) 34 | "info": Info(), 35 | "coord": Coord} 36 | 37 | f = tables.openFile('samples.h5', 'w') 38 | gts = f.createGroup(f.root, 'table_samples', 'A set of table samples') 39 | inner_gts = f.createGroup(gts, 'inner_tables_group', '') 40 | gas = f.createGroup(f.root, 'array_samples', 'A set of array samples') 41 | gas._v_attrs.abstract = 'This is a group node.' 42 | 43 | # A scalar numpy array 44 | # 45 | # Currently there is a bug in PyTables 2.x that causes it to fail operating 46 | # with numpy scalar arrays if tables.restrict_flavors(keep=['numpy']) 47 | # is called (which is the default behavior of ViTables). As a consequence 48 | # tests involving file copies fail. 49 | # 50 | sna = numpy.array(5) 51 | f.createArray(gas, 'sna', sna, 'A scalar numpy') 52 | 53 | # A regular numpy array with one row 54 | a = numpy.array([1, 2, 3], dtype=numpy.int16) 55 | f.createArray(gas, 'a', a, 'A one row regular numpy') 56 | 57 | # A regular numpy with more than one column 58 | a = numpy.array([[1, 2, 3], [4, 5, 6]], numpy.float32) 59 | f.createArray(gas, 'b', a, 'A regular numpy') 60 | 61 | # An enlargeable array with two columns [[c1, c2] *n] 62 | atom = tables.IntAtom() # The object type 63 | earray = f.createEArray(gas, 'earray', atom, (0, 2), "Enlargeable array of Ints") 64 | # Now we enlarge the array by adding rows of fixed length. We can add 65 | # several rows at a time 66 | earray.append([[1, 2]]) # Append one row 67 | earray.append([[3, 4], [5, 6]]) # Append two more rows 68 | earray.append([[0, 1], [2, 3], [3, 4]]) # Append three more rows 69 | 70 | # A variable length array 71 | atom = tables.Int64Atom(shape=(2,)) # The object type 72 | vlarray = f.createVLArray(gas, 'vlarray', atom, "Variable length array of Int64") 73 | # Now we enlarge the array by adding rows of variable length. Only one 74 | # row can be appended at a time 75 | vlarray.append([1, 2]) # Row length is 2 76 | vlarray.append(numpy.array([[3, 4, 5 ,6]]).reshape(2, 2)) # Row length is 4 77 | vlarray.append(numpy.array([[1, 2], [3, 4], [5, 6]])) # Row length is 6 78 | 79 | # A table 80 | t1 = f.createTable(inner_gts, 'inner_table', Particle, 'A table', 81 | tables.Filters(1)) 82 | particle = t1.row 83 | # Fill the table with 10 particles 84 | for i in xrange(10): 85 | # First, assign the values to the Particle record 86 | particle['name'] = 'Particle: %6d' % (i) 87 | particle['lati'] = i 88 | particle['longi'] = 10 - i 89 | particle['pressure'] = float(i*i) 90 | particle['temperature'] = float(i**2) 91 | # This injects the row values. 92 | particle.append() 93 | 94 | t2 = f.createTable(gts, 'nested_table', ComplexObject, 'A nested table', 95 | tables.Filters(1)) 96 | cobject = t2.row 97 | # Fill the table with 10 particles 98 | for i in xrange(10): 99 | # First, assign the values to the ComplexObject record 100 | cobject['ID'] = 'OID: %3d' % (i) 101 | cobject['long_ID'] = 'Long ID: %6d' % (i) 102 | cobject['position'] = (i, i+1) 103 | cobject['imag'] = complex(i, 2*i) 104 | cobject['info/name'] = 'Name: %6d' % (i) 105 | cobject['info/value'] = i 106 | cobject['coord/x'] = float(i**2) 107 | cobject['coord/y'] = float(1+i**2) 108 | cobject['coord/z'] = float(2+i**2) 109 | # This injects the row values. 110 | cobject.append() 111 | 112 | # An empty table 113 | t3 = f.createTable(gts, 'empty_table', Particle, 'An empty table') 114 | 115 | # We need to flush the buffers in table in order to get an 116 | # accurate number of records on it. 117 | t1.flush() 118 | t2.flush() 119 | t3.flush() 120 | 121 | f.close() 122 | -------------------------------------------------------------------------------- /tests/h5db/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '1.2' 2 | __all__ = ["test_dbDoc", "test_dbManager", "test_dbView"] 3 | -------------------------------------------------------------------------------- /tests/h5list.txt: -------------------------------------------------------------------------------- 1 | w#@#examples/array3.h5 2 | a#@#examples/array4.h5 3 | r#@#examples/carray1.h5 4 | x#@#examples/ctable1.h5 5 | r#@#examples/earray24.h5 6 | r###examples/earray25.h5 7 | -------------------------------------------------------------------------------- /tests/hdf5_sample.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/tests/hdf5_sample.h5 -------------------------------------------------------------------------------- /tests/nodes/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '1.2' 2 | __all__ = ["test_arrayDoc", "test_groupDoc", "test_nodeDoc", "test_tableDoc", 3 | "test_unimplementedDoc"] 4 | -------------------------------------------------------------------------------- /tests/nodes/test_unimplementedDoc.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import sys 3 | import os 4 | 5 | import tables 6 | 7 | import qt 8 | 9 | import vitables.nodes.unimplementedDoc as unimplementedDoc 10 | 11 | class UnImplementedDocTestCase(unittest.TestCase): 12 | """Test case for the UnImplementedDoc class. 13 | """ 14 | 15 | def setUp(self): 16 | """Open the sample hdf5 file and instantiate an UnImplementedDoc object.""" 17 | 18 | filepath = os.path.abspath('tests/hdf5_sample.h5') 19 | VTAPP.dbManager.openDB(filepath, mode='a') 20 | doc = VTAPP.dbManager.getDB(filepath) 21 | nodepath = '/images/iceberg_palette' 22 | self.node = unimplementedDoc.UnImplementedDoc(doc, nodepath) 23 | 24 | 25 | def tearDown(self): 26 | """Close any open file.""" 27 | 28 | try: 29 | VTAPP.slotFileCloseAll() 30 | except NameError: 31 | # Once test99 has been executed the tearDown has nothing to do 32 | pass 33 | 34 | 35 | def test01_unImplementedDocInstance(self): 36 | """Check whether the UnImplementedDoc class could be instantiated. 37 | """ 38 | 39 | self.assert_(isinstance(self.node, unimplementedDoc.UnImplementedDoc), 40 | 'Unable to instantiate the UnImplementedDoc class.') 41 | 42 | 43 | def test02_getNodeInfo(self): 44 | """Check whether node info can be retrieved. 45 | """ 46 | 47 | info = self.node.getNodeInfo() 48 | expected = {'type': 'UnImplemented'} 49 | self.assertEqual(info, expected, 'Unable to get node info.') 50 | 51 | 52 | def test99(self): 53 | """Exit ViTables.""" 54 | 55 | global VTAPP 56 | VTAPP.slotFileExit() 57 | del VTAPP 58 | 59 | 60 | def globalSetup(): 61 | global QTAPP, VTAPP, VTApp 62 | 63 | # Avoid errors: 64 | # if an instance of QApplication already exists then use a pointer to it 65 | try: 66 | qt.qApp.argv() 67 | QTAPP = qt.qApp 68 | except RuntimeError: 69 | QTAPP = qt.QApplication(sys.argv) 70 | from vitables.vtapp import VTApp 71 | VTAPP = VTApp(keep_splash=False) 72 | QTAPP.setMainWidget(VTAPP.gui) 73 | VTAPP.gui.hide() 74 | 75 | 76 | def suite(): 77 | """Return a test suite consisting of all the test cases in the module.""" 78 | 79 | globalSetup() 80 | theSuite = unittest.TestSuite() 81 | theSuite.addTest(unittest.makeSuite(UnImplementedDocTestCase)) 82 | return theSuite 83 | 84 | 85 | if __name__ == '__main__': 86 | # ptdump output for hdf5_sample.h5 87 | # hdf5_sample.h5 (File) '' 88 | # Last modif.: 'Wed Jun 20 09:54:52 2007' 89 | # Object Tree: 90 | # / (RootGroup) '' 91 | # /A note (Array(2L,)) '' 92 | # /arrays (Group) '' 93 | # /arrays/2D float array (Array(100L, 50L)) '' 94 | # /arrays/2D int array (Array(100L, 50L)) '' 95 | # /arrays/3D int array (Array(100L, 50L, 10L)) '' 96 | # /arrays/Vdata table: PerBlockMetadataCommon (Table(153L,)) '' 97 | # /arrays/external (Array(10L, 5L)) '' 98 | # /datatypes (Group) '' 99 | # /images (Group) '' 100 | # /images/Iceberg (ImageArray(375L, 375L)) '' 101 | # /images/iceberg_palette (UnImplemented(256, 3)) '' 102 | # /images/landcover.umd.199906.jpg (ImageArray(180L, 360L, 3L)) '' 103 | # /images/pixel interlace (ImageArray(149L, 227L, 3L)) '' 104 | # /images/plane interlace (ImageArray(3L, 149L, 227L)) '' 105 | # /arrays/Link to arrays (Group) '' 106 | 107 | unittest.main(defaultTest='suite') 108 | -------------------------------------------------------------------------------- /tests/preferences/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '1.2' 2 | __all__ = ["test_preferences", "test_vtconfig"] 3 | -------------------------------------------------------------------------------- /tests/root_owned_samples.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/tests/root_owned_samples.h5 -------------------------------------------------------------------------------- /tests/root_package/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '1.2' 2 | __all__ = ["test_actions", "test_commandLine", "test_query"] 3 | -------------------------------------------------------------------------------- /tests/test_all.py: -------------------------------------------------------------------------------- 1 | """Run all test cases.""" 2 | 3 | import unittest 4 | import sys 5 | import os 6 | 7 | import qt 8 | import tables 9 | 10 | def suite(): 11 | """Make a suite that contains all test cases.""" 12 | 13 | tests_modules = [ 14 | 'tests.h5db.test_dbManager', 15 | 'tests.h5db.test_dbDoc', 16 | 'tests.h5db.test_dbView', 17 | 'tests.nodes.test_arrayDoc', 18 | 'tests.nodes.test_groupDoc', 19 | 'tests.nodes.test_nodeDoc', 20 | 'tests.nodes.test_tableDoc', 21 | 'tests.nodes.test_unimplementedDoc', 22 | 'tests.root_package.test_actions', 23 | 'tests.root_package.test_commandLine', 24 | 'tests.root_package.test_query', 25 | 'tests.preferences.test_vtconfig', 26 | 'tests.preferences.test_preferences' 27 | ] 28 | all_tests = unittest.TestSuite() 29 | for name in tests_modules: 30 | exec('from %s import suite as test_suite' % name) 31 | all_tests.addTest(test_suite()) 32 | return all_tests 33 | 34 | 35 | def print_versions(): 36 | """Print all the versions of software that ViTables relies on.""" 37 | 38 | print '-=' * 38 39 | print 'ViTables version: %s' % vitables.preferences.vtconfig.getVersion() 40 | print "PyTables version: %s" % tables.__version__ 41 | print "Qt version: %s" % qt.qVersion() 42 | print "PyQt version: %s" % qt.PYQT_VERSION_STR 43 | print 'Python version: %s' % sys.version 44 | if os.name == 'posix': 45 | (sysname, nodename, release, version, machine) = os.uname() 46 | print 'Platform: %s-%s' % (sys.platform, machine) 47 | print '-=' * 38 48 | 49 | 50 | if __name__ == '__main__': 51 | QAPP = qt.QApplication(sys.argv) 52 | import vitables.preferences.vtconfig 53 | print_versions() 54 | unittest.TextTestRunner().run(suite()) 55 | -------------------------------------------------------------------------------- /translations/Translations.txt: -------------------------------------------------------------------------------- 1 | Spanish translation is available by now. Catalan translation is coming. 2 | -------------------------------------------------------------------------------- /translations/vitables_es_ES.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/translations/vitables_es_ES.qm -------------------------------------------------------------------------------- /unixapp/vitables.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Version=1.0 4 | Name=ViTables 5 | GenericName=PyTables & HDF5 Files Visualizer 6 | GenericName[ca]=Visualitzador de fitxers PyTables i HDF5 7 | GenericName[es]=Visualizador de ficheros PyTables y HDF5 8 | Exec=vitables %U 9 | Icon=vitables 10 | #There is not mime-type yet for HDF5 11 | #MimeType=application/x-hdf5 12 | #Set this to the vitables documentation files 13 | #DocPath=vitables/index.html 14 | Terminal=false 15 | Categories=Qt;Database;DataVisualization;Science;Education 16 | -------------------------------------------------------------------------------- /unixapp/vitables_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/unixapp/vitables_128x128.png -------------------------------------------------------------------------------- /unixapp/vitables_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/unixapp/vitables_16x16.png -------------------------------------------------------------------------------- /unixapp/vitables_22x22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/unixapp/vitables_22x22.png -------------------------------------------------------------------------------- /unixapp/vitables_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/unixapp/vitables_32x32.png -------------------------------------------------------------------------------- /unixapp/vitables_48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/unixapp/vitables_48x48.png -------------------------------------------------------------------------------- /unixapp/vitables_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/unixapp/vitables_64x64.png -------------------------------------------------------------------------------- /vitables.pro: -------------------------------------------------------------------------------- 1 | TRANSLATIONS = vitables_es_ES.ts \ 2 | vitables_ca_ES.ts 3 | 4 | SOURCES = vitables/vtSite.py \ 5 | vitables/utils.py \ 6 | vitables/vtapp.py \ 7 | vitables/vtgui.py \ 8 | vitables/vtsplash.py \ 9 | vitables/docBrowser/bookmarksDlg.py \ 10 | vitables/docBrowser/browserGUI.py \ 11 | vitables/docBrowser/helpBrowser.py \ 12 | vitables/docBrowser/vtTextBrowser.py \ 13 | vitables/h5db/dbDoc.py \ 14 | vitables/h5db/dbManager.py \ 15 | vitables/h5db/dbView.py \ 16 | vitables/nodeProperties/groupProp.py \ 17 | vitables/nodeProperties/leafProp.py \ 18 | vitables/nodeProperties/nodePropDlg.py \ 19 | vitables/nodeProperties/systemAttr.py \ 20 | vitables/nodeProperties/userAttr.py \ 21 | vitables/nodes/arrayDoc.py \ 22 | vitables/nodes/groupDoc.py \ 23 | vitables/nodes/leafView.py \ 24 | vitables/nodes/leavesManager.py \ 25 | vitables/nodes/nodeDoc.py \ 26 | vitables/nodes/tableDoc.py \ 27 | vitables/nodes/unimplementedDoc.py \ 28 | vitables/preferences/configException.py \ 29 | vitables/preferences/preferencesGUI.py \ 30 | vitables/preferences/preferences.py \ 31 | vitables/preferences/vtconfig.py \ 32 | vitables/treeEditor/treeNode.py \ 33 | vitables/treeEditor/treeView.py \ 34 | vitables/vtTables/buffer.py \ 35 | vitables/vtTables/hpScrollBar.py \ 36 | vitables/vtTables/hpTable.py \ 37 | vitables/vtTables/hpViewport.py \ 38 | vitables/vtWidgets/queryDlg.py \ 39 | vitables/vtWidgets/renameDlg.py \ 40 | vitables/vtWidgets/vtInputBox.py \ 41 | vitables/vtWidgets/vtTableItem.py \ 42 | vitables/vtWidgets/zoomCell.py \ 43 | -------------------------------------------------------------------------------- /vitables/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 3 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Author: Vicent Mas - vmas@vitables.org 19 | 20 | __version__ = '2.1' 21 | __all__ = ["docbrowser", "h5db", "logger", "nodeprops", 22 | "plugins", "queries", "preferences", "vttables", "vtwidgets", 23 | "utils", "vtsite", "vtapp", "vtgui", "vtsplash"] 24 | -------------------------------------------------------------------------------- /vitables/docbrowser/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 3 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Author: Vicent Mas - vmas@vitables.org 19 | 20 | __all__ = ["bookmarksdlg", "browsergui", "helpbrowser"] 21 | -------------------------------------------------------------------------------- /vitables/h5db/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 3 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Author: Vicent Mas - vmas@vitables.org 19 | 20 | __all__ = ["dbdoc", "dbstreemodel", "dbstreeview", "groupnode", 21 | "leafnode", "linknode", "nodeitemdelegate", "rootgroupnode", "tlink_editor", 22 | "tnode_editor"] 23 | -------------------------------------------------------------------------------- /vitables/h5db/groupnode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This module defines a data structure to be used for the model of the databases 24 | tree. The data structure is equivalent to a (non root) group node in a 25 | `PyTables` file. 26 | """ 27 | 28 | __docformat__ = 'restructuredtext' 29 | 30 | import vitables.utils 31 | from vitables.h5db import tnode_editor 32 | from vitables.nodeprops import nodeinfo 33 | from vitables.nodeprops import grouppropdlg 34 | 35 | class GroupNode(object): 36 | """ 37 | A group node in the tree of databases model. 38 | 39 | :Parameters: 40 | 41 | - `parent`: the parent of the node. 42 | - `name`: the name of the node 43 | """ 44 | 45 | def __init__(self, model, parent, name): 46 | """Create a group node for the tree of databases model. 47 | 48 | A GroupNode represents a (non root) group of a `HDF5` file and has 49 | a parent (another group node of the tree of databases model) and 50 | a name. 51 | """ 52 | 53 | self.dbt_model = model 54 | self.updated = False 55 | self.children = [] 56 | self.parent = parent 57 | self.node = parent.node._f_getChild(name) 58 | self.node_kind = u'group' 59 | 60 | self.has_view = False 61 | 62 | # Attributes that the tree of databases view will use 63 | # name --> DisplayRole 64 | # nodepath --> ToolTipRole 65 | # as_record --> StatusTipRole 66 | # icon --> DecorationRole 67 | self.name = name 68 | parentpath = parent.nodepath 69 | if parentpath.endswith(u'/'): 70 | parentpath = parentpath[:-1] 71 | self.nodepath = u'{0}/{1}'.format(parentpath, name) 72 | self.filepath = parent.filepath 73 | self.as_record = u'{0}->{1}'.format(self.filepath, self.nodepath) 74 | icons = vitables.utils.getIcons() 75 | self.closed_folder = icons[u'folder'] 76 | self.open_folder = icons[u'document-open-folder'] 77 | self.icon = icons[u'folder'] 78 | 79 | 80 | def __len__(self): 81 | """The number of children of this grup.""" 82 | return len(self.children) 83 | 84 | 85 | def insertChild(self, child, position=0): 86 | """Insert a child in a group node. 87 | 88 | :Parameters: 89 | 90 | - `child`: the node being inserted 91 | - `position`: the insertion position 92 | """ 93 | self.children.insert(position, child) 94 | 95 | 96 | def childAtRow(self, row): 97 | """The row-th child of this node. 98 | 99 | :Parameter row: the position of the retrieved child 100 | """ 101 | 102 | assert 0 <= row <= len(self.children) 103 | return self.children[row] 104 | 105 | 106 | def rowOfChild(self, child): 107 | """The row index of a given child. 108 | 109 | :Parameter child: the child node whose position is being retrieved. 110 | """ 111 | 112 | for pos, node in enumerate(self.children): 113 | if node == child: 114 | return pos 115 | return -1 116 | 117 | 118 | def row(self): 119 | """The position of this node in the parent's list of children. 120 | """ 121 | 122 | if self.parent: 123 | return self.parent.children.index(self) 124 | 125 | return 0 126 | 127 | 128 | def findChild(self, childname): 129 | """The child node with a given name. 130 | 131 | :Parameter childname: the name of the wanted child node. 132 | """ 133 | 134 | for node in self.children: 135 | if node.name == childname: 136 | return node 137 | return None 138 | 139 | 140 | def editor(self): 141 | """Return an instance of `TNodeEditor`. 142 | """ 143 | return tnode_editor.TNodeEditor(self.dbt_model.getDBDoc(self.filepath)) 144 | 145 | 146 | def properties(self): 147 | """The Properties dialog for this node. 148 | """ 149 | 150 | info = nodeinfo.NodeInfo(self) 151 | grouppropdlg.GroupPropDlg(info) 152 | -------------------------------------------------------------------------------- /vitables/h5db/leafnode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This module defines a data structure to be used for the model of the databases 24 | tree. The data structure is equivalent to a leaf node in a `PyTables` file. 25 | """ 26 | 27 | __docformat__ = 'restructuredtext' 28 | 29 | import tables 30 | 31 | import vitables.utils 32 | from vitables.h5db import tnode_editor 33 | from vitables.nodeprops import nodeinfo 34 | from vitables.nodeprops import leafpropdlg 35 | 36 | class LeafNode(object): 37 | """ 38 | A leaf node in the tree of databases model. 39 | 40 | :Parameters: 41 | 42 | - `parent`: the parent of the node. 43 | - `name`: the name of the node 44 | """ 45 | 46 | def __init__(self, model, parent, name): 47 | """Create a leaf node for the tree of databases model. 48 | 49 | A LeafNode represents a leaf of a `HDF5` file and has 50 | a parent (a group node of the tree of databases model) and 51 | a name. 52 | """ 53 | 54 | self.dbt_model = model 55 | self.parent = parent 56 | self.node = parent.node._f_getChild(name) 57 | 58 | self.has_view = False 59 | 60 | # Attributes that the tree of databases view will use 61 | # name --> DisplayRole 62 | # nodepath --> ToolTipRole 63 | # as_record --> StatusTipRole 64 | # icon --> DecorationRole 65 | self.name = name 66 | parentpath = parent.nodepath 67 | if parentpath.endswith(u'/'): 68 | parentpath = parentpath[:-1] 69 | self.nodepath = u'{0}/{1}'.format(parentpath, name) 70 | self.filepath = parent.filepath 71 | self.as_record = u'{0}->{1}'.format(self.filepath, self.nodepath) 72 | 73 | # Set the node icon 74 | icons = vitables.utils.getIcons() 75 | if isinstance(self.node, tables.Table): 76 | self.node_kind = u'table' 77 | self.icon = icons[u'table'] 78 | elif isinstance(self.node, tables.VLArray): 79 | self.node_kind = u'vlarray' 80 | data_type = self.node.atom.type 81 | if data_type in [u'vlstring', u'vlunicode']: 82 | self.icon = icons[u'vlstring'] 83 | elif data_type == u'object': 84 | self.icon = icons['object'] 85 | else: 86 | self.icon = icons[u'vlarray'] 87 | elif isinstance(self.node, tables.EArray): 88 | self.node_kind = 'earray' 89 | self.icon = icons['earray'] 90 | elif isinstance(self.node, tables.CArray): 91 | self.node_kind = u'carray' 92 | self.icon = icons[u'carray'] 93 | elif isinstance(self.node, tables.Array): 94 | self.node_kind = u'array' 95 | self.icon = icons['array'] 96 | elif isinstance(self.node, tables.UnImplemented): 97 | self.node_kind = u'image-missing' 98 | self.icon = icons[u'image-missing'] 99 | 100 | 101 | def row(self): 102 | """The position of this node in the parent's list of children. 103 | """ 104 | 105 | if self.parent: 106 | return self.parent.children.index(self) 107 | 108 | return 0 109 | 110 | 111 | def editor(self): 112 | """Return an instance of `TNodeEditor`. 113 | """ 114 | return tnode_editor.TNodeEditor(self.dbt_model.getDBDoc(self.filepath)) 115 | 116 | 117 | def properties(self): 118 | """The Properties dialog for this node. 119 | """ 120 | 121 | info = nodeinfo.NodeInfo(self) 122 | leafpropdlg.LeafPropDlg(info) 123 | -------------------------------------------------------------------------------- /vitables/h5db/linknode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This module defines a data structure to be used for the model of the databases 24 | tree. The data structure is equivalent to a link node in a `PyTables` file. 25 | """ 26 | 27 | __docformat__ = 'restructuredtext' 28 | 29 | import tables 30 | 31 | import vitables.utils 32 | from vitables.h5db import tlink_editor 33 | from vitables.nodeprops import nodeinfo 34 | from vitables.nodeprops import linkpropdlg 35 | 36 | class LinkNode(object): 37 | """ 38 | A leaf node in the tree of databases model. 39 | 40 | :Parameters: 41 | 42 | - `parent`: the parent of the node. 43 | - `name`: the name of the node 44 | """ 45 | 46 | def __init__(self, model, parent, name): 47 | """Create a link node for the tree of databases model. 48 | 49 | A LinkNode represents a link (soft or external) of a `PyTables` 50 | file and has a parent (a group node of the tree of databases 51 | model) and a name. 52 | """ 53 | 54 | self.dbt_model = model 55 | self.parent = parent 56 | self.node = parent.node._f_getChild(name) 57 | 58 | self.has_view = False 59 | 60 | self.target = self.node.target 61 | if hasattr(self.target, 'extfile'): 62 | self.link_type = 'external' 63 | else: 64 | self.link_type = 'soft' 65 | 66 | # Attributes that the tree of databases view will use 67 | # name --> DisplayRole 68 | # nodepath --> ToolTipRole 69 | # as_record --> StatusTipRole 70 | # icon --> DecorationRole 71 | self.name = name 72 | parentpath = parent.nodepath 73 | if parentpath.endswith(u'/'): 74 | parentpath = parentpath[:-1] 75 | self.nodepath = u'{0}/{1}'.format(parentpath, name) 76 | self.filepath = parent.filepath 77 | self.as_record = u'{0}'.format(self.node) 78 | 79 | # Set the node icon 80 | icons = vitables.utils.getIcons() 81 | if isinstance(self.node(), tables.Table): 82 | self.node_kind = u'table' 83 | self.icon = icons[u'link_table'] 84 | elif isinstance(self.node(), tables.VLArray): 85 | self.node_kind = u'vlarray' 86 | data_type = self.node().atom.type 87 | if data_type in [u'vlstring', u'vlunicode']: 88 | self.icon = icons[u'vlstring'] 89 | elif data_type == u'object': 90 | self.icon = icons['object'] 91 | else: 92 | self.icon = icons[u'link_vlarray'] 93 | elif isinstance(self.node(), tables.EArray): 94 | self.node_kind = 'earray' 95 | self.icon = icons['link_earray'] 96 | elif isinstance(self.node(), tables.CArray): 97 | self.node_kind = u'carray' 98 | self.icon = icons[u'link_carray'] 99 | elif isinstance(self.node(), tables.Array): 100 | self.node_kind = u'array' 101 | self.icon = icons['link_array'] 102 | elif isinstance(self.node(), tables.UnImplemented): 103 | self.node_kind = u'image-missing' 104 | self.icon = icons[u'image-missing'] 105 | 106 | 107 | def row(self): 108 | """The position of this node in the parent's list of children. 109 | """ 110 | 111 | if self.parent: 112 | return self.parent.children.index(self) 113 | 114 | return 0 115 | 116 | 117 | def editor(self): 118 | """Return an instance of `TLinkEditor`. 119 | """ 120 | return tlink_editor.TLinkEditor(self.dbt_model.getDBDoc(self.filepath)) 121 | 122 | 123 | def properties(self): 124 | """The Properties dialog for this node. 125 | """ 126 | 127 | info = nodeinfo.NodeInfo(self) 128 | linkpropdlg.LinkPropDlg(info) 129 | -------------------------------------------------------------------------------- /vitables/h5db/nodeitemdelegate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | Here is defined the NodeItemDelegate class. 24 | """ 25 | 26 | __docformat__ = 'restructuredtext' 27 | 28 | from PyQt4 import QtCore 29 | from PyQt4 import QtGui 30 | 31 | 32 | import vitables.utils 33 | 34 | translate = QtGui.QApplication.translate 35 | 36 | 37 | class NodeItemDelegate(QtGui.QItemDelegate): 38 | """ 39 | A custom delegate for editing items of the tree of databases model. 40 | 41 | The delegate is used for editing the text of items of the tree of 42 | databases model, i.e., the item's DisplayRole. In other words, it is 43 | used to edit the name of the nodes in a database object tree. 44 | """ 45 | 46 | def __init__(self, parent=None): 47 | """ 48 | Creates the custom delegate. 49 | """ 50 | 51 | super(NodeItemDelegate, self).__init__(parent) 52 | self.current_name = None 53 | self.vtgui = vitables.utils.getVTApp().gui 54 | 55 | 56 | def setEditorData(self, editor, index): 57 | """ 58 | Edits the data of an item with a given index. 59 | 60 | This method is automatically called when an editor is created, 61 | i.e., when the user double click an item while the `Shift` key is 62 | pressed. 63 | 64 | :Parameters: 65 | 66 | - `editor`: the editor widget 67 | - `index`: the index of the item being edited 68 | """ 69 | 70 | node_name = index.model().data(index, QtCore.Qt.DisplayRole) 71 | self.current_name = node_name 72 | editor.setText(node_name) 73 | 74 | 75 | def setModelData(self, editor, model, index): 76 | """ 77 | Update the model with the just edited data. 78 | 79 | This method is called automatically when an editor is closed, 80 | i.e., when the user editing ends. 81 | 82 | :Parameters: 83 | 84 | - `editor`: the editor widget 85 | - `model`: the model whose data is being setup 86 | - `index`: the index of the item being edited 87 | """ 88 | 89 | suggested_nodename = editor.text() 90 | 91 | node = model.nodeFromIndex(index) # A GroupNode or a LeafNode instance 92 | parent = node.parent 93 | 94 | # 95 | # Check if the nodename is already in use 96 | # 97 | sibling = getattr(parent.node, '_v_children').keys() 98 | # Note that current nodename is not allowed as new nodename. 99 | # Embedding it in the pattern makes unnecessary to pass it to the 100 | # rename dialog via method argument and simplifies the code 101 | pattern = u"""(^{0}$)|""" \ 102 | u"""(^[a-zA-Z_]+[0-9a-zA-Z_ ]*)""".format(self.current_name) 103 | info = [translate('NodeItemDelegate', 104 | 'Renaming a node: name already in use', 105 | 'A dialog caption'), 106 | translate('NodeItemDelegate', 107 | """Source file: {0}\nParent group: {1}\n\nThere is """ 108 | """already a node named '{2}' in that parent group.\n""", 109 | 'A dialog label').format\ 110 | (parent.filepath, parent.nodepath, suggested_nodename)] 111 | # Validate the nodename 112 | nodename, overwrite = vitables.utils.getFinalName(suggested_nodename, 113 | sibling, pattern, info) 114 | if nodename is None: 115 | editor.setText(self.current_name) 116 | return 117 | 118 | # Update the underlying data structure 119 | model.renameNode(index, nodename, overwrite) 120 | self.closeEditor.emit(editor, 0) 121 | 122 | # Update the application status bar 123 | self.vtgui.updateStatusBar() 124 | -------------------------------------------------------------------------------- /vitables/icons/16x16/application-exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/application-exit.png -------------------------------------------------------------------------------- /vitables/icons/16x16/array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/array.png -------------------------------------------------------------------------------- /vitables/icons/16x16/bookmark_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/bookmark_add.png -------------------------------------------------------------------------------- /vitables/icons/16x16/bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/bookmarks.png -------------------------------------------------------------------------------- /vitables/icons/16x16/carray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/carray.png -------------------------------------------------------------------------------- /vitables/icons/16x16/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/configure.png -------------------------------------------------------------------------------- /vitables/icons/16x16/delete_filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/delete_filters.png -------------------------------------------------------------------------------- /vitables/icons/16x16/dialog-cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/dialog-cancel.png -------------------------------------------------------------------------------- /vitables/icons/16x16/dialog-ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/dialog-ok.png -------------------------------------------------------------------------------- /vitables/icons/16x16/document-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/document-close.png -------------------------------------------------------------------------------- /vitables/icons/16x16/document-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/document-new.png -------------------------------------------------------------------------------- /vitables/icons/16x16/document-open-recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/document-open-recent.png -------------------------------------------------------------------------------- /vitables/icons/16x16/document-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/document-open.png -------------------------------------------------------------------------------- /vitables/icons/16x16/document-save-as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/document-save-as.png -------------------------------------------------------------------------------- /vitables/icons/16x16/earray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/earray.png -------------------------------------------------------------------------------- /vitables/icons/16x16/edit-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/edit-copy.png -------------------------------------------------------------------------------- /vitables/icons/16x16/edit-cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/edit-cut.png -------------------------------------------------------------------------------- /vitables/icons/16x16/edit-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/edit-delete.png -------------------------------------------------------------------------------- /vitables/icons/16x16/edit-paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/edit-paste.png -------------------------------------------------------------------------------- /vitables/icons/16x16/edit-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/edit-rename.png -------------------------------------------------------------------------------- /vitables/icons/16x16/file_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/file_ro.png -------------------------------------------------------------------------------- /vitables/icons/16x16/file_rw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/file_rw.png -------------------------------------------------------------------------------- /vitables/icons/16x16/folder-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/folder-new.png -------------------------------------------------------------------------------- /vitables/icons/16x16/go-first-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/go-first-view.png -------------------------------------------------------------------------------- /vitables/icons/16x16/go-next-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/go-next-view.png -------------------------------------------------------------------------------- /vitables/icons/16x16/go-previous-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/go-previous-view.png -------------------------------------------------------------------------------- /vitables/icons/16x16/help-about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/help-about.png -------------------------------------------------------------------------------- /vitables/icons/16x16/help-contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/help-contents.png -------------------------------------------------------------------------------- /vitables/icons/16x16/image-missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/image-missing.png -------------------------------------------------------------------------------- /vitables/icons/16x16/link_array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/link_array.png -------------------------------------------------------------------------------- /vitables/icons/16x16/link_carray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/link_carray.png -------------------------------------------------------------------------------- /vitables/icons/16x16/link_earray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/link_earray.png -------------------------------------------------------------------------------- /vitables/icons/16x16/link_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/link_table.png -------------------------------------------------------------------------------- /vitables/icons/16x16/link_vlarray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/link_vlarray.png -------------------------------------------------------------------------------- /vitables/icons/16x16/list-remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/list-remove.png -------------------------------------------------------------------------------- /vitables/icons/16x16/object.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/object.png -------------------------------------------------------------------------------- /vitables/icons/16x16/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/table.png -------------------------------------------------------------------------------- /vitables/icons/16x16/vlarray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/vlarray.png -------------------------------------------------------------------------------- /vitables/icons/16x16/vlstring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/vlstring.png -------------------------------------------------------------------------------- /vitables/icons/16x16/zoom-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/zoom-in.png -------------------------------------------------------------------------------- /vitables/icons/16x16/zoom-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/16x16/zoom-out.png -------------------------------------------------------------------------------- /vitables/icons/22x22/application-exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/application-exit.png -------------------------------------------------------------------------------- /vitables/icons/22x22/bookmark_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/bookmark_add.png -------------------------------------------------------------------------------- /vitables/icons/22x22/bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/bookmarks.png -------------------------------------------------------------------------------- /vitables/icons/22x22/dbfilters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/dbfilters.png -------------------------------------------------------------------------------- /vitables/icons/22x22/delete_filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/delete_filters.png -------------------------------------------------------------------------------- /vitables/icons/22x22/document-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/document-close.png -------------------------------------------------------------------------------- /vitables/icons/22x22/document-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/document-new.png -------------------------------------------------------------------------------- /vitables/icons/22x22/document-open-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/document-open-folder.png -------------------------------------------------------------------------------- /vitables/icons/22x22/document-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/document-open.png -------------------------------------------------------------------------------- /vitables/icons/22x22/document-save-as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/document-save-as.png -------------------------------------------------------------------------------- /vitables/icons/22x22/edit-clear-history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/edit-clear-history.png -------------------------------------------------------------------------------- /vitables/icons/22x22/edit-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/edit-copy.png -------------------------------------------------------------------------------- /vitables/icons/22x22/edit-cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/edit-cut.png -------------------------------------------------------------------------------- /vitables/icons/22x22/edit-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/edit-delete.png -------------------------------------------------------------------------------- /vitables/icons/22x22/edit-paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/edit-paste.png -------------------------------------------------------------------------------- /vitables/icons/22x22/file_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/file_ro.png -------------------------------------------------------------------------------- /vitables/icons/22x22/file_rw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/file_rw.png -------------------------------------------------------------------------------- /vitables/icons/22x22/folder-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/folder-new.png -------------------------------------------------------------------------------- /vitables/icons/22x22/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/folder.png -------------------------------------------------------------------------------- /vitables/icons/22x22/go-first-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/go-first-view.png -------------------------------------------------------------------------------- /vitables/icons/22x22/go-next-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/go-next-view.png -------------------------------------------------------------------------------- /vitables/icons/22x22/go-previous-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/go-previous-view.png -------------------------------------------------------------------------------- /vitables/icons/22x22/help-contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/help-contents.png -------------------------------------------------------------------------------- /vitables/icons/22x22/view-filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/view-filter.png -------------------------------------------------------------------------------- /vitables/icons/22x22/view-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/view-refresh.png -------------------------------------------------------------------------------- /vitables/icons/22x22/zoom-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/zoom-in.png -------------------------------------------------------------------------------- /vitables/icons/22x22/zoom-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/22x22/zoom-out.png -------------------------------------------------------------------------------- /vitables/icons/64x64/preferences-desktop-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/64x64/preferences-desktop-theme.png -------------------------------------------------------------------------------- /vitables/icons/64x64/preferences-other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/64x64/preferences-other.png -------------------------------------------------------------------------------- /vitables/icons/64x64/preferences-plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/64x64/preferences-plugin.png -------------------------------------------------------------------------------- /vitables/icons/vitables.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/vitables.ico -------------------------------------------------------------------------------- /vitables/icons/vitables_file.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/vitables_file.ico -------------------------------------------------------------------------------- /vitables/icons/vitables_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/vitables_logo.png -------------------------------------------------------------------------------- /vitables/icons/vitables_wm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/vitables_wm.png -------------------------------------------------------------------------------- /vitables/icons/vtinstaller.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/icons/vtinstaller.ico -------------------------------------------------------------------------------- /vitables/nodeprops/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 3 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Author: Vicent Mas - vmas@vitables.org 19 | 20 | __all__ = ["attreditor", "attrpropdlg", "groupproppage", "groupproppage", 21 | "leafpropdlg", "leafproppage", "linkpropdlg", "nodeinfo"] 22 | -------------------------------------------------------------------------------- /vitables/nodeprops/grouppropdlg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This module displays in a dialog tables.Group information collected by the 24 | :mod:`vitables.nodeprops.nodeinfo` module. 25 | 26 | Users' attributes can be edited if the database has been opened in read-write 27 | mode. Otherwise all shown information is read-only. 28 | """ 29 | 30 | __docformat__ = 'restructuredtext' 31 | 32 | from PyQt4 import QtGui 33 | 34 | from vitables.nodeprops import attrpropdlg 35 | from vitables.nodeprops import groupproppage 36 | 37 | translate = QtGui.QApplication.translate 38 | 39 | 40 | class GroupPropDlg(attrpropdlg.AttrPropDlg): 41 | """ 42 | Group properties dialog. 43 | 44 | By loading UI files at runtime we can: 45 | 46 | - create user interfaces at runtime (without using pyuic) 47 | - use multiple inheritance, MyParentClass(BaseClass, FormClass) 48 | 49 | This class displays a tabbed dialog that shows some properties of 50 | the selected node. First tab, General, shows general properties like 51 | name, path, type etc. The second and third tabs show the system and 52 | user attributes in a tabular way. 53 | 54 | Beware that data types shown in the General page are `PyTables` data 55 | types so we can deal with `enum`, `time64` and `pseudoatoms` (none of them 56 | are supported by ``numpy``). 57 | However data types shown in the System and User attributes pages are 58 | ``numpy`` data types because `PyTables` attributes are stored as ``numpy`` 59 | arrays. 60 | 61 | :Parameter info: a :meth:`vitables.nodeprops.nodeinfo.NodeInfo` instance 62 | describing a given node 63 | """ 64 | 65 | def __init__(self, info): 66 | """Setup the Properties dialog.""" 67 | 68 | super(GroupPropDlg, self).__init__(info) 69 | 70 | general_page = groupproppage.GroupPropPage(info) 71 | self.tabw.insertTab(0, general_page, 'General') 72 | self.tabw.setCurrentIndex(0) 73 | 74 | if info.node_type == u'root group': 75 | self.setWindowTitle(translate('GroupPropDlg', 'File properties', 76 | 'Dlg caption')) 77 | else: 78 | self.setWindowTitle(translate('GroupPropDlg', 'Group properties', 79 | 'Dlg caption')) 80 | general_page.regularGroupPage() 81 | 82 | self.show() 83 | 84 | -------------------------------------------------------------------------------- /vitables/nodeprops/leafpropdlg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This module displays in a dialog tables.Leaf information collected by the 24 | :mod:`vitables.nodeprops.nodeinfo` module. 25 | 26 | Users' attributes can be edited if the database has been opened in read-write 27 | mode. Otherwise all shown information is read-only. 28 | """ 29 | 30 | __docformat__ = 'restructuredtext' 31 | 32 | from PyQt4 import QtGui 33 | 34 | from vitables.nodeprops import attrpropdlg 35 | from vitables.nodeprops import leafproppage 36 | 37 | translate = QtGui.QApplication.translate 38 | 39 | 40 | class LeafPropDlg(attrpropdlg.AttrPropDlg): 41 | """ 42 | Leaf properties dialog. 43 | 44 | By loading UI files at runtime we can: 45 | 46 | - create user interfaces at runtime (without using pyuic) 47 | - use multiple inheritance, MyParentClass(BaseClass, FormClass) 48 | 49 | This class displays a tabbed dialog that shows some properties of 50 | the selected node. First tab, General, shows general properties like 51 | name, path, type etc. The second and third tabs show the system and 52 | user attributes in a tabular way. 53 | 54 | Beware that data types shown in the General page are `PyTables` data 55 | types so we can deal with `enum`, `time64` and `pseudoatoms` (none of them 56 | are supported by ``numpy``). 57 | However data types shown in the System and User attributes pages are 58 | ``numpy`` data types because `PyTables` attributes are stored as ``numpy`` 59 | arrays. 60 | 61 | :Parameter info: a :meth:`vitables.nodeprops.nodeinfo.NodeInfo` instance 62 | describing a given node 63 | """ 64 | 65 | def __init__(self, info): 66 | """Setup the Properties dialog.""" 67 | 68 | super(LeafPropDlg, self).__init__(info) 69 | 70 | general_page = leafproppage.LeafPropPage(info) 71 | self.tabw.insertTab(0, general_page, 'General') 72 | self.tabw.setCurrentIndex(0) 73 | 74 | if info.node_type == 'table': 75 | self.setWindowTitle(translate('LeafPropDlg', 'Table properties', 76 | 'Dlg caption')) 77 | else: 78 | self.setWindowTitle(translate('LeafPropDlg', 'Array properties', 79 | 'Dlg caption')) 80 | general_page.arrayPage() 81 | 82 | self.show() 83 | 84 | -------------------------------------------------------------------------------- /vitables/nodeprops/linkpropdlg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This module displays in a dialog the link information collected by the 24 | :mod:`vitables.nodeprops.nodeinfo` module. 25 | """ 26 | 27 | __docformat__ = 'restructuredtext' 28 | 29 | import os.path 30 | 31 | from PyQt4 import QtGui 32 | 33 | from PyQt4.uic import loadUiType 34 | 35 | import vitables.utils 36 | 37 | translate = QtGui.QApplication.translate 38 | # This method of the PyQt4.uic module allows for dinamically loading user 39 | # interfaces created by QtDesigner. See the PyQt4 Reference Guide for more 40 | # info. 41 | Ui_LinkPropDialog = \ 42 | loadUiType(os.path.join(os.path.dirname(__file__),'link_prop_dlg.ui'))[0] 43 | 44 | 45 | 46 | class LinkPropDlg(QtGui.QDialog, Ui_LinkPropDialog): 47 | """ 48 | Link properties dialog. 49 | 50 | By loading UI files at runtime we can: 51 | 52 | - create user interfaces at runtime (without using pyuic) 53 | - use multiple inheritance, MyParentClass(BaseClass, FormClass) 54 | 55 | This class displays a simple dialog that shows some properties of 56 | the selected link: name, path, type and target. 57 | 58 | :Parameter info: a :meth:`vitables.nodeprops.nodeinfo.NodeInfo` instance 59 | describing a given node 60 | """ 61 | 62 | def __init__(self, info): 63 | """Setup the Properties dialog.""" 64 | 65 | vtapp = vitables.utils.getVTApp() 66 | super(LinkPropDlg, self).__init__(vtapp.gui) 67 | self.setupUi(self) 68 | 69 | self.setWindowTitle(translate('LinkPropDlg', 'Link properties', 70 | 'Dlg caption')) 71 | 72 | # Customise the dialog's pages 73 | self.fillPage(info) 74 | self.resize(self.size().width(), self.minimumHeight()) 75 | 76 | # Show the dialog 77 | self.show() 78 | 79 | 80 | def fillPage(self, info): 81 | """Fill the dialog with info regarding the given link. 82 | 83 | :Parameter info: a :meth:`vitables.nodeprops.nodeinfo.NodeInfo` instance 84 | describing a given node 85 | """ 86 | 87 | self.nameLE.setText(info.nodename) 88 | self.pathLE.setText(info.nodepath) 89 | self.typeLE.setText(info.link_type) 90 | self.targetLE.setText(info.target) 91 | -------------------------------------------------------------------------------- /vitables/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # Author: Vicent Mas - vmas@vitables.org 18 | 19 | __all__ = ['csv', 'columnorg', 'dbstreesort', 'timeseries'] 20 | -------------------------------------------------------------------------------- /vitables/plugins/columnorg/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # Author: Vicent Mas - vmas@vitables.org 18 | 19 | 20 | __all__ = ['aboutpage', 'columnar_org'] 21 | -------------------------------------------------------------------------------- /vitables/plugins/columnorg/aboutpage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """ 22 | This module provides a widget with the full description of the plugin. 23 | 24 | The module allows for configuring the plugin too. 25 | 26 | The widget is displayed when the plugin is selected in the Preferences 27 | dialog selector tree. 28 | """ 29 | 30 | __docformat__ = 'restructuredtext' 31 | 32 | import os.path 33 | 34 | from PyQt4 import QtGui 35 | from PyQt4.uic import loadUiType 36 | 37 | from vitables.vtsite import PLUGINSDIR 38 | 39 | translate = QtGui.QApplication.translate 40 | 41 | # This method of the PyQt4.uic module allows for dynamically loading user 42 | # interfaces created by QtDesigner. See the PyQt4 Reference Guide for more 43 | # info. 44 | Ui_AboutPage = \ 45 | loadUiType(os.path.join(PLUGINSDIR, 'about_page.ui'))[0] 46 | 47 | class AboutPage(QtGui.QWidget, Ui_AboutPage): 48 | """ 49 | Configure the About page for the columnorg plugin in the Preferences dialog. 50 | 51 | By loading UI files at runtime we can: 52 | 53 | - create user interfaces at runtime (without using pyuic) 54 | - use multiple inheritance, MyParentClass(BaseClass, FormClass) 55 | 56 | This widget is inserted as a page in the stacked widget of the 57 | Preferences dialog when the CVS import/export item is clicked in the 58 | selector tree. 59 | 60 | """ 61 | 62 | def __init__(self, desc, parent=None): 63 | """Fill the widget describing the columnorg plugin. 64 | 65 | :Parameter desc: a dictionary with the plugin description 66 | """ 67 | 68 | # Makes the dialog and gives it a layout 69 | super(AboutPage, self).__init__(parent) 70 | self.setupUi(self) 71 | 72 | self.version_le.setText(desc['version']) 73 | self.module_name_le.setText(desc['module_name']) 74 | self.folder_le.setText(desc['folder']) 75 | self.author_le.setText(desc['author']) 76 | self.desc_te.setText(desc['about_text']) 77 | -------------------------------------------------------------------------------- /vitables/plugins/columnorg/icons/object-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/plugins/columnorg/icons/object-group.png -------------------------------------------------------------------------------- /vitables/plugins/columnorg/icons/object-ungroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/plugins/columnorg/icons/object-ungroup.png -------------------------------------------------------------------------------- /vitables/plugins/csv/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # Author: Vicent Mas - vmas@vitables.org 18 | 19 | __all__ = ['aboutpage', 'export_csv', 'import_csv'] 20 | -------------------------------------------------------------------------------- /vitables/plugins/csv/aboutpage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Author: Vicent Mas - vmas@vitables.org 20 | 21 | """ 22 | This module provides a widget with the full description of the plugin. 23 | 24 | The module allows for configuring the plugin too. 25 | 26 | The widget is displayed when the plugin is selected in the Preferences 27 | dialog selector tree. 28 | """ 29 | 30 | __docformat__ = 'restructuredtext' 31 | 32 | import os.path 33 | 34 | from PyQt4 import QtGui 35 | from PyQt4.uic import loadUiType 36 | 37 | import vitables.utils 38 | from vitables.vtsite import PLUGINSDIR 39 | 40 | translate = QtGui.QApplication.translate 41 | 42 | # This method of the PyQt4.uic module allows for dinamically loading user 43 | # interfaces created by QtDesigner. See the PyQt4 Reference Guide for more 44 | # info. 45 | Ui_AboutPage = \ 46 | loadUiType(os.path.join(PLUGINSDIR, 'about_page.ui'))[0] 47 | 48 | 49 | class AboutPage(QtGui.QWidget, Ui_AboutPage): 50 | """ 51 | Configure the About page for the csv plugin in the Preferences dialog. 52 | 53 | By loading UI files at runtime we can: 54 | 55 | - create user interfaces at runtime (without using pyuic) 56 | - use multiple inheritance, MyParentClass(BaseClass, FormClass) 57 | 58 | This widget is inserted as a page in the stacked widget of the 59 | Preferences dialog when the CVS import/export item is clicked in the 60 | selector tree. 61 | 62 | """ 63 | 64 | def __init__(self, desc, parent=None): 65 | """Fill the widget describing the CSV plugin. 66 | 67 | :Parameter desc: a dictionary with the plugin description 68 | """ 69 | 70 | # Makes the dialog and gives it a layout 71 | super(AboutPage, self).__init__(parent) 72 | self.setupUi(self) 73 | 74 | self.version_le.setText(desc['version']) 75 | self.module_name_le.setText(desc['module_name']) 76 | self.folder_le.setText(desc['folder']) 77 | self.author_le.setText(desc['author']) 78 | self.desc_te.setText(desc['about_text']) 79 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/array.csv: -------------------------------------------------------------------------------- 1 | 1, 2, 3 2 | 4, 5, 6 3 | 7, 8, 9 4 | 10, 11, 12 5 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/arrayND.csv: -------------------------------------------------------------------------------- 1 | [1 2], [3 4] 2 | [4 5], [6 7] 3 | [7 8], [9 10] 4 | [10 11], [12 13] 5 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/array_float.csv: -------------------------------------------------------------------------------- 1 | 1.0 2 | 2.71828182846 3 | 3.141592 4 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/column.csv: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 7 6 | 10 7 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/columnND.csv: -------------------------------------------------------------------------------- 1 | [1 2] 2 | [3 4] 3 | [7 10] 4 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/row.csv: -------------------------------------------------------------------------------- 1 | 1, 2, 3, 4, 7, 10 2 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/rowND.csv: -------------------------------------------------------------------------------- 1 | [1 2], [3 4], [7 10] 2 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/table.csv: -------------------------------------------------------------------------------- 1 | Particle: 10,10j,0j,[ 90.+1.j 1.+0.j],[[ -0.10701348-0.99425757j 33.00000000+0.j ] [ -0.10701348-0.99425757j 33.00000000+0.j ]] 2 | Particle: 11,11j,-1+0j,[ 110.+2.j 2.+0.j],[[ 0.08330491-0.9965241j 30.00000000+0.j ] [ 0.08330491-0.9965241j 30.00000000+0.j ]] 3 | Particle: 12,12j,-2+0j,[ 132.+3.j 3.+0.j],[[ 0.25459059-0.96704893j 27.00000000+0.j ] [ 0.25459059-0.96704893j 27.00000000+0.j ]] 4 | Particle: 13,13j,-3+0j,[ 143.+4.j 4.+0.j],[[ 0.40548536-0.91410154j 24.00000000+0.j ] [ 0.40548536-0.91410154j 24.00000000+0.j ]] 5 | Particle: 14,14j,-4+0j,[ 154.+5.j 5.+0.j],[[ 0.53602858-0.84419984j 21.00000000+0.j ] [ 0.53602858-0.84419984j 21.00000000+0.j ]] 6 | -------------------------------------------------------------------------------- /vitables/plugins/csv/examples/table_strings.csv: -------------------------------------------------------------------------------- 1 | a, b, c 2 | aa, bbb, c 3 | a, bb, c 4 | -------------------------------------------------------------------------------- /vitables/plugins/csv/icons/document-export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/plugins/csv/icons/document-export.png -------------------------------------------------------------------------------- /vitables/plugins/csv/icons/document-import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenTrading/ViTables/4dd2bd4f7fdb8cb735784019e7e9d2b192418056/vitables/plugins/csv/icons/document-import.png -------------------------------------------------------------------------------- /vitables/plugins/dbstreesort/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # Author: Vicent Mas - vmas@vitables.org 18 | 19 | 20 | __all__ = ['aboutpage', 'dbs_tree_sort'] 21 | -------------------------------------------------------------------------------- /vitables/plugins/dbstreesort/sorting_algorithm.ini: -------------------------------------------------------------------------------- 1 | [DBsTreeSorting] 2 | algorithm = human 3 | 4 | -------------------------------------------------------------------------------- /vitables/plugins/timeseries/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # Author: Vicent Mas - vmas@vitables.org 18 | 19 | __all__ = ['aboutpage', 'time_series'] 20 | -------------------------------------------------------------------------------- /vitables/plugins/timeseries/time_format.ini: -------------------------------------------------------------------------------- 1 | [Timeseries] 2 | strftime = %c 3 | 4 | -------------------------------------------------------------------------------- /vitables/preferences/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 3 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Author: Vicent Mas - vmas@vitables.org 19 | 20 | __all__ = ["cfgexception", "pluginsloader", "preferences", "vtconfig"] 21 | -------------------------------------------------------------------------------- /vitables/preferences/cfgexception.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This module defines an Exception to be used when there is a problem 24 | reading/writting the ``ViTables`` configuration. 25 | """ 26 | 27 | __docformat__ = 'restructuredtext' 28 | 29 | from PyQt4 import QtGui 30 | 31 | 32 | translate = QtGui.QApplication.translate 33 | 34 | 35 | class ConfigFileIOException(Exception): 36 | """Exception class for IO errors in the configuration file. 37 | 38 | :Parameter key: 39 | the configuration file key that cannot be read/written 40 | """ 41 | 42 | def __init__(self, key): 43 | """Setup the configuration error messages that will be shown to user. 44 | """ 45 | 46 | Exception.__init__(self) 47 | # If key looks like /path/to/property=value a write exception is 48 | # raised. If not a read exception is raised 49 | if '=' in key: 50 | setting = key.split('=')[0] 51 | self.error_message = translate('ConfigFileIOException', \ 52 | """\nConfiguration error: the application setting """\ 53 | """{0} cannot be saved.""", 54 | 'A logger error message').format(setting) 55 | else: 56 | self.error_message = translate('ConfigFileIOException', \ 57 | """\nConfiguration warning: the application setting """\ 58 | """{0} cannot be read. Its default value will be used.""", 59 | 'A logger error message').format(key) 60 | -------------------------------------------------------------------------------- /vitables/queries/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 3 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Author: Vicent Mas - vmas@vitables.org 19 | 20 | __all__ = ["query", "querydlg", "querymgr"] 21 | -------------------------------------------------------------------------------- /vitables/vtsite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | Site configuration module. 24 | 25 | This module indicates the full install path of the ``ViTables`` package to the 26 | running :meth:`vitables.vtapp.VTApp` instance. 27 | 28 | Mac OS X boxes use the module as is. 29 | 30 | Misc variables: 31 | 32 | * __docformat__ 33 | * INSTALLDIR 34 | * ICONDIR 35 | * DOCDIR 36 | * PLUGINSDIR 37 | """ 38 | 39 | __docformat__ = 'restructuredtext' 40 | 41 | import os.path 42 | 43 | INSTALLDIR = os.path.dirname(__file__) 44 | ICONDIR = os.path.join(INSTALLDIR, "icons") 45 | DOCDIR = os.path.join(INSTALLDIR, "htmldocs") 46 | PLUGINSDIR = os.path.join(INSTALLDIR, "plugins") 47 | 48 | -------------------------------------------------------------------------------- /vitables/vtsplash.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | Here is defined the VTSplash class. It displays the splash screen during the 24 | ``ViTables`` startup and shows the advance of the startup sequence. 25 | """ 26 | 27 | __docformat__ = 'restructuredtext' 28 | 29 | import time 30 | 31 | from PyQt4 import QtCore, QtGui 32 | 33 | class VTSplash(QtGui.QSplashScreen): 34 | """ 35 | The application splash screen. 36 | 37 | :Parameter png: the pixmap image displayed as a splash screen. 38 | """ 39 | 40 | def __init__(self, png): 41 | """ 42 | Initialize the application. 43 | 44 | Create a splash screen and ties it to a painter which will 45 | be in charge of displaying the needed messages. 46 | """ 47 | 48 | super(VTSplash, self).__init__(png) 49 | 50 | 51 | def drawContents(self, painter): 52 | """Draw the contents of the splash screen using the given painter. 53 | 54 | This is an overloaded method. It draws contents with the origin 55 | translated by a certain offset. 56 | 57 | :Parameter painter: the painter used to draw the splash screen 58 | """ 59 | 60 | painter.setPen(QtGui.QColor(QtCore.Qt.white)) 61 | font = painter.font() 62 | font.setBold(True) 63 | painter.setFont(font) 64 | painter.drawText(10, 215, self.msg) 65 | 66 | 67 | def drawMessage(self, msg): 68 | """ 69 | Draw the message text onto the splash screen. 70 | 71 | :Parameter msg: the message to be displayed 72 | """ 73 | 74 | QtGui.qApp.processEvents() 75 | self.msg = msg 76 | self.showMessage(self.msg) 77 | time.sleep(0.500) 78 | self.clearMessage() 79 | -------------------------------------------------------------------------------- /vitables/vttables/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 3 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Author: Vicent Mas - vmas@vitables.org 19 | 20 | __all__ = ["buffer", "datasheet", "leaf_delegate", "leaf_model", "leaf_view", "scrollbar"] 21 | -------------------------------------------------------------------------------- /vitables/vttables/leaf_delegate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | A custom delegate for rendering selected cells. 24 | 25 | As explained in the leafView module the current cell must be rendered 26 | differently depending on the buffer being displayed. If the dataset row of the 27 | current/selected cell is in the range of rows being displayed then the cell 28 | should be rendered in the standard way. If it is not then it should always be 29 | rendered unselected. 30 | """ 31 | 32 | __docformat__ = 'restructuredtext' 33 | 34 | from PyQt4 import QtCore 35 | from PyQt4 import QtGui 36 | 37 | 38 | class LeafDelegate(QtGui.QStyledItemDelegate): 39 | """ 40 | A delegate for rendering selected cells. 41 | 42 | :Parameter parent: the parent of this widget 43 | """ 44 | 45 | 46 | def paint(self, painter, option, index): 47 | """Renders the delegate for the item specified by index. 48 | 49 | This method handles specially the result returned by the model data() 50 | method for the Qt.BackgroundRole role. Typically, if the cell being 51 | rendered is selected then the data() returned value is ignored and the 52 | value set by the desktop (KDE, Gnome...) is used. We need to change 53 | that behavior as explained in the module docstring. 54 | 55 | The following properties of the style option are used for customising 56 | the painting: state (which holds the state flags), rect (which holds 57 | the area that should be used for painting) and palette (which holds the 58 | palette that should be used when painting) 59 | 60 | :Parameters: 61 | 62 | - `painter`: the painter used for rendering 63 | - `option`: the style option used for rendering 64 | - `index`: the index of the rendered item 65 | """ 66 | 67 | # option.state is an ORed combination of flags 68 | if (option.state & QtGui.QStyle.State_Selected): 69 | model = index.model() 70 | buffer_start = model.rbuffer.start 71 | cell = index.model().selected_cell 72 | if ((index == cell['index']) and \ 73 | (buffer_start != cell['buffer_start'])): 74 | painter.save() 75 | self.initStyleOption(option, index) 76 | background = option.palette.color(QtGui.QPalette.Base) 77 | foreground = option.palette.color(QtGui.QPalette.Text) 78 | painter.setBrush(QtGui.QBrush(background)) 79 | painter.fillRect(option.rect, painter.brush()) 80 | painter.translate(option.rect.x() + 3, option.rect.y()) 81 | painter.setBrush(QtGui.QBrush(foreground)) 82 | painter.drawText( 83 | option.rect, 84 | QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop, 85 | model.data(index)) 86 | painter.restore() 87 | else: 88 | QtGui.QStyledItemDelegate.paint(self, painter, option, index) 89 | else: 90 | QtGui.QStyledItemDelegate.paint(self, painter, option, index) 91 | -------------------------------------------------------------------------------- /vitables/vttables/scrollbar.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This minimal module makes a QScrollBar for browsing huge datasets. 24 | 25 | The use of this scrollbar is very tricky. It will be painted over the scrollbar 26 | of views bound to huge datasets so the view will look as usual but will have 2 27 | scrollbars. The hidden scrollbar is not useful for browsing huge datasets (it 28 | is tightly bound to the dimensions (number of rows) of the view widget. But the 29 | visible scrollbar is independent of the dimensions of the view widget and can 30 | be used for customising the view in a way that makes it useful for browsing 31 | datasets with a larger number of rows than that provided by the view widget. 32 | """ 33 | 34 | __docformat__ = 'restructuredtext' 35 | 36 | from PyQt4 import QtCore 37 | from PyQt4 import QtGui 38 | 39 | class ScrollBar(QtGui.QScrollBar): 40 | """ 41 | A specialised scrollbar for views of huge datasets. 42 | 43 | :Parameter scrollbar: the scrollbar being hidden 44 | """ 45 | 46 | def __init__(self, view): 47 | """Replace a vertical scrollbar with other one. 48 | 49 | After replacing, the ancestor widgets of `scrollbar` looks 50 | exactly the same, but the visible scrollbar is not currently 51 | useful for navigating the data displayed in the ancestor widgets 52 | because it is not tied to that data in anyway. 53 | """ 54 | 55 | self.view = view 56 | # Cheat the user hidding a scrollbar and displaying other one 57 | # that looks exactly the same 58 | parent = view.vscrollbar.parent() 59 | super(ScrollBar, self).__init__(parent) 60 | view.vscrollbar.setVisible(False) 61 | parent.layout().addWidget(self) 62 | self.setOrientation(QtCore.Qt.Vertical) 63 | self.setObjectName('tricky_vscrollbar') 64 | 65 | 66 | def event(self, e): 67 | """Filter wheel events and send them to the table viewport. 68 | """ 69 | 70 | if (e.type() == QtCore.QEvent.Wheel): 71 | self.view.wheelEvent(e) 72 | return True 73 | return QtGui.QScrollBar.event(self, e) 74 | -------------------------------------------------------------------------------- /vitables/vtwidgets/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 3 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Author: Vicent Mas - vmas@vitables.org 19 | 20 | __all__ = ["nodenamedlg", "renamedlg", "zoom_cell"] 21 | -------------------------------------------------------------------------------- /vitables/vtwidgets/nodename_dlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | InputNodeNameDlg 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 400 13 | 128 14 | 15 | 16 | 17 | Dialog 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | InfoLabel 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Node name: 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Qt::Horizontal 49 | 50 | 51 | QDialogButtonBox::Cancel 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | buttonsBox 61 | rejected() 62 | InputNodeNameDlg 63 | reject() 64 | 65 | 66 | 316 67 | 260 68 | 69 | 70 | 286 71 | 274 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /vitables/vtwidgets/nodenamedlg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved 5 | # Copyright (C) 2008-2013 Vicent Mas. All rights reserved 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Author: Vicent Mas - vmas@vitables.org 21 | 22 | """ 23 | This module provides a dialog for renaming nodes of the tree of databases view. 24 | 25 | The dialog is raised when a new group node is created and when an existing node 26 | is being renamed. 27 | """ 28 | 29 | __docformat__ = 'restructuredtext' 30 | 31 | import os.path 32 | 33 | from PyQt4 import QtCore 34 | from PyQt4 import QtGui 35 | from PyQt4.uic import loadUiType 36 | 37 | import vitables.utils 38 | 39 | # This method of the PyQt4.uic module allows for dinamically loading user 40 | # interfaces created by QtDesigner. See the PyQt4 Reference Guide for more 41 | # info. 42 | Ui_InputNodenameDialog = \ 43 | loadUiType(os.path.join(os.path.dirname(__file__),'nodename_dlg.ui'))[0] 44 | 45 | class InputNodeName(QtGui.QDialog, Ui_InputNodenameDialog): 46 | """ 47 | Dialog for interactively entering a name for a given node. 48 | 49 | By loading UI files at runtime we can: 50 | 51 | - create user interfaces at runtime (without using pyuic) 52 | - use multiple inheritance, MyParentClass(BaseClass, FormClass) 53 | 54 | This dialog is called when a new group is being created and also when 55 | a node of any kind is being renamed. 56 | 57 | Regular Qt class QInputDialog is not used because, at least apparently, 58 | it doesn't provide a way for customizing buttons text. 59 | 60 | :Parameters: 61 | 62 | - `title`: the dialog title 63 | - `info`: information to be displayed in the dialog 64 | - `action`: string with the editing action to be done, Create or Rename 65 | """ 66 | 67 | def __init__(self, title, info, action): 68 | """A customised `QInputDialog`. 69 | """ 70 | 71 | vtapp = vitables.utils.getVTApp() 72 | # Makes the dialog and gives it a layout 73 | super(InputNodeName, self).__init__(vtapp.gui) 74 | self.setupUi(self) 75 | 76 | # Set dialog caption and label with general info 77 | self.setWindowTitle(title) 78 | self.generalInfo.setText(info) 79 | 80 | # The Create/Rename button 81 | self.edit_button = self.buttonsBox.addButton(action, 82 | QtGui.QDialogButtonBox.AcceptRole) 83 | 84 | # Setup a validator for checking the entered node name 85 | validator = QtGui.QRegExpValidator(self) 86 | pattern = QtCore.QRegExp("[a-zA-Z_]+[0-9a-zA-Z_ ]*") 87 | validator.setRegExp(pattern) 88 | self.valueLE.setValidator(validator) 89 | 90 | # Make sure that buttons are in the proper activation state 91 | self.valueLE.textChanged.emit(self.valueLE.text()) 92 | 93 | 94 | @QtCore.pyqtSlot("QString", name="on_valueLE_textChanged") 95 | def checkName(self, current): 96 | """ 97 | Check the current name value. 98 | 99 | The state of the `Create` button depends on the passed string. If 100 | it is empty then the button is disabled. Otherwise it is enabled. 101 | 102 | :Parameter current: the value currently displayed in the text box 103 | """ 104 | 105 | if current == '': 106 | self.edit_button.setEnabled(0) 107 | else: 108 | self.edit_button.setEnabled(1) 109 | 110 | 111 | @QtCore.pyqtSlot(name="on_buttonsBox_accepted") 112 | def saveName(self): 113 | """Slot for saving the entered name and closing the dialog. 114 | """ 115 | 116 | self.node_name = self.valueLE.text() 117 | self.accept() 118 | -------------------------------------------------------------------------------- /vitables/vtwidgets/rename_dlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | RenameNodeDlg 4 | 5 | 6 | Qt::WindowModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 400 13 | 128 14 | 15 | 16 | 17 | Dialog 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | InfoLabel 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | New name: 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Qt::Horizontal 49 | 50 | 51 | QDialogButtonBox::Cancel 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | buttonsBox 61 | rejected() 62 | RenameNodeDlg 63 | reject() 64 | 65 | 66 | 316 67 | 260 68 | 69 | 70 | 286 71 | 274 72 | 73 | 74 | 75 | 76 | 77 | --------------------------------------------------------------------------------