pynbody / tangos

The Agile Numerical Galaxy Organisation System
BSD 3-Clause "New" or "Revised" License
19 stars 13 forks source link

TypeError error when linking #112

Open cphyc opened 4 years ago

cphyc commented 4 years ago

I am using tangos + pynbody + RAMSES and running into the following error:


2020-01-17 15:37:55,143 : generating pairs of timesteps
2020-01-17 15:38:27,150 : Linking <TimeStep 'delete_me/output_00101' z=0.34 t=9.58 Gyr> and <TimeStep 'delete_me/output_00102' z=0.33 t=9.69 Gyr>              
2020-01-17 15:38:27,181 : Gathering halo information for <TimeStep 'delete_me/output_00101' z=0.34 t=9.58 Gyr> and <TimeStep 'delete_me/output_00102' z=0.33 t=9.69 Gyr>                                                                                                                                                      
2020-01-17 15:43:07,808 : Exception during attempt to crosslink timesteps <TimeStep 'delete_me/output_00101' z=0.34 t=9.58 Gyr> and <TimeStep 'delete_me/output_00102' z=0.33 t=9.69 Gyr>                                                                                                                                     
Traceback (most recent call last):                                                                                                                             
  File "/home/ccadiou/codes/tangos/tangos/tools/crosslink.py", line 138, in crosslink_ts                                                                       
    output_handler_for_ts2=output_handler_2)                                                                                                                   
  File "/home/ccadiou/codes/tangos/tangos/input_handlers/pynbody.py", line 322, in match_objects                                                               
    only_family=pynbody.family.dm, groups_1=h1, groups_2=h2)                                                                                                   
  File "/home/ccadiou/.conda/envs/python3/lib/python3.7/site-packages/pynbody/bridge/__init__.py", line 124, in fuzzy_match_catalog                            
    transfer_matrix = self.catalog_transfer_matrix(min_index,max_index,groups_1,groups_2,use_family,only_family)                                               
  File "/home/ccadiou/.conda/envs/python3/lib/python3.7/site-packages/pynbody/bridge/__init__.py", line 180, in catalog_transfer_matrix                        
    g1 = groups_1.get_group_array(family=only_family)[restriction_start_indices]                                                                               
TypeError: get_group_array() got an unexpected keyword argument 'family'                                                                                       
2020-01-17 15:43:07,864 : Linking <TimeStep 'delete_me/output_00102' z=0.33 t=9.69 Gyr> and <TimeStep 'delete_me/output_00103' z=0.32 t=9.77 Gyr>              
2020-01-17 15:43:07,896 : Gathering halo information for <TimeStep 'delete_me/output_00102' z=0.33 t=9.69 Gyr> and <TimeStep 'delete_me/output_00103' z=0.32 t=9.77 Gyr>    ```
apontzen commented 4 years ago

It looks like the halo catalogue hasn’t implemented get_group_array for individual families. I assume this is using the AdaptaHOP catalogues? See https://github.com/pynbody/pynbody/blob/master/pynbody/halo/__init__.py#L208 for how it is handled with regular HOP.