I want to apologize for the relative instability of the SVN tree in the past couple of days. Getting the scalarmath layout working took more C-API changes than I had anticipated. The SVN version of NumPy now builds scalarmath by default. The basic layout of the module is complete. However, there are many basic functions that are missing. As a result, during compile you will get many warnings about undefined functions. If an attempt were made to load the module it would cause an error as well due to undefined symbols. These undefined symbols are all the basic operations on fundamental c data-types that either need a function defined or a #define statement made. The names have this form: @name@_ctype_@oper@ where @name@ is one of the 16 Number-like types and @oper@ is one of the operations needing to be supported. The function (or macro) needs to implement the operation on the basic data-type and if necessary set an error-flag in the floating-point registers. If anybody has time to help implement these basic operations, it would be greatly appreciated. -Travis
On 4/27/06, Travis Oliphant <oliphant.travis@ieee.org> wrote:
[...] The function (or macro) needs to implement the operation on the basic data-type and if necessary set an error-flag in the floating-point registers.
If anybody has time to help implement these basic operations, it would be greatly appreciated.
I can help. To make sure we don't duplicate our effort, let's do the following: 1. I will add place-holders for all the necessary functions to make them return "NotImplemented". 2. I will then follow up with the list of functions that need to be filled out and we can then split the work. 3. We will also need to write tests that will make sure scalars behave similar to dimensionless arrays. If anyone would like to help with this, it will be greately appreciated. No C coding skills are necessary for that.
Sasha wrote:
On 4/27/06, Travis Oliphant <oliphant.travis@ieee.org> wrote:
[...] The function (or macro) needs to implement the operation on the basic data-type and if necessary set an error-flag in the floating-point registers.
If anybody has time to help implement these basic operations, it would be greatly appreciated.
I can help. To make sure we don't duplicate our effort, let's do the following:
1. I will add place-holders for all the necessary functions to make them return "NotImplemented".
just a minor reminder: raise NotImplementedError is the standard idiom for this. Cheers, f
Fernando Perez <Fernando.Perez@colorado.edu> writes: > Sasha wrote: >> On 4/27/06, Travis Oliphant <oliphant.travis@ieee.org> wrote: >> >>>[...] >>>The function (or macro) needs to implement the operation on the basic >>>data-type and if necessary set an error-flag in the floating-point >>>registers. >>> >>>If anybody has time to help implement these basic operations, it would >>>be greatly appreciated. >> I can help. To make sure we don't duplicate our effort, let's do >> the following: >> 1. I will add place-holders for all the necessary functions to make >> them return "NotImplemented". > > just a minor reminder: > > raise NotImplementedError > > is the standard idiom for this. Just a note: For __xxx__ methods, "return NotImplemented" is the standard idiom. See section 3.3.8 (Coercion rules) of the Python 2.4 language manual: For most intents and purposes, an operator that returns NotImplemented is treated the same as one that is not implemented at all. I believe the idea is that it's not actually an error for an __xxx__ method to not be implemented, as there are fallbacks. -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca
David M. Cooke wrote:
Fernando Perez <Fernando.Perez@colorado.edu> writes:
Sasha wrote:
On 4/27/06, Travis Oliphant <oliphant.travis@ieee.org> wrote:
[...] The function (or macro) needs to implement the operation on the basic data-type and if necessary set an error-flag in the floating-point registers.
If anybody has time to help implement these basic operations, it would be greatly appreciated.
I can help. To make sure we don't duplicate our effort, let's do the following: 1. I will add place-holders for all the necessary functions to make them return "NotImplemented".
just a minor reminder:
raise NotImplementedError
is the standard idiom for this.
Just a note: For __xxx__ methods, "return NotImplemented" is the standard idiom. See section 3.3.8 (Coercion rules) of the Python 2.4 language manual:
For most intents and purposes, an operator that returns NotImplemented is treated the same as one that is not implemented at all.
I believe the idea is that it's not actually an error for an __xxx__ method to not be implemented, as there are fallbacks.
You are right. It's worth remembering that the actual syntaxes are return NotImplemented and raise NotImplementedError /without/ quotes (as per the original msg), since these are actual python builtins, not strings. That way they can be properly handled by their return value or proper exception handling. Cheers, f
Sasha wrote:
On 4/27/06, Travis Oliphant <oliphant.travis@ieee.org> wrote:
[...] The function (or macro) needs to implement the operation on the basic data-type and if necessary set an error-flag in the floating-point registers.
If anybody has time to help implement these basic operations, it would be greatly appreciated.
I can help. To make sure we don't duplicate our effort, let's do the following:
Thanks for your help.
1. I will add place-holders for all the necessary functions to make
them return "NotImplemented".
The Python-object-returning functions are already there. All that is missing is the ctype functions to actually do the computation. So, I'm not sure what you mean.
2. I will then follow up with the list of functions that need to be filled out and we can then split the work.
This would be good to get a list. Some of the functions may require some repetition of what's in umathmodule.c. Let's just do the repetition for now and think about code refactoring after we know better what is actually duplicated.
3. We will also need to write tests that will make sure scalars behave similar to dimensionless arrays. If anyone would like to help with this, it will be greately appreciated. No C coding skills are necessary for that.
Tests would be necessary to ensure consistency. Thanks for jumping in... -Travis
On 4/27/06, Travis Oliphant <oliphant@ee.byu.edu> wrote:
[ ... ]
The Python-object-returning functions are already there. All that is missing is the ctype functions to actually do the computation. So, I'm not sure what you mean.
I did not realize that. However, it is still reasonable to add non-working prototypes to kill the warnings first marked by /* XXX */. I will do that before the end of the day.
2. I will then follow up with the list of functions that need to be filled out and we can then split the work.
This would be good to get a list.
See attached.
participants (5)
-
cookedm@physics.mcmaster.ca
-
Fernando Perez
-
Sasha
-
Travis Oliphant
-
Travis Oliphant