mailRe: Formating issues in the 1.3 line


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

Header


Content

Posted by Sébastien Morin on July 17, 2007 - 19:10:
Hi,

Here is a patch (patch__empty_line_after_docstring__1.3_r3342) that fixes
formating issues concerning missing empty lines after docstrings as found 
using
the code_validator script. Two other small changes are also made in the
'float.py' file where a docstring was introduced with 4 ' symbols ('''')
instead of 3 (''') and where there was no space between a # symbol and the
following text (a comment).

Cheers


Séb  :)





Selon Sébastien Morin <sebastien.morin.1@xxxxxxxxx>, 16.07.2007:

Hi,

Here is the patch for function spacing again with the corrections you asked
for
(leaving only one empty line if there are class docstrings or variables
at the top of the function...

The commit log could be something like :

This patch (patch__function_spacing__1.3_r3341) fixes function spacing
formating
issues in the 1.3 line (r3341). The convention is to leave two empty lines
before a function definition. The issues were found with the code_validator
script and filtered so that when a function definition followed a class
docstring or class variable, only one empty line is left instead of two.

Ok, bye !


Séb :)



Selon Edward d'Auvergne <edward.dauvergne@xxxxxxxxx>, 15.07.2007:

Hi,

For this patch, most of the changes are good as it makes all functions
have 2 empty lines between them.  However for the spacing above the
first function within a class, I would recommend only one space if
there is a class docstring or class variables at the top.  Two empty
lines here is not necessary.

Cheers,

Edward


On 7/12/07, Sébastien Morin <sebastien.morin.1@xxxxxxxxx> wrote:
Hi,

Here is a patch that fixes function spacing (2 preceding empty lines)
issues of
the 1.3 line (r3340), except when a commented line precedes the function
(like
at line 31 of 'maths_fns/ri.py').

Cheers !


Séb  :)




Selon Sébastien Morin <sebastien.morin.1@xxxxxxxxx>, 11.07.2007:

Oups...

The file wasn't loaded onto the server when I pressed 'send'.

Sorry for that. It seems I should finish my coffee before sending
mails...

Ciao !


Séb  :P




Selon Sébastien Morin <sebastien.morin.1@xxxxxxxxx>, 11.07.2007:

Hi,

Here is a patch for revision 3339 of line 1.3 concerning all
indentation
issues
(without the tab issues inside the OpenDX strings.

This small patch modifies solely 2 files
('test_suite/system_tests/model_free.py' and 'float.py')

Ciao !



Séb



Selon Edward d'Auvergne <edward.dauvergne@xxxxxxxxx>, 10.07.2007:

Hi,

I've committed this 1.3 line patch to the repository (r3339).  I
specificially excluded the 'dx/isosurface_3D.py' file because 
these
changes could have caused the OpenDX programs to fail (the text
output
with trailing whitespace was generated by OpenDX itself, and
therefore
removing it might be dangerous).  If you could Seb, it would be
best
if the indentation fixes were placed into a patch for r3339 as
'patch__indentation_tab' modifies solely the 'dx/isosurface_3D.py'
file.  The indentation inside the strings embedded in this file
should
remain as they are because OpenDX may expect this indentation.

Cheers,

Edward



On 7/10/07, Sébastien Morin <sebastien.morin.1@xxxxxxxxx> wrote:
Hi Ed !

In fact, I thought about this but wasn't sure...

Here is the patch without the modification to the code where it
should
end
in '\
', thus without any modification to those files :

maths_fns/mf.py
maths_fns/jw_mf.py
maths_fns/jw_mf_comps.py
maths_fns/chi2.py
minimise/levenberg_marquardt.py
minimise/line_search/test_functions.py


Ciao !


Séb



Selon Edward d'Auvergne <edward.dauvergne@xxxxxxxxx>, 
10.07.2007:

Sorry, I didn't realise to warn you that the trailing single
space in
the equation lines which terminate in '\' are important.  This
character, if not followed by a space, will cause the newline
to
be
removed from the docstring in the python help system.  For
example if
you type

relax> from maths_fns import jw_mf
relax> help(jw_mf.calc_S2f_S2s_ts_d2jw_dS2fdS2s)

with the patch applied, you can see the issue - the middle 
line
gets
appended to the top line.  A similar issue occurs in the 
OpenDX
input
files that are created by relax.  All these special single
trailing
whitespaces are important.  I'm really sorry for not having
realised
earlier, it's been a long time since I worked on that code.

Regards,

Edward



On 7/10/07, Sébastien Morin <sebastien.morin.1@xxxxxxxxx>
wrote:
Hi,

Here is a patch for trailing whitespaces in the code for the
1.3
line
(revision
3338).

This should fix all formating issues of this kind for the
entire
code...

Ciao


Séb  :)






Selon Edward d'Auvergne <edward.dauvergne@xxxxxxxxx>,
09.07.2007:

Thanks.  Please try to keep different types of changes
separate
though.  All the changes so far are whitespace related so 
I
can
commit
the patch as fixing whitespace formatting in the 1.3 line.
If
there
are other changes, these should go as separate commits 
into
the
relax
repository.  That way I can decide if the whitespace 
commit
will
be
back ported to the 1.2 line (which isn't really necessary)
or
if
other
changes in individual commits should be back ported (some
probably
will while others may not).

Cheers,

Edward


On 7/9/07, Sebastien Morin <sebastien.morin.1@xxxxxxxxx>
wrote:
Hi Ed !

I will send a single large patch tomorrow when I have
corrected
more
code...

Bye


Séb



Edward d'Auvergne wrote:
Hi,

These minor formatting changes do need to made to the
repository.
Would you still have all the changes in your checked
out
copy
Séb?
If
you could send a single patch of all the changes, it
will
be
much
easier for me to apply.  That would be much
appreciated.

Thanks,

Edward


On 7/9/07, Sébastien Morin
<sebastien.morin.1@xxxxxxxxx>
wrote:
Hi all,

Here are a few patches solving fomating issues in the
1.3
line
(revision 3324).

patch_sample_scripts_palmer              ->
sample_scripts/palmer.py

patch_test_suite_runner                  ->
sample_scripts/relax_curve_diff.py

patch_sample_scripts_relax_curve_diff    ->
sample_scripts/remap.py

patch_test_suite_system_tests_jw_mapping ->
test_suite/formatting.py

patch_sample_scripts_remap               ->
test_suite/runner.py

patch_test_suite_system_tests_main       ->
test_suite/system_tests/jw_mapping.py

patch_test_suite_formatting              ->
test_suite/system_tests/main.py

patch_test_suite_system_tests_model_free ->
test_suite/system_tests/model_free.py


These are low importance changes but nevertheless the
work
needs
to
be done.

Cheers.


Séb :)
_______________________________________________
relax (http://nmr-relax.com)

This is the relax-devel mailing list
relax-devel@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-devel





--
         ______________________________________
     _______________________________________________
    |                                               |
   || Sebastien Morin                               ||
  ||| Etudiant au PhD en biochimie                  |||
 |||| Laboratoire de resonance magnetique nucleaire ||||
||||| Dr Stephane Gagne                             
|||||
 |||| CREFSIP (Universite Laval, Quebec, CANADA)    ||||
  ||| 1-418-656-2131 #4530                          |||
   ||                                               ||
    |_______________________________________________|
         ______________________________________









------------------------
Sébastien Morin
Étudiant M.Sc. Biochimie
Laboratoire S. Gagné
3252 Pav. Marchand (Université Laval)
Tél : (418) 656-2131 #4530
Fax : (418) 656-7176
e-mail : sebastien.morin.1@xxxxxxxxx






------------------------
Sébastien Morin
Étudiant M.Sc. Biochimie
Laboratoire S. Gagné
3252 Pav. Marchand (Université Laval)
Tél : (418) 656-2131 #4530
Fax : (418) 656-7176
e-mail : sebastien.morin.1@xxxxxxxxx






------------------------
Sébastien Morin
Étudiant M.Sc. Biochimie
Laboratoire S. Gagné
3252 Pav. Marchand (Université Laval)
Tél : (418) 656-2131 #4530
Fax : (418) 656-7176
e-mail : sebastien.morin.1@xxxxxxxxx


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

This is the relax-devel mailing list
relax-devel@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-devel





------------------------
Sébastien Morin
Étudiant M.Sc. Biochimie
Laboratoire S. Gagné
3252 Pav. Marchand (Université Laval)
Tél : (418) 656-2131 #4530
Fax : (418) 656-7176
e-mail : sebastien.morin.1@xxxxxxxxx



------------------------
Sébastien Morin
Étudiant M.Sc. Biochimie
Laboratoire S. Gagné
3252 Pav. Marchand (Université Laval)
Tél : (418) 656-2131 #4530
Fax : (418) 656-7176
e-mail : sebastien.morin.1@xxxxxxxxx






------------------------
Sébastien Morin
Étudiant M.Sc. Biochimie
Laboratoire S. Gagné
3252 Pav. Marchand (Université Laval)
Tél : (418) 656-2131 #4530
Fax : (418) 656-7176
e-mail : sebastien.morin.1@xxxxxxxxx



------------------------
Sébastien Morin
Étudiant M.Sc. Biochimie
Laboratoire S. Gagné
3252 Pav. Marchand (Université Laval)
Tél : (418) 656-2131 #4530
Fax : (418) 656-7176
e-mail : sebastien.morin.1@xxxxxxxxx
Index: test_suite/unit_tests/unit_test_runner.py
===================================================================
--- test_suite/unit_tests/unit_test_runner.py   (revision 3342)
+++ test_suite/unit_tests/unit_test_runner.py   (working copy)
@@ -288,6 +288,7 @@
         @rtype:
         @return:
         '''
+
     result = None
     packages = None
     package_path=get_module_relative_path(package_path, module_name)
Index: float.py
===================================================================
--- float.py    (revision 3342)
+++ float.py    (working copy)
@@ -121,7 +121,7 @@
 
 
 EXPONENT_SIGN_MASK= 0x7F
-'''' mask to select only bits from byte 8 of an ieee-754 double that are
+''' mask to select only bits from byte 8 of an ieee-754 double that are
 not part of the sign bit (0b11111110)'''
 
 ''' classes of floating point numbers'''
@@ -197,6 +197,7 @@
         throws -- an Exception if bytes contains < 8 bytes
                     type of exception not determined
     '''
+
     # pack bytes into binary string
     doubleString=pack('8B',*bytes)
 
@@ -246,6 +247,7 @@
         throws --  throws a TypeError if the the input object isn't a python 
float
 
     '''
+
     if not isinstance(obj,float):
         raise TypeError('the object recieved wasn\'t a float, type was: %s' 
% type(obj))
 
@@ -272,7 +274,8 @@
         throws --  throws an exception if obj is not composed of 8 bytes
 
     '''
-    #unpack bytes to a binary string (takes care of byte order)
+
+    # unpack bytes to a binary string (takes care of byte order)
     binaryString = floatToBinaryString(obj)
 
     # convert the binary string to an array of 8 bytes
@@ -327,6 +330,7 @@
 
         throws -- tthrows a TypeError if the the input object isn't a python 
float
     '''
+
     return not isPositive(obj)
 
 
@@ -506,6 +510,7 @@
 
         throws -- throws a TypeError if obj isn't a python float
     '''
+
     result = True
 
     # get the exponent as a byte array porperly masked
@@ -527,6 +532,7 @@
 
     throws -- throws a TypeError if obj isn't a python float
     '''
+
     result = True
 
     # get the mantissa as a byte array properly masked
@@ -608,6 +614,7 @@
 
         throws -- throws a TypeError if obj isn't a python float
     '''
+
     # bad result for code checking
     result = None
 
@@ -639,6 +646,7 @@
 
         throws -- throws a TypeError if obj isn't a python float
     '''
+
     return isInf(obj) and isPositive(obj)
 
 
Index: minimise/simplex.py
===================================================================
--- minimise/simplex.py (revision 3342)
+++ minimise/simplex.py (working copy)
@@ -168,6 +168,7 @@
 
     def order_simplex(self):
         """Order the vertecies of the simplex according to accending 
function values."""
+
         sorted = argsort(self.simplex_vals)
         self.simplex = take(self.simplex, sorted)
         self.simplex_vals = take(self.simplex_vals, sorted)

Related Messages


Powered by MHonArc, Updated Thu Jul 19 16:40:42 2007