DMF help example

# Import DMF
from idaes_dmf import dmf, util, magics
from idaes_model_contrib.mea_simple.flowsheet.flowsheet import MeaSheet
%dmf init ../WORKSPACE

You put the doc locations in the configuration

The paths can be relative to the location of the DMF “workspace”, or to where the code is installed, or absolute paths. If they are wrong, then of course the DMF will have trouble finding the documentation.

%dmf info

Configuration

  • created: 2017-08-11T17:52:16.350098
  • htmldocs:
    • /home/dang/src/idaes/dangunter/model_contrib/doc/_build/html
    • /home/dang/src/idaes/dangunter/models/docs/html
    • /home/dang/src/idaes/dangunter/DMF/docs/build/html
  • modified: 2017-08-11T17:52:16.350098
  • property_data: resources/index.sqlite

You can get help on the class

%dmf help MeaSheet

You can also get help on instances

This takes you the same page you would get for the class. Note that the warning comes from a half-baked initialization of MeaSheet().

mm = MeaSheet()

%dmf help mm
/home/dang/anaconda3/envs/idaes_dev/lib/python3.6/site-packages/idaes_models-0.1.0-py3.6.egg/idaes_models/core/process_base.py:957: UserWarning: Component set unspecified for unit Unnamed_Flowsheet
  'Component set unspecified for unit {}'.format(self.unit_name))

You can also get help on the DMF itself

%dmf help dmf

How does it work? Let’s see the help page!

%dmf help help