Getting started¶
Installation¶
The Data Management Framework (DMF) is installed automatically as part of the IDAES framework installation. Please refer to the general IDAES installation instructions for details.
Initialization¶
To use the DMF you will need to first create a Workspace.
The instructions below show how to do this with the command-line
interface, which is installed as the dmf
command.
Use dmf create -i <directory>
to create a new workspace in
the given directory, with interactive prompts for initial values:
$ dmf create -i /tmp/newdir
Interactive mode for workspace configuration
--
Field : htmldocs
Description: HTML documentation paths. Each item is a directory containing Sphinx-generated HTML docs
Enter value(s) separated by commas [{dmf_root}/doc/build/html]:
--
Field : description
Description: A human-readable description of the workspace
Enter value []: This is an example workspace
--
Field : name
Description: A short name for the workspace
Enter value []: example1
After you enter the final value, the workspace will be created. The
command will then print the results of the dmf info
command for
the newly created workspace:
Workspace
example1 - This is an example workspace
General information
- Location = /tmp/newdir
- Workspace identifier (_id) = b3a53e3eaf11421fb51e21d5baa5a9d1
- Created = 2018-07-17T04:06:03.246855
- Modified = 2018-07-17T04:06:03.246855
- Num. resources = 0
Configuration
- conf = None
- htmldocs = ['/home/dang/src/idaes/dangunter/idaes/doc/build/html']
- showver = False
Note
The htmldocs configuration parameter is used internally for interactive help in the Jupyter Notebook. The value of this parameter does not usually need to be changed by the user.
Setting default workspace¶
If you are working on the command-line, it is convenient to set the current workspace for all commands. This value is recorded in the global configuration at ~/.dmf
(the file “.dmf” in your home directory), and can be viewed or changed with the dmf init
command:
dmf init /tmp/newdir
Like the “create” command, this will also print out the current settings when it finishes. You can get this same printout by invoking the command with no arguments:
DMF global configuration </home/dang/.dmf>
> workspace = /tmp/newdir
Now all the other commands will use this workspace by default (the -p/–path option can override this default for most commands).
Adding a resource¶
You can add resources with the dmf import
command or programmatically with the Python API. Importing files directly from the command line is convenient for things like Jupyter Notebooks and images. For example:
dmf import examples/dmf/generate_resources.ipynb
You can list resources in a workspace with dmf ls
.
Getting help¶
For help on the command-line tools, the dmf
command and its subcommands all use the -h
option. For the main dmf
command, the help will also list all the available subcommands.
If you are working in the Jupyter Notebook or another interactive Python environment, you can get details on the API calls through the standard help or “?” keywords. For example:
from idaes.dmf.dmf import DMF
help(DMF.add) # generic Python help
DMF.add? # IPython / Jupyter help
Next steps¶
There are more details and more commands in the full command-line interface.
For the Python API, you could start with some of the example Jupyter notebooks. and look at the Python API for details.