To use Damon, you need to be able to access the documentation for each of its functions and methods. The syntax is >>> help(Module.Class.Method) or >>> help(Module.Function). Here is how it works.
Open the Python IDLE GUI. In Windows, go to the Start button and search for IDLE. On the Mac, search for it in your Applications folder. Shortcut it.
At the >>> prompt, type import damon1. This loads the damon1 package. On the next line, type >>> help(damon1). This gives access to top-level help.
The import damon1 statement works fine, but to get help on individual methods the syntax can be a little long-winded. For instance, to get help on the standardize() method, you would type:
To simplify the syntax, at the >>> prompt, type import damon1.core as core . The "as core" allows you to nickname damon.core as "core", to save typing. You can also say import damon1.core as dmn. Then type import damon1.tools as tools . These two imports load all of Damon's public methods and functions.
At the >>> prompt, type dir(core) . Then type dir(tools) . This gives you a top-level list of the contents of core and tools. Note that "core" refers to the core.py Python file inside the damon1 directory, and "tools" refers to the tools.py file. Python files are called "modules". Notice the square brackets around the contents; this signifies a python list object. Within each list are a bunch of objects, mostly functions. The functions with double underscores around them (e.g., __doc__, __file__) belong to Python. Most of the objects in the tools module you won't need. You will mainly use three items in the core module: create_data(), TopDamon(), and Damon().
Read About Core
The great bulk of documentation is written in the core.py module. You can type >>> help(core), but the output will be voluminous. It's better to get help for individual elements within core.
However, you probably don't want to type >>> help(core.Damon), because this, too, will be voluminous.
List Damon Contents
The most important element in core is Damon. Damon creates an "instance" (aka "object") of a Damon analysis. It loads and formats a dataset for analysis, then applies Damon "methods" to it. Each Damon object has its own dataset, and its methods are generally applied only once to that dataset, in a specific order. To get a list of Damon methods, use dir >>> dir(core.Damon) . These are the commands to learn. The one you will use the most is __init__ , which is used to "initialize" a Damon object, set up its various parameters. When getting help, look up each Damon object method individually.
To get help on a specific method, type >>> help(core.Damon.my_method) . (When I say, "my_method" or "my_something", I don't mean these literally; they indicate a thing of your choosing.) Note the syntax: help(Module.Class.Method) . The "method" belongs to a "class" (the Damon class), which belongs to a "module" (a Python file). The "." period signals that the element to the right is an "attribute" of the thing to the left. To get help on the "extract" method, type >>> help(core.Damon.extract) .
This is only a snippet of the extract() method documentation. Each method doc has the following sections: Returns, Comments, Arguments, Examples (under construction), and Paste Method. The "Paste Method" section always comes at the end and may be the most useful. It contains a line-by-line list of the options available for each parameter that can be copied and pasted into your Python script (don't worry about the lines wrapping around). This saves you from having to memorize the options for each parameter. They are right there, already documented and described.
To get help on how to initialize a Damon object (which you will do a LOT), type >>> help(core.DamonObj.__init__) . Don't be thrown by the __init__ nomenclature. This is Python's generic tool for initializing instances (or objects) of a class. We'll go over Damon.__init__ in the next lesson.
Help on create_data()
Aside from the Damon methods, the function you will use most is create_data(). Note that I called it a function instead of a method. Functions are pretty much the same as methods, except they are not tied to a particular class. Since create_data() creates artificial data out of the blue, it does not belong to the Damon class (which requires already-existing data). To get help on create_data(), type >>> help(core.create_data) . The function resides in (is an attribute of) the core.py file.
Help on tools
The tools.py module contains a bunch of functions (not methods) which are used by Damon internally but which may be used outside of Damon. Their most important feature is that they don't need to be applied to Damon objects; they're generic. To access tool docs, type >>> help(tools.my_tool) . For example, to access the correl() function (used to calculate correlations), type >>> help(tools.correl) .
And that is how you get help on a specific tool or Damon method.