Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added metadata to model, and included it in printout #1874

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

dlakaplan
Copy link
Contributor

from pint.models import get_model
m=get_model("tests/datafile/NGC6440E.par")
print(m.as_parfile())

now returns:

# Created: 2024-12-12T13:41:07.865053
# PINT_version: 0.7+6065.g92675b80
# User: David Kaplan (kaplan)
# Host: plock
# OS: macOS-10.16-x86_64-i386-64bit
# Python: 3.9.7 (default, Sep 16 2021, 08:50:36) 
# [Clang 10.0.0 ]
# Format: pint
# read_time: 2024-12-12T13:41:04.663636
# allow_tcb: False
# convert_tcb: False
# allow_T2: False
# original_name: tests/datafile/NGC6440E.par
PSR                            1748-2021E
...

So there is now a metadata dictionary, which is initially populated with arguments that were used when reading in the par file along with the name of the file and the time it was read. Other parameters can be added, and will be included in the info string on printout.

Addresses #1873

@dlakaplan
Copy link
Contributor Author

@JPGlaser @rossjjennings : do you think this will do what you need?

@dlakaplan dlakaplan added enhancement awaiting review This PR needs someone to review it so it can be merged minor A minor PR that doesn't need a lot of thought IPTA Needed for IPTA DR labels Dec 13, 2024
@JPGlaser
Copy link

This looks great and should work perfectly for our cases.

~ Joe G.

@dlakaplan
Copy link
Contributor Author

OK, great. Maybe @abhisrkckl or someone else can review & merge.

@abhisrkckl abhisrkckl merged commit aa2eda3 into nanograv:master Dec 18, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review This PR needs someone to review it so it can be merged enhancement IPTA Needed for IPTA DR minor A minor PR that doesn't need a lot of thought
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants