Difference between revisions of "Make software executable by others"

From Geoscience Paper of the Future
Jump to: navigation, search
(Set PropertyValue: Progress = 10)
 
(9 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
== What This Task Involves ==
 
== What This Task Involves ==
  
There are a few simple things that you can do to make your code more usable by others.  Here are a few suggestions:
+
The training materials show how to prepare code so that it is more portable and it can be more easily used by others.   
  
* Locate the software that you used to generate the results.  Make sure it is modular and it is clear what the data flow across the different modules is.
+
== Training Materials ==
  
* If you have variables whose values are set in the code, think about making those values a parameter to the code.  This will expose to others the ability to change that value, and will make it easy for others to do so without reloading the code.
+
This training session was held on April 17, 2015:
  
* Scan your code for hardcoded paths, or paths specified in a format that is dependent on the underlying OS. For example, a path that is specified as Users/JohnSmith/mycode/main.py will make the code dependent on that directory existing in the file system. Change those to make them parameters.
+
* '''[https://www.dropbox.com/s/7fd53wr292x2w83/MakingSoftwareExecutableByOthers.pdf?dl=0 Presentation: Making your software executable by others]'''
 +
* '''[https://www.dropbox.com/s/65vdkac54vepia4/BestPracticesForMATLABCoding.pdf?dl=0 Presentation: Best practices for MATLAB coding]'''
  
* If your code has runtime dependencies make notes about them.  For example, if your code depends on a  certain R library make sure you specify what it is and how to find it.
+
== What to Do ==
  
* Write some documentation describing how the code should be invoked, its function, what assumptions it makes, any limitations of its use
+
There are a few simple things that you can do to make your code more usable by others.  Here are a few suggestions:
  
 +
* Locate the software that you used to generate the results.  Make sure it is modular and it is clear what the data flow across the different modules is.
  
== Training Materials ==
+
* If you have variables whose values are set in the code, think about making those values a parameter to the code.  This will expose to others the ability to change that value, and will make it easy for others to do so without reloading the code.
 +
 
 +
* Scan your code for hardcoded paths, or paths specified in a format that is dependent on the underlying OS.  For example, a path that is specified as Users/JohnSmith/mycode/main.py will make the code dependent on that directory existing in the file system.  Change those to make them parameters.
  
This training session was held on March 6, 2015:
+
* If your code has runtime dependencies make notes about them.  For example, if your code depends on a certain R library make sure you specify what it is and how to find it.
  
* '''Presentation -- to be posted'''
+
* Use ''build automation software'' (e.g., make, maven, etc) to compile your code, so that dependencies are tracked
  
=== Suggested Readings ===
+
* Write your code so that it gives informative messages to users when an error occurs and returns a proper failure exit code
  
* TBD
+
* Write some documentation describing how the code should be invoked, its function, what assumptions it makes, any limitations of its use.
  
== What To Do ==
+
* Create test datasets and describe what the output should be, so that others can be sure they are running your code correctly.
  
* TBD
 
  
  
Line 36: Line 39:
 
Expertise=Open_science|
 
Expertise=Open_science|
 
Owner=Yolanda_Gil|
 
Owner=Yolanda_Gil|
Progress=10|
+
Participants=Varun_ratnakar|
StartDate=2015-03-20|
+
Progress=20|
TargetDate=2015-04-03|
+
StartDate=2015-04-18|
 +
TargetDate=2015-05-01|
 
Type=Low}}
 
Type=Low}}

Latest revision as of 21:13, 7 May 2015


What This Task Involves

The training materials show how to prepare code so that it is more portable and it can be more easily used by others.

Training Materials

This training session was held on April 17, 2015:

What to Do

There are a few simple things that you can do to make your code more usable by others. Here are a few suggestions:

  • Locate the software that you used to generate the results. Make sure it is modular and it is clear what the data flow across the different modules is.
  • If you have variables whose values are set in the code, think about making those values a parameter to the code. This will expose to others the ability to change that value, and will make it easy for others to do so without reloading the code.
  • Scan your code for hardcoded paths, or paths specified in a format that is dependent on the underlying OS. For example, a path that is specified as Users/JohnSmith/mycode/main.py will make the code dependent on that directory existing in the file system. Change those to make them parameters.
  • If your code has runtime dependencies make notes about them. For example, if your code depends on a certain R library make sure you specify what it is and how to find it.
  • Use build automation software (e.g., make, maven, etc) to compile your code, so that dependencies are tracked
  • Write your code so that it gives informative messages to users when an error occurs and returns a proper failure exit code
  • Write some documentation describing how the code should be invoked, its function, what assumptions it makes, any limitations of its use.
  • Create test datasets and describe what the output should be, so that others can be sure they are running your code correctly.