bugpyFormex - Bugs: bug #37833, mesh (deep) copy

 
 

bug #37833: mesh (deep) copy

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  Thu 29 Nov 2012 08:42:10 PM UTC  
 
Category: CoreSeverity: 4 - Important
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 08 Jan 2013 01:07:43 PM UTC, comment #2:

Fixed in commit 53847a.
Renamed Mesh.copy to shallowCopy, and gave it a prop argument.
Mesh.copy is now Geometry.copy and will do a deep copy.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Tue 04 Dec 2012 08:56:45 PM UTC, comment #1:

I guess that method was implemented back in the beginning when much thought was given to minimal resource usage. And I have to admit I do not know if I ever really used it. But a deep copy might indeed be more useful than a shallow one. So I suggest it be changed AFTER we have checked where it is currently used.

If somebody/somewhere has a an application for shallow copies, we may think about adding a parameter (shallow=False).

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Thu 29 Nov 2012 08:42:10 PM UTC, original submission:

def copy() in geometry is a deep copy
but in mesh is redefined as non-deep copy.
Is it intentional?

Example:

m0=Mesh(Coords([[0.,0.,0.], [ 1.,0. ,0.]]), [[0, 1]])
m1=m0.copy()
print (m0.coords)

from copy import deepcopy
m1=deepcopy(m0)
m1.coords[1, 1]=5
print (m0.coords)

m1=m0.copy()#Mesh method is not a deep copy
m1.coords[1, 1]=5.
print (m0.coords)

gianluca de santis <gianlucadesi>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 08 Jan 2013 01:07:43 PM UTCbverhegCategoryNone=>Core
      Item GroupNone=>Functionality error
      StatusNone=>Fixed
      Assigned toNone=>bverheg
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1