Ben,
I noticed that during the build time we are running not only unit tests
but also examples. This causes problems with paths to input data files
and forces each example to use complicated logic to calculate paths. I
believe it would be nice if examples were as simple as possible, since
they are meant to be read by the users. Would it be a good idea to
modify the build process to run examples from their respective
directories? This way all examples can use the relative paths and if a
user wishes to run an example, he/she can just cd to the example
directory and run it directly from there.
Thx,
Elina
Author: ben@SALILAB.ORG
Date: 2010-02-10 08:37:04 -0800 (Wed, 10 Feb 2010)
New Revision: 4751
Modified:
trunk/modules/restrainer/examples/basic_setup.py
Log:
Use get_example_path() to find inputs.
Modified: trunk/modules/restrainer/examples/basic_setup.py
===================================================================
--- trunk/modules/restrainer/examples/basic_setup.py 2010-02-10 16:07:22 UTC (rev 4750)
+++ trunk/modules/restrainer/examples/basic_setup.py 2010-02-10 16:37:04 UTC (rev 4751)
@@ -4,11 +4,13 @@
import IMP.restrainer
# Load molecular hierarchy definition
-RepParser = IMP.restrainer.XMLRepresentation('input/eg1_representation.xml')
+RepParser = IMP.restrainer.XMLRepresentation(
+ IMP.restrainer.get_example_path('input/eg1_representation.xml'))
representation = RepParser.run()
# Load the restraint set
-RestraintParser = IMP.restrainer.XMLRestraint('input/eg1_restraint.xml')
+RestraintParser = IMP.restrainer.XMLRestraint(
+ IMP.restrainer.get_example_path('input/eg1_restraint.xml'))
restraint = RestraintParser.run()
# Place representation into IMP model
_______________________________________________
IMP-commits mailing list
IMP-commits@salilab.org
https://salilab.org/mailman/listinfo/imp-commits