bugpyFormex - Bugs: bug #46380, coords.match() only works for...

 
 

bug #46380: coords.match() only works for fused coords objects

Submitter:  gianluca de santis <gianlucadesi>
Submitted:  Thu 05 Nov 2015 02:05:54 PM UTC
   
 
Category:  Core Severity:  4 - Important
Item Group:  Documentation error Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 05 Nov 2015 02:29:22 PM UTC, comment #1: 

I do not like the idea of always forcing an extra fuse operation on each match. The user may (very likely) already have fused Coords, or he might want to do multiple match operations on the same Coords, where a single fuse would suffice.

Also, we may want to make Coords.match work on non-fused Coords.

Thus, let's just add a warning in the docs, and maybe a warning in the Coords.match, based on the fuse operation that is done in that method already (the first self.npoints() indices should all be unique).

Benedict Verhegghe <bverheg>
Group administrator
Thu 05 Nov 2015 02:05:54 PM UTC, original submission:  

coords.match(), which is also used in mesh.matchCoords and mesh.matchCentroids(), works only if the 2 Coords objects (self and coords) are 2 fused objects. If not, the result can be wrong. In the documentation this requirement is not reported in coords.match and Mesh.matchCoords but it is reported in Mesh.matchCentroids(): "self and Mesh are same eltype meshes and are both without duplicates".
I believe that it should be stated in the documentation that the 2 Coords objects should be fused. In addition I would include a param in the function to raise an error if the input objects are not fused. Something like that in coords.py:

def isFused(self, **kargs):
    return self.points().fuse(**kargs)[0].npoints() == self.npoints()


def match(self,coords,clean=False,checkinput=False,**kargs):
    """..."""
    if checkinput:
        if not (self.isFused(*kargs) and coords.isFused(*kargs)):
           raise ValueError("I can only match fused Coords objects")

Should we do that?

gianluca de santis <gianlucadesi>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bverheg (Posted a comment)
  • -email is unavailable- added by gianlucadesi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code