GeoscienceAustralia / eqrm

Automatically exported from code.google.com/p/eqrm
Other
5 stars 4 forks source link

bug with deep copy and versions of python <2.7 #56

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run trunk\misc_scripts\deep_copy_bug\eqrm_flags.py

What is the expected output? What do you see instead?
This is the  error;
 vulnerability_set = copy.deepcopy(self.vulnerability_set)
...
    return cls.__new__(cls, *args)
TypeError: instancemethod expected at least 2 arguments, got 0

Original issue reported on code.google.com by duncan.g...@gmail.com on 17 Jul 2012 at 12:55

GoogleCodeExporter commented 9 years ago
Seems to relate to this;
http://stackoverflow.com/questions/5614741/cant-use-a-list-of-methods-in-a-pytho
n-class-it-breaks-deepcopy-workaround

Original comment by duncan.g...@gmail.com on 17 Jul 2012 at 12:55

GoogleCodeExporter commented 9 years ago
The beginning of the error message;
  File "/nas/gemd/georisk_models/earthquake/sandpits/duncan/EQRM/trunk/eqrm_core/eqrm_code/analysis.py", line 231, in main
    all_sites = all_sites[parallel.calc_indices(num_sites)]
  File "/nas/gemd/georisk_models/earthquake/sandpits/duncan/EQRM/trunk/eqrm_core/eqrm_code/structures_vulnerability.py", line 172, in __getitem__

Original comment by duncan.g...@gmail.com on 17 Jul 2012 at 12:58

GoogleCodeExporter commented 9 years ago
python2.5 eqrm_code/test_structures_vulnerability.py * this fails, due to this 
bug
python2.5 test_all.py doesn't.  Why?

I didn't work out why.  But I implemented the fix suggested in stack overflow.  
That fixed it. revision 1189

Original comment by duncan.g...@gmail.com on 17 Jul 2012 at 1:30