Home | Download/Install | Documentation | Packages | Screenshots | News | Forum/Mailing-lists | Contact | GForge
This tutorial describes how to manage data in a Python package.
Before starting, ensure you have a working development environment.
If you want to start directly with a real example, download the starter package.
For example, to add a shared data directory to the alinea.echap
package:
alinea.echap
source tree, and create the share data directory: mkdir -p src/alinea/echap/share/data
mv your_data_directory src/alinea/echap/share/data
setup.py
: share_dirs = {os.path.join(*('alinea', 'echap', 'share')): os.path.join(*('src', 'alinea', 'echap', 'share'))}
alinea.echap
: python setup.py install
For example, to access the shared data file Mercia_axeT.csv
of alinea.echap
package:
import alinea.echap from openalea.deploy.shared_data import shared_data data_filepath = shared_data(alinea.echap, 'Mercia_axeT.csv') data_files = shared_data(alinea.echap, pattern='*.csv') # return a list
See openalea.deploy.shared_data.get_shared_data_path
documentation for other possibilities.
The node SharedDataBrowser is used to select a data file.
See openalea.misc_wralea.shared_data
documentation for more details.
Here is a dataflow example using this node:
This dataflow can be found at openalea.misc.test.shared_data_browser
For example, to access the shared data file filterT.can
of alinea.caribu.data
package:
from openalea.core.system import systemnodes data = systemnodes.get_data('filterT.can', 'alinea.caribu.data') data_filepath = data.get('filterT.can')
See openalea.core.system.systemnodes.get_data
documentation for other possibilities.