mailRe: r2860 - /branches/test_suite/test_suite/unit_tests/unit_test_runner.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Gary S. Thompson on November 20, 2006 - 16:51:
Edward d'Auvergne wrote:

That looks awesome, thank you for porting the code into the
conventions used in relax.  The changes will significantly help with
the API docs, internal help system, etc. and will help standardise
these docs.  I have to apologise for the tediousness of these
standards - I realise this is not what you would normally expect from
source code.  The reason for these conventions is that I'm trying to
design the relax source code to be highly readable to allow NMR
spectroscopists, most of which are either not programmers or have just
a little programming experience, to be able to easily understand the
code and extend it's capabilities.  The point is to lower the barrier
of entry into relax so that non-programmers can read the code and
mimic it to add features that they find useful.  Because this is a
true open source project, many people will eventually read the code.
The number of people looking at the code is amplified by the fact the
users are NMR spectroscopists who are generally not afraid to dive
into code to find problems.


Thats fine and in fact a lot of opensource projects have quite strict conventions on layout. Though most don't expect as much commenting ;-) But the reasons for that are fair enough here (though there can be problems with comments and code getting out of sync, which is why most programmer prefer clear code to comments ;-))


Anyway, back to the code. In the copyright notice you have your name
followed by 'https://gna.org/users'. I tried the link but it said
'Invalid user: that user doesn't exist'. It may be better to have the
link to 'https://gna.org/users/varioustoxins'.


I'll do that

Once integrated into
relax, I think the 'get_startup_path()' can be dropped as
'sys.path[-1]' will give the same result.


I would like to avaoid that. The framework is designed so that you will be able to run parts of the relax unit tests without invoking relax... (i.e. it will have a 'main' function) and the only available convention to identify the startup directory is to look at sys.path[0]. The other thing to say here is that I guess that sys.path[0] ought to stay as the startup directory as this is the python convention (is there a pressing need to remove the relax path from the pythonpath?) Also get_startup_path() also allows for the case when sys.path[0] == '' which implies the current working directory. Finally if relax does need to put something before the startup path I guess the other alternative would be to salt the original path away somewhere else and pass it to test_runner and thence to test_finder. I could then remove the dependancy between test_finder and 'get_startup_path()

Although I don't have the
time to do this yet (I will find the time in the future), many of
these functions could be utilised by the system/function tests. In
the future they could possibly be shifted into a base class used by
both the unit and system/function tests.


This was my intention (chris and I talked quite alot about the best way to do this) and one of the next things on my list was to migrate one of the system test to use the 'unit test' framework. The reason the unit_test_runner is where it is is so that I have some unit tests to hand for testing I am intending to move it further up the hierachy.

I'll look into this once I
attempt to migrate the system/function tests to use parts or all of
the unittest framework. At the moment though, we could simply have
relax run the unit tests followed by the system/function tests (or the
other way around).


The intention was to have a functional test that ran the unit_tester ;-)

Each type of test could then return True or False
and relax could then print out (after printing all the other junk),
whether the unit tests passed, whether the system tests passed, and
then say that the test suite passed only if everything was ok.  I'll
look into implementing this layer.

Thanks for this effort,

Edward



On 11/20/06, garyt@xxxxxxxxxxxxxxx <garyt@xxxxxxxxxxxxxxx> wrote:

Author: varioustoxins
Date: Mon Nov 20 11:16:15 2006
New Revision: 2860

URL: http://svn.gna.org/viewcvs/relax?rev=2860&view=rev
Log:
changes to bring code into line with relax code conventions


Modified: branches/test_suite/test_suite/unit_tests/unit_test_runner.py 1. do you use the '_'function_name convention for private functions 2. I like the relax code style checke

[This mail would be too long, it was shortened to contain the URLs only.]

Modified: branches/test_suite/test_suite/unit_tests/unit_test_runner.py
URL: http://svn.gna.org/viewcvs/relax/branches/test_suite/test_suite/unit_tests/unit_test_runner.py?rev=2860&r1=2859&r2=2860&view=diff




_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits


.


Two other questions

1. do you use the '_'function_name convention for private functions
2. I like the relax code style checker (http://nmr-relax.com/scripts/code_validator). However, it seems to produce an annoying number of false positives, is this something that is being worked on? (it would be really nice to be able to run it and see no complaints on conforming code, it would make life much more asy for the devloper) Also I have a few pathological cases where it fails should i foward those as some sort of bug report?


regards
gary

--
-------------------------------------------------------------------
Dr Gary Thompson
Astbury Centre for Structural Molecular Biology,
University of Leeds, Astbury Building,
Leeds, LS2 9JT, West-Yorkshire, UK             Tel. +44-113-3433024
email: garyt@xxxxxxxxxxxxxxx                   Fax  +44-113-2331407
-------------------------------------------------------------------





Related Messages


Powered by MHonArc, Updated Tue Nov 21 09:40:40 2006