Edward d'Auvergne wrote:
What an awesome effort Gary!!! That code is brilliant!
On 10/12/06, Gary S. Thompson <garyt@xxxxxxxxxxxxxxx> wrote:
Dear Ed and all
I have committed a revision which has functions for dealing with
ieee-754 doubles. There are a few points to note:
1. this does much more than the required task and covers most states of
python floats. This is because having sorted through how a ieee number
works it seemed easier to do all the 'float things' while I had my head
round it
The number of floating point functions is unbelievable, these should
come in very handy in the future. Thank you. Maybe after a bit of
polish you should consider submitting it for inclusion into Python.
'fpconst' is one day going into Python, but this code is a much more
advanced and complete implementation!
glad you liked it there are a few more 'goodies to follow'
2. it is a set of functions rather than a class as there seems to be no
reason to have a class...
Do you think it'll be sufficient to import the appropriate functions
by the module requiring the test?
yep, and that how I have done it!
3. as shown in the notes there are some things still to do
I've played around with it on both GNU/Linux and MS Windows XP and the
'isInf()' and 'isNaN()' functions return the correct value each time.
Unit tests would be a much more thorough way of testing it though. I
have been thinking about extending the relax test-suite to be
three-tiered: unit tests, functional or system tests, and regression
tests. Python has a decent unit test framework (called 'unittest').
These ideas should probably be discussed on another thread though. If
I was to integrate the unit test framework into relax, would you be
interested in writing unit tests for these new functions?
4. I haven't alterered
specific_fns/.svn/text-base/model_free.py.svn-base: #if
self.relax.float.isnan(self.func):
specific_fns/model_free.py: #if
self.relax.float.isnan(self.func):
yet
There are a few minor things which need to be sorted out. The first
thing is that relax no longer starts up. This is easy to fix though,
just delete the import line, etc. from the file 'relax'. The other
problem is this message:
done this, and know how to run the relax test suite now ;-)
DeprecationWarning: Non-ASCII character '\xe2' in file
/mnt/removable/relax/float.py on line 35, but no encoding declared;
see http://www.python.org/peps/pep-0263.html for details
done
The easy fix is to use standard ASCII characters to represent the
text. There are four instances where a Unicode (I'm assuming)
character appear in your new code. The next thing is import 'isInf'
and 'isNaN' into 'specific_fns/model_free.py' and uncomment the two
lines.
done
Gary would you like to make these three easy changes? I probably
won't have repository access until tomorrow. Thanks.
...
The following paragraph is just about cosmetic changes and the style
of the code. I hope I don't offend, these are just standard relax
conventions. One point which would be of benefit for future relax
developers (and possibly if you forget as well) is: would it be
possible to get a few more comments '# ...' interspersed within the
code of each function describing in plain English what each part of
the code is attempting to do? The functions jump around a lot calling
each other and a few more comments would make it easier to navigate
the code execution. I know that the amount of comments in relax is
ridiculous when compared to other code, but these comments do help
those who aren't fully fluent in Python to follow what is happening.
It would be very much appreciated. Would you mind making a few
cosmetic whitespace fixes to the trailing whitespace, leading
whitespace, number of newlines between functions, etc. for
consistency? As it is a package which can be imported into the
different parts of relax, it isn't too important that the docstrings,
etc. don't match the relax conventions. Did you use one of the
standard conventions with the 'obj', 'returns', and 'throws'
descriptions in the docstrings?
Thank you very much again,
Edward
.
Its no problem to do the cosmetic stuff and I will put the code into
the epydoc format when i get a chance (thats fairly easy it looks like
javadoc)
(I will try and find a code prettifier to do the spacing stuff, there is
a quite alot to do and pydev seems to be being remarkably uncooperative
on spacing sizes)
on another note
on the page http://www.nmr-relax.com/communication.html
there is the text
relax-commits
One last mailing list is the relax commits list. This list is reserved
for automatically generated posts created by the version control
software which looks after the relax source code and these web pages. If
you would like to become a developer, you can subscribe to the list at
relax-commits information page
<https://mail.gna.org/listinfo/relax-commits/>. The list can also be
browsed <https://mail.gna.org/public/relax-users/>.
browsed has the url https://mail.gna.org/public/relax-users/ ;-) so it
leeds to the user archive page not the commits page
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
-------------------------------------------------------------------
--- Begin Message ---
Edward d'Auvergne wrote:
What an awesome effort Gary!!! That code is brilliant!
On 10/12/06, Gary S. Thompson <garyt@xxxxxxxxxxxxxxx> wrote:
Dear Ed and all
I have committed a revision which has functions for dealing with
ieee-754 doubles. There are a few points to note:
1. this does much more than the required task and covers most states of
python floats. This is because having sorted through how a ieee number
works it seemed easier to do all the 'float things' while I had my head
round it
The number of floating point functions is unbelievable, these should
come in very handy in the future. Thank you. Maybe after a bit of
polish you should consider submitting it for inclusion into Python.
'fpconst' is one day going into Python, but this code is a much more
advanced and complete implementation!
glad you liked it there are a few more 'goodies to follow'
2. it is a set of functions rather than a class as there seems to be no
reason to have a class...
Do you think it'll be sufficient to import the appropriate functions
by the module requiring the test?
yep, and that how I have done it!
3. as shown in the notes there are some things still to do
I've played around with it on both GNU/Linux and MS Windows XP and the
'isInf()' and 'isNaN()' functions return the correct value each time.
Unit tests would be a much more thorough way of testing it though. I
have been thinking about extending the relax test-suite to be
three-tiered: unit tests, functional or system tests, and regression
tests. Python has a decent unit test framework (called 'unittest').
These ideas should probably be discussed on another thread though. If
I was to integrate the unit test framework into relax, would you be
interested in writing unit tests for these new functions?
4. I haven't alterered
specific_fns/.svn/text-base/model_free.py.svn-base: #if
self.relax.float.isnan(self.func):
specific_fns/model_free.py: #if
self.relax.float.isnan(self.func):
yet
There are a few minor things which need to be sorted out. The first
thing is that relax no longer starts up. This is easy to fix though,
just delete the import line, etc. from the file 'relax'. The other
problem is this message:
done this, and know how to run the relax test suite now ;-)
DeprecationWarning: Non-ASCII character '\xe2' in file
/mnt/removable/relax/float.py on line 35, but no encoding declared;
see http://www.python.org/peps/pep-0263.html for details
done
The easy fix is to use standard ASCII characters to represent the
text. There are four instances where a Unicode (I'm assuming)
character appear in your new code. The next thing is import 'isInf'
and 'isNaN' into 'specific_fns/model_free.py' and uncomment the two
lines.
done
Gary would you like to make these three easy changes? I probably
won't have repository access until tomorrow. Thanks.
...
The following paragraph is just about cosmetic changes and the style
of the code. I hope I don't offend, these are just standard relax
conventions. One point which would be of benefit for future relax
developers (and possibly if you forget as well) is: would it be
possible to get a few more comments '# ...' interspersed within the
code of each function describing in plain English what each part of
the code is attempting to do? The functions jump around a lot calling
each other and a few more comments would make it easier to navigate
the code execution. I know that the amount of comments in relax is
ridiculous when compared to other code, but these comments do help
those who aren't fully fluent in Python to follow what is happening.
It would be very much appreciated. Would you mind making a few
cosmetic whitespace fixes to the trailing whitespace, leading
whitespace, number of newlines between functions, etc. for
consistency? As it is a package which can be imported into the
different parts of relax, it isn't too important that the docstrings,
etc. don't match the relax conventions. Did you use one of the
standard conventions with the 'obj', 'returns', and 'throws'
descriptions in the docstrings?
Thank you very much again,
Edward
.
Its no problem to do the cosmetic stuff and I will put the code into
the epydoc format when i get a chance (thats fairly easy it looks like
javadoc)
(I will try and find a code prettifier to do the spacing stuff, there is
a quite alot to do and pydev seems to be being remarkably uncooperative
on spacing sizes)
on another note
on the page http://www.nmr-relax.com/communication.html
there is the text
relax-commits
One last mailing list is the relax commits list. This list is reserved
for automatically generated posts created by the version control
software which looks after the relax source code and these web pages. If
you would like to become a developer, you can subscribe to the list at
relax-commits information page
<https://mail.gna.org/listinfo/relax-commits/>. The list can also be
browsed <https://mail.gna.org/public/relax-users/>.
browsed has the url https://mail.gna.org/public/relax-users/ ;-) so it
leeds to the user archive page not the commits page
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
-------------------------------------------------------------------
--- End Message ---