.:developers:home:module

From ADPAA
Jump to navigation Jump to search

Adding A New Module to ADPAA

Quick Reference

The short list for adding a module to ADPAA:

  1. Write a program that outputs data in ADPAA format (bulbtemp.py)
  2. Type ADPAA -b source to update
  3. Create a directory for the script in the appropriate subdirectory/data level (Level1, Level2, Level3, Level4) in the ADPAA src directory (*/ADPAA/src/*/) (~/CoPAS/ADPAA/src/Level3/bulbtemp/bulbtemp.py)
  4. Type svn add [directory] where the directory in [brackets] is replaced by what you made in step 2 (from ~/CoPAS/ADPAA/src/Level3 I type svn add bulbtemp)
  5. Type svn commit [directory] where the directory in [brackets] is replaced by what you made in step 2 (from ~/CoPAS/ADPAA/src/Level3 I type svn commit bulbtemp)
  6. Edit the ADPAA Makefile from */src/build and add install line for appropriate data level; commit the Makefile (from /CoPAS/ADPAA/src/build/ I type svn commit Makefile)
  7. Type ADPAA -b source to update again

Detailed Steps

Examples below are shown for adding the "bulbtemp.py" module.

It is recommended that you update ADPAA both before and after adding a module. If you do not update ADPAA before, you may encounter errors when trying to add your module.

 adpaa -b source

First, create a new sub-directory for the new module in the appropriate ADPAA directory. See Delene (2011) for information on ADPAA data levels: [1].

 mkdir new_adpaa_directory
 
 Example:
 mkdir ~/CoPAS/ADPAA/src/Level3/bulbtemp/
 (where "bulbtemp/" is the new directory)

Second, copy the new module to the newly created directory.

 cp module_file_path new_adpaa_directory
 
 Example:
 cp ~/scripts/bulbtemp.py ~/CoPAS/ADPAA/src/Level3/bulbtemp/bulbtemp.py

Third, add and commit the new module.

 Be in the directory (within */ADPAA/src) where the newly created sub-directory is located.
 
 svn add new_adpaa_directory
 svn commit new_adpaa_directory
 
 Note: committing requires you to entire your password. In the text editor that pops up, enter comments about what is being added/changed, then write and exit (with wq! for example)
 
 Example:
 svn add bulbtemp
 svn commit bulbtemp
 Comment: "Added the new bulbtemp.py module".

Fourth, edit the Makefile, then commit it.

 The Makefile is located in */ADPAA/src/build/Makefile
 (Example: ~/CoPAS/ADPAA/src/build/Makefile)
 
 From the build directory (*/ADPAA/src/build), you can edit the Makefile.
 In the Makefile, add a new line that will copy the new module to the ADPAA/bin/ directory. Make sure this is in the appropriate data level section. You can use the format that all of the other modules use.
  
 Example:
 install $(INSTOPT) $(BASEDIR)/Level3/bulbtemp/bulbtemp.py $(PREFIX)/bin/bulbtemp.py
 
 To commit:
 svn commit Makefile

It is recommended that you update ADPAA again (adpaa -b source) and verify your new module was successfully added.