Skip to content

Improvements to ABD - #122

Open
akhairna wants to merge 13 commits into
moble:mainfrom
akhairna:AsymptoticBondiData
Open

akhairna wants to merge 13 commits into
moble:mainfrom
akhairna:AsymptoticBondiData

Conversation

@akhairna

@akhairna akhairna commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Hi @moble, @duetosymmetry, and @keefemitman
I have added the improvements to ABD object, and I have managed to resolve the test failures locally.
Currently, I have initialized the fields as None instead of zeroes along with some changes to the setter properties of the fields. Now, if the field attribute is set to some value it creates a MTS object with zeros and then broadcasts the new values to it. A few methods and properties are added (& existing ones are modified) to support this structure.

Also, I replaced the _raw_data field with data method to construct data array for the fields that are given.
If the abd object is constructed with a subset of ($\sigma$, $\Psi_i$), then the BMS transformations work for those subset (given all the required fields are present).

If you have any suggestion on the structure of the code, please let me know.

The create_abd_from_h5 function can now take a subset of fields to construct
a valid ABD object.

@keefemitman keefemitman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @akhairna. I just found two issues with how copying/interpolation is being done; can you please fix them? Thanks!

Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved

@keefemitman keefemitman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think another change is needed

Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
@keefemitman

Copy link
Copy Markdown
Contributor

Looks good!

Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
@duetosymmetry

Copy link
Copy Markdown
Contributor

From the point of view of code complexity and avoiding pitfalls, I think the safest thing is to change the API of __init__. The user must declare, when they create the object, which fields they plan to fill. That way we don't have to worry about resizing and invalidating old views. Getters and setters will both fail in the same way if trying to access a field that wasn't in the list of expected fields passed to __init__

ABD object can be constructed with a subset of fields. The user specifies which field gets allocated in the memory.
@akhairna

Copy link
Copy Markdown
Contributor Author

@moble, @duetosymmetry & @keefemitman - After considering the pitfalls of resizing the array in place, these are the changes that we (me & Leo) think would be best approach. I changed the constructor of ABD, so that the user can declare which fields need to be allocated. The rest of the ABD class is the minimally changed to support this. The user can still give a subset of fields, and can enjoy playing with BMS transformations if the fields are consistent. The tests are running without any failures. Please let me know any feedback for this.

Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved

@keefemitman keefemitman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akhairna I think there are some outstanding issues with the key names, the constructor, and the way the copy is performed. Could you take a look? Let me know if you have any questions.

Also, I believe time_translation in map_to_superrest_frame will now raise a ValueError since it still calls the constructor without data_components.

Comment thread scri/SpEC/file_io/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved

@keefemitman keefemitman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akhairna sorry a few more things I noticed; also I don't think the change to time_translation() in map_to_superrest_frame line 673 was made?

Comment thread scri/SpEC/file_io/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Comment thread scri/asymptotic_bondi_data/__init__.py Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants